Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
😎Meizi 2.0 Released!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyyoung committed Jul 19, 2015
1 parent 443d2a7 commit 13749cb
Show file tree
Hide file tree
Showing 23 changed files with 210 additions and 80 deletions.
12 changes: 6 additions & 6 deletions Meizi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
7D7510B01B5672DE003CAF34 /* TopicRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D7510AF1B5672DE003CAF34 /* TopicRequest.m */; };
7D7510B31B5673B0003CAF34 /* Topic.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D7510B21B5673B0003CAF34 /* Topic.m */; };
7D7510B61B56767C003CAF34 /* TopicTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D7510B51B56767C003CAF34 /* TopicTableViewCell.m */; };
7D8A0AA41B58AA83001EDD42 /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D8A0AA31B58AA83001EDD42 /* WebViewController.m */; };
7D8A0AA81B58B482001EDD42 /* SettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D8A0AA71B58B482001EDD42 /* SettingViewController.m */; };
7D93B84F1ACFD7CF00453452 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D93B84E1ACFD7CF00453452 /* main.m */; };
7D93B8521ACFD7CF00453452 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D93B8511ACFD7CF00453452 /* AppDelegate.m */; };
7D93B8581ACFD7CF00453452 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7D93B8561ACFD7CF00453452 /* Main.storyboard */; };
7D93B85A1ACFD7CF00453452 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D93B8591ACFD7CF00453452 /* Images.xcassets */; };
7D93B87C1ACFDD2900453452 /* Meizi.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D93B87B1ACFDD2900453452 /* Meizi.m */; };
7DFF243D1B5B95800069BB4D /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFF243C1B5B95800069BB4D /* WebViewController.m */; };
E07A9DDEC7193BA0132EB02F /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 77EACF44A594DBA190E5C5FF /* libPods.a */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -79,8 +79,6 @@
7D7510B21B5673B0003CAF34 /* Topic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Topic.m; sourceTree = "<group>"; };
7D7510B41B56767C003CAF34 /* TopicTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopicTableViewCell.h; sourceTree = "<group>"; };
7D7510B51B56767C003CAF34 /* TopicTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopicTableViewCell.m; sourceTree = "<group>"; };
7D8A0AA21B58AA83001EDD42 /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = "<group>"; };
7D8A0AA31B58AA83001EDD42 /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = "<group>"; };
7D8A0AA61B58B482001EDD42 /* SettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingViewController.h; sourceTree = "<group>"; };
7D8A0AA71B58B482001EDD42 /* SettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingViewController.m; sourceTree = "<group>"; };
7D93B8491ACFD7CF00453452 /* Meizi.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Meizi.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -93,6 +91,8 @@
7D93B8761ACFDA1F00453452 /* Constant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constant.h; sourceTree = "<group>"; };
7D93B87A1ACFDD2900453452 /* Meizi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Meizi.h; sourceTree = "<group>"; };
7D93B87B1ACFDD2900453452 /* Meizi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Meizi.m; sourceTree = "<group>"; };
7DFF243B1B5B95800069BB4D /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = "<group>"; };
7DFF243C1B5B95800069BB4D /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -312,8 +312,8 @@
7D8A0AAD1B58B783001EDD42 /* WebView */ = {
isa = PBXGroup;
children = (
7D8A0AA21B58AA83001EDD42 /* WebViewController.h */,
7D8A0AA31B58AA83001EDD42 /* WebViewController.m */,
7DFF243B1B5B95800069BB4D /* WebViewController.h */,
7DFF243C1B5B95800069BB4D /* WebViewController.m */,
);
name = WebView;
sourceTree = "<group>";
Expand Down Expand Up @@ -500,7 +500,7 @@
7D7510971B5652DA003CAF34 /* Groups.m in Sources */,
7D7510B01B5672DE003CAF34 /* TopicRequest.m in Sources */,
7D4375F31B5520AF001CEBC9 /* RankRequest.m in Sources */,
7D8A0AA41B58AA83001EDD42 /* WebViewController.m in Sources */,
7DFF243D1B5B95800069BB4D /* WebViewController.m in Sources */,
7D4375E81B550BC6001CEBC9 /* MeiziCell.m in Sources */,
7D4375FD1B552695001CEBC9 /* GroupsViewController.m in Sources */,
7D4375E51B5508D3001CEBC9 /* MeiziRequest.m in Sources */,
Expand Down
13 changes: 13 additions & 0 deletions Meizi/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

//Set Background Color
self.window.backgroundColor = [UIColor whiteColor];

//Set Network
[AFNetworkActivityIndicatorManager sharedManager].enabled = YES;
[YTKNetworkConfig sharedInstance].baseUrl = BaseURL;

//Set UserAgent
NSDictionary *userAgent = @{@"UserAgent": @"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H143 Safari/600.1.4"};
[[NSUserDefaults standardUserDefaults] registerDefaults:userAgent];

//Set SVProgressHUD
[SVProgressHUD setBackgroundColor:[UIColor colorWithWhite:0.0 alpha:0.9]];
[SVProgressHUD setForegroundColor:[UIColor whiteColor]];

return YES;
}

