Skip to content

Commit

Permalink
搜索界面UI完成80%
Browse files Browse the repository at this point in the history
  • Loading branch information
YinTokey authored and YinTokey committed Jun 3, 2016
1 parent 7a4d4b3 commit 076c361
Show file tree
Hide file tree
Showing 60 changed files with 3,693 additions and 103 deletions.
153 changes: 137 additions & 16 deletions 仿搜狗阅读.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
23 changes: 23 additions & 0 deletions 仿搜狗阅读/Assets.xcassets/addBookIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "addBookIcon-1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "bookShelfSearchBtn-1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "search_sousuokuang-1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 53 additions & 33 deletions 仿搜狗阅读/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Navigation items with more than one left or right bar item" minToolsVersion="7.0"/>
</dependencies>
<scenes>
<!--Tab Bar Controller-->
Expand Down Expand Up @@ -44,7 +45,7 @@
</objects>
<point key="canvasLocation" x="35" y="-673"/>
</scene>
<!--书架-->
<!--搜狗阅读-->
<scene sceneID="Vc4-1u-gVT">
<objects>
<collectionViewController id="fpR-NT-pbL" customClass="BookshelfViewController" sceneMemberID="viewController">
Expand Down Expand Up @@ -73,7 +74,21 @@
<outlet property="delegate" destination="fpR-NT-pbL" id="qy5-iN-dNc"/>
</connections>
</collectionView>
<navigationItem key="navigationItem" title="书架" id="udO-im-EVr"/>
<toolbarItems/>
<navigationItem key="navigationItem" title="搜狗阅读" id="udO-im-EVr">
<rightBarButtonItems>
<barButtonItem image="addBookIcon" id="aKG-K2-VGc">
<color key="tintColor" red="0.97825420829999998" green="1" blue="0.95599642610000002" alpha="1" colorSpace="calibratedRGB"/>
</barButtonItem>
<barButtonItem image="bookShelfSearchBtn" id="68S-zO-9yL">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="searchBtnClick:" destination="fpR-NT-pbL" id="bDn-tg-eOn"/>
</connections>
</barButtonItem>
</rightBarButtonItems>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8CB-HO-d82" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down Expand Up @@ -119,13 +134,14 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="发现" id="TO4-Xj-zM7">
<barButtonItem key="rightBarButtonItem" image="search_sousuoicon" style="plain" id="3EQ-Ex-e4G">
<barButtonItem key="rightBarButtonItem" image="bookShelfSearchBtn" style="plain" id="3EQ-Ex-e4G">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<segue destination="II3-gP-jH2" kind="show" id="hih-iF-9fS"/>
<action selector="searchBtnClick:" destination="Eh3-9U-Agj" id="EZh-qQ-oj4"/>
</connections>
</barButtonItem>
</navigationItem>
<nil key="simulatedBottomBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
<connections>
<outlet property="discoverWebView" destination="u7e-tu-hWj" id="9x2-k9-xaY"/>
Expand All @@ -135,38 +151,34 @@
</objects>
<point key="canvasLocation" x="473" y="696"/>
</scene>
<!--Search Controller-->
<scene sceneID="0wA-Eg-Ba2">
<!--Search View Controller-->
<scene sceneID="ac3-VG-1Lb">
<objects>
<viewController id="II3-gP-jH2" customClass="YTSearchController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="goU-VE-SKF"/>
<viewControllerLayoutGuide type="bottom" id="sxv-nW-wg6"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Y3j-GG-9ao">
<rect key="frame" x="0.0" y="64" width="320" height="504"/>
<tableViewController storyboardIdentifier="searchVC" hidesBottomBarWhenPushed="YES" id="cxT-nr-QPt" customClass="YTSearchViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="7gv-Em-5Bk">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ETX-6e-TbU">
<rect key="frame" x="137" y="175" width="46" height="30"/>
<state key="normal" title="Button"/>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" id="vby-W7-HbH">
<barButtonItem key="rightBarButtonItem" title="取消" id="IDa-A0-iOP">
<connections>
<action selector="cancelBtnClick:" destination="II3-gP-jH2" id="yev-Kc-UWg"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" translucent="NO" prompted="NO"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="0bL-Oe-iDJ">
<rect key="frame" x="0.0" y="28" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0bL-Oe-iDJ" id="sge-e6-FqY">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="cxT-nr-QPt" id="I99-KS-lmw"/>
<outlet property="delegate" destination="cxT-nr-QPt" id="QDq-Bo-Oe9"/>
</connections>
</tableView>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IyL-0w-UQO" userLabel="First Responder" sceneMemberID="firstResponder"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="W9U-hN-npk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1032" y="462"/>
<point key="canvasLocation" x="845" y="475"/>
</scene>
<!--书城-->
<scene sceneID="I3k-Hm-ztw">
Expand Down Expand Up @@ -200,7 +212,14 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" title="书城" id="Elh-EW-UxO"/>
<navigationItem key="navigationItem" title="书城" id="Elh-EW-UxO">
<barButtonItem key="rightBarButtonItem" image="bookShelfSearchBtn" id="Tzo-BE-DM8">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="searchBtnClick:" destination="BYW-kr-Qzt" id="wOi-eb-Iuf"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="k7K-tb-NdP" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand All @@ -209,12 +228,13 @@
</scene>
</scenes>
<resources>
<image name="addBookIcon" width="20" height="20"/>
<image name="bookShelfSearchBtn" width="35" height="35"/>
<image name="bookshelftab_nl" width="23" height="23"/>
<image name="bookshelftab_sl" width="23" height="22"/>
<image name="bookstoretab_nl" width="23" height="23"/>
<image name="bookstoretab_sl" width="23" height="23"/>
<image name="faxiantab_nl" width="23" height="23"/>
<image name="faxiantab_sl" width="23" height="23"/>
<image name="search_sousuoicon" width="20" height="20"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
//

#import "BookshelfViewController.h"

#import "YTSearchController.h"
@interface BookshelfViewController ()
- (IBAction)searchBtnClick:(id)sender;


@end

Expand Down Expand Up @@ -90,4 +92,16 @@ - (void)collectionView:(UICollectionView *)collectionView performAction:(SEL)act
}
*/

- (IBAction)searchBtnClick:(id)sender {
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
transition.subtype = kCATransitionFromTop; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom
[self.navigationController.view.layer addAnimation:transition forKey:nil];

YTSearchController *searchVC = [[self storyboard]instantiateViewControllerWithIdentifier:@"searchVC"];

[[self navigationController]pushViewController:searchVC animated:NO];
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
//

#import "YTBookstoreViewController.h"

#import "YTSearchController.h"
@interface YTBookstoreViewController ()

- (IBAction)searchBtnClick:(id)sender;

@end

@implementation YTBookstoreViewController
Expand All @@ -35,4 +37,17 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
}
*/

- (IBAction)searchBtnClick:(id)sender {
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
transition.subtype = kCATransitionFromTop; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom
[self.navigationController.view.layer addAnimation:transition forKey:nil];

YTSearchController *searchVC = [[self storyboard]instantiateViewControllerWithIdentifier:@"searchVC"];

[[self navigationController]pushViewController:searchVC animated:NO];

}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@
//

#import "YTDiscoverViewController.h"

#import "YTSearchController.h"
#import "YTSearchViewController.h"
@interface YTDiscoverViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *discoverWebView;

- (IBAction)searchBtnClick:(id)sender;

@end

@implementation YTDiscoverViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.discoverWebView.scrollView.bounces = NO;



//加载网络地址
// self.discoverWebView.delegate = self;
NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://k.sogou.com/abs/ios/v3/find"]];
Expand All @@ -27,19 +31,23 @@ - (void)viewDidLoad {

}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/



- (IBAction)searchBtnClick:(id)sender {
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
transition.subtype = kCATransitionFromTop; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom
[self.navigationController.view.layer addAnimation:transition forKey:nil];

YTSearchViewController *searchVC = [[self storyboard]instantiateViewControllerWithIdentifier:@"searchVC"];



[[self navigationController]pushViewController:searchVC animated:NO];
}
@end
26 changes: 26 additions & 0 deletions 仿搜狗阅读/Classes/Lib/Masonry/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
26 changes: 26 additions & 0 deletions 仿搜狗阅读/Classes/Lib/Masonry/MASCompositeConstraint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// MASCompositeConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//

#import "MASConstraint.h"
#import "MASUtilities.h"

/**
* A group of MASConstraint objects
*/
@interface MASCompositeConstraint : MASConstraint

/**
* Creates a composite with a predefined array of children
*
* @param children child MASConstraints
*
* @return a composite constraint
*/
- (id)initWithChildren:(NSArray *)children;

@end
Loading

0 comments on commit 076c361

Please sign in to comment.