Expand Down
57 changes: 55 additions & 2 deletions Meizi/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,67 @@
<!--Web View Controller-->
<scene sceneID="nxM-t7-6Li">
<objects>
<viewController id="X1o-kV-HSe" customClass="WebViewController" sceneMemberID="viewController">
<viewController hidesBottomBarWhenPushed="YES" id="X1o-kV-HSe" customClass="WebViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="xxs-v7-IwX"/>
<viewControllerLayoutGuide type="bottom" id="6CN-0K-ULD"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="qxu-b2-gvi">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<webView opaque="NO" contentMode="scaleToFill" scalesPageToFit="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5IX-e3-kPG">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="delegate" destination="X1o-kV-HSe" id="dm9-eU-qxh"/>
</connections>
</webView>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Mlg-11-Wgb">
<rect key="frame" x="0.0" y="556" width="600" height="44"/>
<items>
<barButtonItem enabled="NO" image="GoBack" id="osX-p4-DBh">
<connections>
<action selector="goBack" destination="5IX-e3-kPG" id="mDO-Gh-Ll2"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="dy5-x9-PEG"/>
<barButtonItem enabled="NO" image="GoForward" id="P0g-61-UOs">
<connections>
<action selector="goForward" destination="5IX-e3-kPG" id="13w-Iq-hNW"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="cB1-KK-eaz"/>
<barButtonItem systemItem="stop" id="2KB-Am-nP2">
<connections>
<action selector="stopLoading" destination="5IX-e3-kPG" id="8r2-WK-qSU"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="Xoe-f3-Klc"/>
<barButtonItem systemItem="refresh" id="O2m-gj-YI4">
<connections>
<action selector="reload" destination="5IX-e3-kPG" id="q0Q-1j-cRc"/>
</connections>
</barButtonItem>
</items>
</toolbar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="5IX-e3-kPG" firstAttribute="leading" secondItem="qxu-b2-gvi" secondAttribute="leading" id="QkJ-nZ-qfc"/>
<constraint firstItem="5IX-e3-kPG" firstAttribute="top" secondItem="qxu-b2-gvi" secondAttribute="top" id="Wes-it-BdO"/>
<constraint firstAttribute="bottom" secondItem="Mlg-11-Wgb" secondAttribute="bottom" id="Wme-W8-5X2"/>
<constraint firstAttribute="bottom" secondItem="5IX-e3-kPG" secondAttribute="bottom" id="eXA-kU-ecT"/>
<constraint firstAttribute="trailing" secondItem="Mlg-11-Wgb" secondAttribute="trailing" id="f9g-Kh-zw5"/>
<constraint firstItem="Mlg-11-Wgb" firstAttribute="leading" secondItem="qxu-b2-gvi" secondAttribute="leading" id="gai-EV-0DH"/>
<constraint firstAttribute="trailing" secondItem="5IX-e3-kPG" secondAttribute="trailing" id="zmg-ed-0ad"/>
</constraints>
</view>
<connections>
<outlet property="goBackButton" destination="osX-p4-DBh" id="fuC-Fs-DAa"/>
<outlet property="goForwardButton" destination="P0g-61-UOs" id="F6m-f3-lqH"/>
<outlet property="webView" destination="5IX-e3-kPG" id="znM-b2-mbN"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="oug-Vw-3Xv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Expand Down Expand Up @@ -643,14 +694,16 @@
</scenes>
<resources>
<image name="Avatar" width="25" height="25"/>
<image name="GoBack" width="22" height="22"/>
<image name="GoForward" width="22" height="22"/>
<image name="Group" width="25" height="25"/>
<image name="Home" width="25" height="25"/>
<image name="Rank" width="25" height="25"/>
<image name="Search" width="25" height="25"/>
<image name="Setting" width="25" height="24"/>
</resources>
<inferredMetricsTieBreakers>
<segue reference="M7Z-g2-il8"/>
<segue reference="zdF-wh-WCW"/>
</inferredMetricsTieBreakers>
<color key="tintColor" red="0.1450980392" green="0.67843137249999996" blue="0.90588235289999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</document>
25 changes: 13 additions & 12 deletions Meizi/Constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
#define SCREEN_WIDTH CGRectGetWidth([UIApplication sharedApplication].keyWindow.bounds)
#define SCREEN_HEIGHT CGRectGetHeight([UIApplication sharedApplication].keyWindow.bounds)

static NSString * const BaseURL = @"http://api.xiaojianjian.net";
static NSString * const BaseURL = @"http://api.xiaojianjian.net";

static NSString * const Meizi_All = @"0";
static NSString * const Meizi_DaXiong = @"2";
static NSString * const Meizi_QiaoTun = @"6";
static NSString * const Meizi_HeiSi = @"7";
static NSString * const Meizi_MeiTui = @"3";
static NSString * const Meizi_QingXin = @"4";
static NSString * const Meizi_ZaHui = @"5";
static NSString * const Meizi_All = @"0";
static NSString * const Meizi_DaXiong = @"2";
static NSString * const Meizi_QiaoTun = @"6";
static NSString * const Meizi_HeiSi = @"7";
static NSString * const Meizi_MeiTui = @"3";
static NSString * const Meizi_QingXin = @"4";
static NSString * const Meizi_ZaHui = @"5";

static NSString * const DoubanGroupURL= @"http://www.douban.com/group/";
static NSString * const DoubanTopicURL= @"http://www.douban.com/group/topic/";
static NSString * const DBMeiNvTopicURL = @"http://www.dbmeinv.com/dbgroup/app/topic_detail.htm?id=";
static NSString * const DoubanGroupURL = @"http://www.douban.com/group/";
static NSString * const DoubanTopicURL = @"http://www.douban.com/group/topic/";
static NSString * const DoubanPeopleURL = @"http://www.douban.com/group/people/";

#endif

Expand All @@ -43,4 +43,5 @@ static NSString * const DBMeiNvTopicURL = @"http://www.dbmeinv.com/dbgroup/app/t
//
//- 精选: queryType = rank & pageIndex = 1
//- 小组: m = groups
//- 搜妹: m = topic_users & key = 关键词 & pageIndex = 1
//- 搜妹: m = topic_users & key = 关键词 & pageIndex = 1
//static NSString * const DBMeinvTopicURL = @"http://www.dbmeinv.com/dbgroup/app/topic_detail.htm?id=";
Binary file added Meizi/Images.xcassets/Cancel.imageset/Cancel.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions Meizi/Images.xcassets/Cancel.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Cancel.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
12 changes: 12 additions & 0 deletions Meizi/Images.xcassets/GoBack.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "GoBack.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added Meizi/Images.xcassets/GoBack.imageset/GoBack.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions Meizi/Images.xcassets/GoForward.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "GoForward.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
23 changes: 0 additions & 23 deletions Meizi/Images.xcassets/PlaceholderImage.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Meizi/Images.xcassets/Refresh.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Refresh.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
1 change: 0 additions & 1 deletion Meizi/PrefixHeader.pch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#import <SVProgressHUD/SVProgressHUD.h>
#import <MWPhotoBrowser/MWPhotoBrowser.h>
#import <SDWebImage/UIImageView+WebCache.h>
#import <KINWebBrowser/KINWebBrowserViewController.h>
#import <UIActivityIndicator-for-SDWebImage/UIImageView+UIActivityIndicatorForSDWebImage.h>

#import "Constant.h"
Expand Down
4 changes: 3 additions & 1 deletion Meizi/SearchViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
Result *result = [self.resultArray objectAtIndex:indexPath.row];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@/", DoubanPeopleURL, result.c_user_id]];
[self performSegueWithIdentifier:@"toWebViewSection" sender:@{@"title": result.c_nick_name,
@"url": [NSURL URLWithString:result.c_people_url]}];
@"url": url}];
}

#pragma mark - SearchBar Delegate
Expand Down
8 changes: 4 additions & 4 deletions Meizi/TopicViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
Topic *topic = [self.topicArray objectAtIndex:indexPath.row];
NSURL *url = [NSURL URLWithString:[DBMeiNvTopicURL stringByAppendingString:@(topic.topic_id).stringValue]];
// KINWebBrowserViewController *webViewController = [KINWebBrowserViewController webBrowser];
// [self.navigationController pushViewController:webViewController animated:YES];
// [webViewController loadURL:url];
NSString *referer = [DoubanGroupURL stringByAppendingString:topic.douban_group_id];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@/", DoubanTopicURL, @(topic.douban_topic_id)]];
[self performSegueWithIdentifier:@"toWebViewSection" sender:@{@"title": topic.topic_title,
@"referer": referer,
@"url": url}];
}

Expand All @@ -126,6 +125,7 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
WebViewController *webViewController = segue.destinationViewController;
webViewController.title = sender[@"title"];
webViewController.url = sender[@"url"];
webViewController.referer = sender[@"referer"];
}
}

Expand Down
13 changes: 9 additions & 4 deletions Meizi/WebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
// WebViewController.h
// Meizi
//
// Created by Sunnyyoung on 15/7/17.
// Created by Sunnyyoung on 15/7/19.
// Copyright (c) 2015年 Sunnyyoung. All rights reserved.
//

#import <KINWebBrowser/KINWebBrowserViewController.h>
#import <UIKit/UIKit.h>

@interface WebViewController : KINWebBrowserViewController
@interface WebViewController : UIViewController

@property (nonatomic, copy) NSURL *url;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *goBackButton;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *goForwardButton;

@property (nonatomic, strong) NSURL *url;
@property (nonatomic, copy) NSString *referer;
@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end
Loading

0 comments on commit 13749cb

Please sign in to comment.