├── Demo
├── demo.gif
├── IPSqueezableViewController
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── IPViewController.h
│ ├── IPAppDelegate.h
│ ├── main.m
│ ├── IPSqueezableViewController-Prefix.pch
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── IPViewController.m
│ ├── IPSqueezableViewController-Info.plist
│ ├── IPAppDelegate.m
│ └── Base.lproj
│ │ └── Main.storyboard
├── demo-safari.gif
├── IPSqueezableViewControllerTests
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── IPSqueezableViewControllerTests-Info.plist
│ └── IPSqueezableViewControllerTests.m
└── IPSqueezableViewController.xcodeproj
│ ├── project.xcworkspace
│ └── contents.xcworkspacedata
│ └── project.pbxproj
├── Resources
├── backButton.png
├── backButton@2x.png
├── invisibleBackButton.png
└── invisibleBackButton@2x.png
├── .gitignore
├── IPSqueezableViewController.podspec
├── LICENSE
├── Classes
├── IPNavBarSqueezableViewController.h
└── IPNavBarSqueezableViewController.m
└── README.md
/Demo/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zetachang/IPSqueezableViewController/HEAD/Demo/demo.gif
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Demo/demo-safari.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zetachang/IPSqueezableViewController/HEAD/Demo/demo-safari.gif
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewControllerTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Resources/backButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zetachang/IPSqueezableViewController/HEAD/Resources/backButton.png
--------------------------------------------------------------------------------
/Resources/backButton@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zetachang/IPSqueezableViewController/HEAD/Resources/backButton@2x.png
--------------------------------------------------------------------------------
/Resources/invisibleBackButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zetachang/IPSqueezableViewController/HEAD/Resources/invisibleBackButton.png
--------------------------------------------------------------------------------
/Resources/invisibleBackButton@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zetachang/IPSqueezableViewController/HEAD/Resources/invisibleBackButton@2x.png
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/IPViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // IPViewController.h
3 | // IPSqueezableViewController
4 | //
5 | // Created by zeta on 2014/5/15.
6 | // Copyright (c) 2014年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "IPNavBarSqueezableViewController.h"
11 |
12 | @interface IPViewController : IPNavBarSqueezableViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/IPAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // IPAppDelegate.h
3 | // IPSqueezableViewController
4 | //
5 | // Created by zeta on 2014/5/15.
6 | // Copyright (c) 2014年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface IPAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // IPSqueezableViewController
4 | //
5 | // Created by zeta on 2014/5/15.
6 | // Copyright (c) 2014年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "IPAppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([IPAppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/IPSqueezableViewController-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "40x40",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "60x60",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/IPViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // IPViewController.m
3 | // IPSqueezableViewController
4 | //
5 | // Created by zeta on 2014/5/15.
6 | // Copyright (c) 2014年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import "IPViewController.h"
10 |
11 | @interface IPViewController ()
12 | @property (weak, nonatomic) IBOutlet UITextView *textView;
13 |
14 | @end
15 |
16 | @implementation IPViewController
17 |
18 | - (void)viewDidLoad
19 | {
20 | [super viewDidLoad];
21 | self.title = @"A Long Long Long Story";
22 | }
23 |
24 | - (void)didReceiveMemoryWarning
25 | {
26 | [super didReceiveMemoryWarning];
27 | // Dispose of any resources that can be recreated.
28 | }
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewControllerTests/IPSqueezableViewControllerTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | com.shotdoor.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/IPSqueezableViewController.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = "IPSqueezableViewController"
3 | s.version = "0.0.2"
4 | s.summary = "Condensing effect of navigation bar as the one in Safari.app "
5 |
6 | s.description = <<-DESC
7 | A condensing effect of navigation bar as we see in Safari.app. Support iOS 7.
8 | DESC
9 |
10 | s.homepage = "http://github.com/zetachang/IPSqueezableViewController"
11 |
12 | s.license = "MIT"
13 |
14 | s.author = "David Chang"
15 | s.social_media_url = "http://twitter.com/zetachang"
16 |
17 | s.platform = :ios, "7.0"
18 |
19 | s.source = { :git => "https://github.com/zetachang/IPSqueezableViewController.git", :tag => "#{s.version}" }
20 |
21 | s.source_files = "Classes"
22 |
23 | s.resources = "Resources/*.png"
24 |
25 | s.requires_arc = true
26 | end
27 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewControllerTests/IPSqueezableViewControllerTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // IPSqueezableViewControllerTests.m
3 | // IPSqueezableViewControllerTests
4 | //
5 | // Created by zeta on 2014/5/15.
6 | // Copyright (c) 2014年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface IPSqueezableViewControllerTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation IPSqueezableViewControllerTests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Yi-Cheng Chang (http://github.com/zetachang)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Classes/IPNavBarSqueezableViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // IPNavBarSqueezableViewController.h
3 | // iPTT
4 | //
5 | // Created by zeta on 13/10/19.
6 | // Copyright (c) 2013年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface IPNavBarSqueezableViewController : UIViewController
13 |
14 | @property (nonatomic, weak) IBOutlet UIScrollView *triggeringScrollView;
15 |
16 | @property (nonatomic, strong) UIFont *titleFont;
17 | @property (nonatomic, strong) UIColor *titleColor;
18 |
19 | @property (nonatomic, copy) void (^squeezeCompletion)(void); // nil by default
20 | @property (nonatomic, copy) void (^expandCompletion)(void); // nil by default
21 |
22 | // inheritance
23 | - (void)processBars NS_REQUIRES_SUPER;
24 | - (void)squeezeBars NS_REQUIRES_SUPER;
25 | - (void)expandBars NS_REQUIRES_SUPER;
26 |
27 | - (NSString *)squeezedTitle:(NSString *)title; // @"[ %@ ]" by default
28 |
29 | #pragma mark - Scroll View Delegate
30 |
31 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView NS_REQUIRES_SUPER;
32 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView NS_REQUIRES_SUPER;
33 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView
34 | withVelocity:(CGPoint)velocity
35 | targetContentOffset:(inout CGPoint *)targetContentOffset NS_REQUIRES_SUPER;
36 | - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView NS_REQUIRES_SUPER;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/IPSqueezableViewController-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.shotdoor.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IPSqueezableViewController
2 |
3 | **Condensing effect of navigation bar as the one in Safari.app**
4 |
5 | Though iOS 8 introduce the `condensesBarsOnSwipe` property. It's still not the same as the one we see in Safari.app.
6 |
7 | ## Demo
8 |
9 | | Safari | IPSqueezableViewController |
10 | | ------------- | --------------------------- |
11 | |  |  |
12 |
13 | ## Installation
14 |
15 | [CocoaPods](http://cocoapods.org) is the recommended method to install. Simply add the following line to your `Podfile`:
16 |
17 | #### Podfile
18 |
19 | ```ruby
20 | pod 'IPSqueezableViewController'
21 | ```
22 |
23 | ## Usage
24 |
25 | 1. Make your view controller inherit `IPSqueezableViewController`.
26 | 2. Set up the `triggeringScrollView` property as the scrollview you want to trigger the condensing effect.
27 | 3. Set up `ip_rightNavBarItem` property to the bar button item you want to show as the right bar button item of the view controller.
28 | 4. See `Demo/IPSqueezableViewController.xcodepro` for example.
29 |
30 | ## Requirements
31 |
32 | * The subclass of IPSqueezableViewController must be contained in a `UINavigationController` and **cannot** be the `topViewController` of a `UINavigationController`.
33 |
34 | ## Contributions
35 |
36 | Suggestions or PR are welcome :-)
37 |
38 | ## Contact
39 |
40 | [David Chang](http://github.com/zetachang)
41 | [@zetachang](https://twitter.com/zetachang)
42 |
43 | ## License
44 |
45 | In short, IPSqueezableViewController is available under the MIT license. See the LICENSE file for more info.
46 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/IPAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // IPAppDelegate.m
3 | // IPSqueezableViewController
4 | //
5 | // Created by zeta on 2014/5/15.
6 | // Copyright (c) 2014年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import "IPAppDelegate.h"
10 |
11 | @implementation IPAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | self.window.tintColor = [UIColor redColor];
17 | return YES;
18 | }
19 |
20 | - (void)applicationWillResignActive:(UIApplication *)application
21 | {
22 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
23 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
24 | }
25 |
26 | - (void)applicationDidEnterBackground:(UIApplication *)application
27 | {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | - (void)applicationWillEnterForeground:(UIApplication *)application
33 | {
34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35 | }
36 |
37 | - (void)applicationDidBecomeActive:(UIApplication *)application
38 | {
39 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
40 | }
41 |
42 | - (void)applicationWillTerminate:(UIApplication *)application
43 | {
44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
45 | }
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/Classes/IPNavBarSqueezableViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // IPNavBarSqueezableViewController.m
3 | // iPTT
4 | //
5 | // Created by zeta on 13/10/19.
6 | // Copyright (c) 2013年 shotdoor. All rights reserved.
7 | //
8 |
9 | #import "IPNavBarSqueezableViewController.h"
10 |
11 | /**
12 | Uncomment to debug
13 | */
14 | // #define DEBUG_SQUEEZE
15 |
16 | #define SCREEN_WIDTH ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) \
17 | || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) \
18 | ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] bounds].size.height)
19 |
20 | #define NAVBAR_HEIGHT ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) \
21 | || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? 44.f : 32.f)
22 |
23 | #define TOOLBAR_HEIGHT ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) \
24 | || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? 49.f : 32.f)
25 |
26 |
27 | static const CGFloat kSqueezedNavigationBarHeight = 20.f;
28 | static const CGFloat kStatusBarHeight = 20.f;
29 | static const NSTimeInterval kAnimationDuration = 0.25;
30 |
31 |
32 | typedef NS_ENUM(NSInteger, IPNavBarSqueezingStatus) {
33 | IPNavBarSqueezingStatusNormal,
34 | IPNavBarSqueezingStatusProgress,
35 | IPNavBarSqueezingStatusSqueezing,
36 | IPNavBarSqueezingStatusSqueezed,
37 | IPNavBarSqueezingStatusUnSqueezing
38 | };
39 |
40 |
41 | @interface IPNavBarSqueezableViewController ()
42 |
43 | @property (nonatomic) IPNavBarSqueezingStatus navBarStatus;
44 | @property (nonatomic, strong) UILabel *titleViewPlaceholder; // compact placeholder for title view
45 | @property (nonatomic, strong) UIView *titleViewOriginal; // original full size title view
46 | @property (nonatomic, strong) NSArray *leftBarButtonItems;
47 | @property (nonatomic, strong) NSArray *rightBarButtonItems;
48 | @property (nonatomic) BOOL dragStart;
49 | @property (nonatomic) CGFloat previousYOffset;
50 | @property (nonatomic, strong) UITapGestureRecognizer *recognizer;
51 |
52 | @end
53 |
54 |
55 | @implementation IPNavBarSqueezableViewController
56 |
57 | - (void)viewDidLoad
58 | {
59 | [super viewDidLoad];
60 | // Set up scroll to squeeze
61 | self.navBarStatus = IPNavBarSqueezingStatusNormal;
62 | self.dragStart = NO;
63 |
64 | // Set up title view
65 | self.titleViewOriginal = self.navigationItem.titleView;
66 | self.titleViewPlaceholder = [[UILabel alloc] initWithFrame:CGRectMake(0.f, 0.f,
67 | SCREEN_WIDTH * 220.f / 320.f,
68 | kStatusBarHeight)];
69 | self.titleViewPlaceholder.textAlignment = NSTextAlignmentCenter;
70 | self.titleViewPlaceholder.lineBreakMode = NSLineBreakByTruncatingTail;
71 | self.titleViewPlaceholder.textColor = self.titleColor ? self.titleColor
72 | : self.navigationController.navigationBar.tintColor;
73 | // Recognize tap on nav bar
74 | self.recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
75 | action:@selector(navBarTapped:)];
76 | self.recognizer.numberOfTapsRequired = 1;
77 |
78 | // Swipe to pop
79 | UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self
80 | action:@selector(swippedToPop:)];
81 | recognizer.direction = UISwipeGestureRecognizerDirectionRight;
82 | [self.view addGestureRecognizer:recognizer];
83 |
84 | [self.navigationController setToolbarHidden:NO
85 | animated:NO];
86 | }
87 |
88 | - (void)swippedToPop:(id)sender
89 | {
90 | [self.navigationController popViewControllerAnimated:YES];
91 | }
92 |
93 | - (void)viewWillAppear:(BOOL)animated
94 | {
95 | [super viewWillAppear:animated];
96 |
97 | // Set up font
98 | if (!self.titleFont) {
99 | UIFont *navigationBarTitleFont =
100 | (UIFont *)self.navigationController.navigationBar.titleTextAttributes[NSFontAttributeName];
101 | self.titleFont = navigationBarTitleFont ? [UIFont systemFontOfSize:navigationBarTitleFont.pointSize]
102 | : [UIFont systemFontOfSize:17.f];
103 | }
104 | [self.transitionCoordinator animateAlongsideTransition:
105 | ^(id context) {
106 | if ([context presentationStyle] == UIModalPresentationNone){
107 | self.titleViewPlaceholder.frame = CGRectOffset(self.titleViewPlaceholder.frame, -200.f, 0.f);
108 | }
109 | } completion:nil];
110 |
111 | self.navigationItem.hidesBackButton = NO;
112 | self.navigationController.toolbarHidden = NO;
113 |
114 | self.triggeringScrollView.contentInset = UIEdgeInsetsMake(NAVBAR_HEIGHT + kStatusBarHeight,
115 | 0.f,
116 | TOOLBAR_HEIGHT,
117 | 0.f);
118 | }
119 |
120 | - (void)viewWillDisappear:(BOOL)animated
121 | {
122 | [super viewWillDisappear:animated];
123 |
124 | // Unsqueeze manually
125 | self.navigationController.navigationBar.frame = CGRectMake(0.f,
126 | kStatusBarHeight,
127 | SCREEN_WIDTH,
128 | NAVBAR_HEIGHT);
129 | [self.navigationController.navigationBar removeGestureRecognizer:self.recognizer];
130 | self.navBarStatus = IPNavBarSqueezingStatusNormal;
131 |
132 | [self.transitionCoordinator animateAlongsideTransition:
133 | ^(id context) {
134 | if ([context presentationStyle] != UIModalPresentationNone) {
135 | return;
136 | }
137 | self.titleViewPlaceholder.alpha = 0.f;
138 | self.titleViewPlaceholder.frame = CGRectOffset(self.titleViewPlaceholder.frame, 200.f, 0.f);
139 | [self.navigationController setToolbarHidden:YES
140 | animated:YES];
141 | } completion:nil];
142 |
143 | [self.transitionCoordinator notifyWhenInteractionEndsUsingBlock:
144 | ^(id context) {
145 | if (![context isCancelled]) {
146 | return;
147 | }
148 | double delayInSeconds = 0.5;
149 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW,
150 | (int64_t)(delayInSeconds * NSEC_PER_SEC));
151 | dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
152 | if (self.navigationController.toolbarHidden) {
153 | self.navigationController.toolbarHidden = NO;
154 | }
155 | });
156 | }];
157 | }
158 |
159 | - (void)viewDidDisappear:(BOOL)animated
160 | {
161 | [super viewDidDisappear:animated];
162 | [self.titleViewPlaceholder removeFromSuperview];
163 | }
164 |
165 | - (void)setTriggeringScrollView:(UIScrollView *)triggeringScrollView
166 | {
167 | if (self.triggeringScrollView == triggeringScrollView) {
168 | return;
169 | }
170 | self->_triggeringScrollView = triggeringScrollView;
171 | self->_triggeringScrollView.delegate = self;
172 |
173 | // Recognize tap on content
174 | // TODO: move to property and remove gestures on dealloc
175 | UITapGestureRecognizer *tapContentRecognizer = [[UITapGestureRecognizer
176 | alloc] initWithTarget:self
177 | action:@selector(navBarTapped:)];
178 | tapContentRecognizer.numberOfTapsRequired = 1;
179 | [self.triggeringScrollView addGestureRecognizer:tapContentRecognizer];
180 | }
181 |
182 |
183 | #pragma mark - Setter methods
184 |
185 | - (void)setTitleFont:(UIFont *)titleFont
186 | {
187 | if ([self.titleFont.familyName isEqualToString:titleFont.familyName]) {
188 | return;
189 | }
190 | self->_titleFont = titleFont;
191 | self.titleViewPlaceholder.font = self.titleFont;
192 | }
193 |
194 | - (void)setTitleColor:(UIColor *)titleColor
195 | {
196 | if (CGColorEqualToColor(self.titleColor.CGColor, titleColor.CGColor)) {
197 | return;
198 | }
199 | self->_titleColor = titleColor;
200 | self.titleViewPlaceholder.textColor = self.titleColor;
201 | }
202 |
203 |
204 | #pragma mark - Scroll View Delegate
205 |
206 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
207 | {
208 | #ifdef DEBUG_SQUEEZE
209 | NSLog(@"Begin Dragging");
210 | #endif
211 | if (self.navBarStatus == IPNavBarSqueezingStatusNormal) {
212 | self.dragStart = YES;
213 | }
214 | self.previousYOffset = scrollView.contentOffset.y;
215 | }
216 |
217 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView
218 | {
219 | if (self.dragStart == NO) {
220 | return;
221 | }
222 | CGFloat delta = scrollView.contentOffset.y - self.previousYOffset;
223 |
224 | #ifdef DEBUG_SQUEEZE
225 | NSLog(@"scroll to offset: %f", scrollView.contentOffset.y);
226 | NSLog(@"offset delta: %f", delta);
227 | #endif
228 | switch (self.navBarStatus) {
229 | case IPNavBarSqueezingStatusNormal: {
230 | // Squeeze when scroll up higher than a threshold
231 | CGFloat threshold = 30.f;
232 |
233 | if (delta < threshold) {
234 | return;
235 | }
236 | if (delta > 200.f) {
237 | [self squeezeBars];
238 | } else {
239 | [self processBars];
240 | [self squeezeNavBarWithProgress:delta / 200.f];
241 | }
242 | }
243 | break;
244 | case IPNavBarSqueezingStatusProgress: {
245 | [self squeezeNavBarWithProgress:delta / 200.f];
246 | }
247 | break;
248 | default: break;
249 | }
250 | }
251 |
252 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView
253 | withVelocity:(CGPoint)velocity
254 | targetContentOffset:(inout CGPoint *)targetContentOffset
255 | {
256 | #ifdef DEBUG_SQUEEZE
257 | NSLog(@"End Dragging: (%f,%f) %f", velocity.x, velocity.y, targetContentOffset->y);
258 | #endif
259 | self.dragStart = NO;
260 | CGFloat offsetDelta = targetContentOffset->y - self.previousYOffset;
261 |
262 | // Finish squeezing when squeezing is not finished
263 | if (self.navBarStatus == IPNavBarSqueezingStatusProgress) {
264 | [self squeezeBars];
265 | }
266 | /**
267 | Un-squeeze only when
268 | o scroll up
269 | o fast enough
270 | o is squeezed
271 | Or
272 | o is squeezed
273 | o the target is top edge
274 | */
275 | if (self.navBarStatus == IPNavBarSqueezingStatusSqueezed) {
276 | if (offsetDelta < 0 ||
277 | fabs((targetContentOffset->y) + 40) < FLT_EPSILON) {
278 | [self expandBars];
279 | }
280 | }
281 |
282 | }
283 |
284 | - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
285 | {
286 | if (self.navBarStatus != IPNavBarSqueezingStatusSqueezed) {
287 | return YES;
288 | }
289 | [self expandBars];
290 | return NO;
291 | }
292 |
293 |
294 | #pragma mark - Bars squeezing
295 |
296 | - (void)processBars
297 | {
298 | // for inheritance
299 | }
300 |
301 | - (void)squeezeNavBarWithProgress:(CGFloat)delta
302 | {
303 | #ifdef DEBUG_SQUEEZE
304 | NSLog(@"Progress: %f", delta);
305 | #endif
306 | CGFloat progress = MIN(delta, 1.f);
307 |
308 | self.navBarStatus = IPNavBarSqueezingStatusProgress;
309 |
310 | [self hideBarItemsAnimated:YES];
311 |
312 | self.navigationController.navigationBar.frame = CGRectMake(0.f,
313 | kStatusBarHeight,
314 | SCREEN_WIDTH,
315 | NAVBAR_HEIGHT
316 | - (NAVBAR_HEIGHT - kSqueezedNavigationBarHeight)
317 | * progress);
318 | if (progress < delta) {
319 | [self squeezeBars];
320 | }
321 | }
322 |
323 | - (void)hideBarItemsAnimated:(BOOL)animated
324 | {
325 | if (self.navigationItem.leftBarButtonItems.count != 0) {
326 | self.leftBarButtonItems = [self.navigationItem.leftBarButtonItems copy];
327 | [self.navigationItem setLeftBarButtonItems:nil
328 | animated:animated];
329 | }
330 | if (self.navigationItem.rightBarButtonItems.count != 0) {
331 | self.rightBarButtonItems = [self.navigationItem.rightBarButtonItems copy];
332 | [self.navigationItem setRightBarButtonItems:nil
333 | animated:animated];
334 | }
335 | if (!self.navigationItem.hidesBackButton) {
336 | [self.navigationItem setHidesBackButton:YES
337 | animated:animated];
338 | }
339 | if (!self.navigationController.toolbarHidden) {
340 | [self.navigationController setToolbarHidden:YES
341 | animated:animated];
342 | }
343 | }
344 |
345 | - (void)showBarItemsAnimated:(BOOL)animated
346 | {
347 | [self.navigationItem setLeftBarButtonItems:self.leftBarButtonItems
348 | animated:animated];
349 | [self.navigationItem setRightBarButtonItems:self.rightBarButtonItems
350 | animated:animated];
351 | [self.navigationItem setHidesBackButton:NO
352 | animated:animated];
353 | [self.navigationController setToolbarHidden:NO
354 | animated:animated];
355 | }
356 |
357 | - (void)squeezeBars
358 | {
359 | #ifdef DEBUG_SQUEEZE
360 | NSLog(@"Start squeezing");
361 | #endif
362 | self.navBarStatus = IPNavBarSqueezingStatusSqueezing;
363 | self.titleViewPlaceholder.text = self.title;
364 |
365 | UIView* titleViewContainer = [[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f,
366 | SCREEN_WIDTH,
367 | kStatusBarHeight)];
368 | self.titleViewPlaceholder.translatesAutoresizingMaskIntoConstraints = NO;
369 | [titleViewContainer addSubview:self.titleViewPlaceholder];
370 |
371 | NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:self.titleViewPlaceholder
372 | attribute:NSLayoutAttributeCenterX
373 | relatedBy:NSLayoutRelationEqual
374 | toItem:titleViewContainer
375 | attribute:NSLayoutAttributeCenterX
376 | multiplier:1.0
377 | constant:0.0];
378 | NSLayoutConstraint* topMarginConstraint = [NSLayoutConstraint constraintWithItem:self.titleViewPlaceholder
379 | attribute:NSLayoutAttributeTop
380 | relatedBy:NSLayoutRelationEqual
381 | toItem:titleViewContainer
382 | attribute:NSLayoutAttributeTop
383 | multiplier:1
384 | constant:4];
385 | NSLayoutConstraint* heightConstraint = [NSLayoutConstraint constraintWithItem:self.titleViewPlaceholder attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:kStatusBarHeight];
386 |
387 | self.navigationItem.titleView = titleViewContainer;
388 | [titleViewContainer addConstraint:centerXConstraint];
389 | [titleViewContainer addConstraint:topMarginConstraint];
390 | [self.titleViewPlaceholder addConstraint:heightConstraint];
391 |
392 | [self hideBarItemsAnimated:YES];
393 |
394 | [UIView animateWithDuration:kAnimationDuration
395 | delay:0.0
396 | options:UIViewAnimationOptionCurveEaseInOut
397 | animations:^{
398 | CGRect frame = CGRectMake(0.f,
399 | kStatusBarHeight,
400 | SCREEN_WIDTH,
401 | kSqueezedNavigationBarHeight);
402 | self.titleViewPlaceholder.transform =
403 | CGAffineTransformScale(self.titleViewPlaceholder.transform, 0.75f, 0.75f);
404 |
405 | self.navigationController.navigationBar.frame = frame;
406 | }
407 | completion:^(BOOL finished) {
408 | [self.navigationController.navigationBar addGestureRecognizer:self.recognizer];
409 | self.navigationController.navigationBar.userInteractionEnabled = YES;
410 | self.titleViewPlaceholder.userInteractionEnabled = YES;
411 | self.triggeringScrollView.contentInset = UIEdgeInsetsMake(kStatusBarHeight
412 | + kSqueezedNavigationBarHeight,
413 | 0.f, 0.f, 0.f);
414 | self.triggeringScrollView.scrollIndicatorInsets =
415 | UIEdgeInsetsMake(kStatusBarHeight
416 | + kSqueezedNavigationBarHeight,
417 | 0.f, 0.f, 0.f);
418 | self.titleViewPlaceholder.text = [self squeezedTitle:
419 | self.titleViewPlaceholder.text];
420 | if (self.squeezeCompletion) {
421 | self.squeezeCompletion();
422 | }
423 | #ifdef DEBUG_SQUEEZE
424 | NSLog(@"End squeezing");
425 | #endif
426 | self.navBarStatus = IPNavBarSqueezingStatusSqueezed;
427 | }];
428 | }
429 |
430 | - (NSString *)squeezedTitle:(NSString *)title
431 | {
432 | return [NSString stringWithFormat:@"[ %@ ]", title];
433 | }
434 |
435 | - (void)expandBars
436 | {
437 | #ifdef DEBUG_SQUEEZE
438 | NSLog(@"Start expanding");
439 | #endif
440 | self.navBarStatus = IPNavBarSqueezingStatusUnSqueezing;
441 | [self.navigationController.navigationBar removeGestureRecognizer:self.recognizer];
442 | self.titleViewPlaceholder.text = self.title;
443 |
444 | [UIView animateWithDuration:kAnimationDuration
445 | delay:0.0
446 | options:UIViewAnimationOptionCurveEaseInOut
447 | animations:^{
448 | self.navigationController.navigationBar.frame = CGRectMake(0.f,
449 | kStatusBarHeight,
450 | SCREEN_WIDTH,
451 | NAVBAR_HEIGHT);
452 | // title
453 | self.titleViewPlaceholder.transform = CGAffineTransformIdentity;
454 |
455 | self.triggeringScrollView.contentInset =
456 | UIEdgeInsetsMake(NAVBAR_HEIGHT
457 | + kStatusBarHeight,
458 | 0.f,
459 | TOOLBAR_HEIGHT,
460 | 0.f);
461 | self.triggeringScrollView.scrollIndicatorInsets =
462 | UIEdgeInsetsMake(NAVBAR_HEIGHT
463 | + kStatusBarHeight,
464 | 0.f, 0.f, 0.f);
465 | self.navigationController.toolbarHidden = NO;
466 | }
467 | completion:^(BOOL finished) {
468 | self.navigationItem.titleView = self.titleViewOriginal;
469 |
470 | [self showBarItemsAnimated:YES];
471 |
472 | if (self.expandCompletion) {
473 | self.expandCompletion();
474 | }
475 | #ifdef DEBUG_SQUEEZE
476 | NSLog(@"End expanding");
477 | #endif
478 | self.navBarStatus = IPNavBarSqueezingStatusNormal;
479 | }];
480 | }
481 |
482 | - (void)navBarTapped:(id)sender
483 | {
484 | if (self.navBarStatus == IPNavBarSqueezingStatusSqueezed) {
485 | [self expandBars];
486 | }
487 | }
488 |
489 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
490 | duration:(NSTimeInterval)duration
491 | {
492 | [self expandBars];
493 | }
494 |
495 | @end
496 |
--------------------------------------------------------------------------------
/Demo/IPSqueezableViewController.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 18468AAC1924928C00F90480 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18468AAB1924928C00F90480 /* Foundation.framework */; };
11 | 18468AAE1924928C00F90480 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18468AAD1924928C00F90480 /* CoreGraphics.framework */; };
12 | 18468AB01924928C00F90480 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18468AAF1924928C00F90480 /* UIKit.framework */; };
13 | 18468AB61924928C00F90480 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 18468AB41924928C00F90480 /* InfoPlist.strings */; };
14 | 18468AB81924928C00F90480 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 18468AB71924928C00F90480 /* main.m */; };
15 | 18468ABC1924928C00F90480 /* IPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 18468ABB1924928C00F90480 /* IPAppDelegate.m */; };
16 | 18468ABF1924928C00F90480 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18468ABD1924928C00F90480 /* Main.storyboard */; };
17 | 18468AC21924928D00F90480 /* IPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18468AC11924928D00F90480 /* IPViewController.m */; };
18 | 18468AC41924928D00F90480 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18468AC31924928D00F90480 /* Images.xcassets */; };
19 | 18468ACB1924928D00F90480 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18468ACA1924928D00F90480 /* XCTest.framework */; };
20 | 18468ACC1924928D00F90480 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18468AAB1924928C00F90480 /* Foundation.framework */; };
21 | 18468ACD1924928D00F90480 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18468AAF1924928C00F90480 /* UIKit.framework */; };
22 | 18468AD51924928D00F90480 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 18468AD31924928D00F90480 /* InfoPlist.strings */; };
23 | 18468AD71924928D00F90480 /* IPSqueezableViewControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 18468AD61924928D00F90480 /* IPSqueezableViewControllerTests.m */; };
24 | 18996C761927410C00F547D5 /* IPNavBarSqueezableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18996C741927410C00F547D5 /* IPNavBarSqueezableViewController.m */; };
25 | 18996C7C1927415200F547D5 /* backButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 18996C781927415200F547D5 /* backButton.png */; };
26 | 18996C7D1927415200F547D5 /* backButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 18996C791927415200F547D5 /* backButton@2x.png */; };
27 | 18996C7E1927415200F547D5 /* invisibleBackButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 18996C7A1927415200F547D5 /* invisibleBackButton.png */; };
28 | 18996C7F1927415200F547D5 /* invisibleBackButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 18996C7B1927415200F547D5 /* invisibleBackButton@2x.png */; };
29 | /* End PBXBuildFile section */
30 |
31 | /* Begin PBXContainerItemProxy section */
32 | 18468ACE1924928D00F90480 /* PBXContainerItemProxy */ = {
33 | isa = PBXContainerItemProxy;
34 | containerPortal = 18468AA01924928C00F90480 /* Project object */;
35 | proxyType = 1;
36 | remoteGlobalIDString = 18468AA71924928C00F90480;
37 | remoteInfo = IPSqueezableViewController;
38 | };
39 | /* End PBXContainerItemProxy section */
40 |
41 | /* Begin PBXFileReference section */
42 | 18468AA81924928C00F90480 /* IPSqueezableViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IPSqueezableViewController.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 18468AAB1924928C00F90480 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
44 | 18468AAD1924928C00F90480 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
45 | 18468AAF1924928C00F90480 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
46 | 18468AB31924928C00F90480 /* IPSqueezableViewController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IPSqueezableViewController-Info.plist"; sourceTree = ""; };
47 | 18468AB51924928C00F90480 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
48 | 18468AB71924928C00F90480 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
49 | 18468AB91924928C00F90480 /* IPSqueezableViewController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IPSqueezableViewController-Prefix.pch"; sourceTree = ""; };
50 | 18468ABA1924928C00F90480 /* IPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.objj.h; path = IPAppDelegate.h; sourceTree = ""; };
51 | 18468ABB1924928C00F90480 /* IPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IPAppDelegate.m; sourceTree = ""; };
52 | 18468ABE1924928C00F90480 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
53 | 18468AC01924928D00F90480 /* IPViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.objj.h; path = IPViewController.h; sourceTree = ""; };
54 | 18468AC11924928D00F90480 /* IPViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IPViewController.m; sourceTree = ""; };
55 | 18468AC31924928D00F90480 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
56 | 18468AC91924928D00F90480 /* IPSqueezableViewControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IPSqueezableViewControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
57 | 18468ACA1924928D00F90480 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
58 | 18468AD21924928D00F90480 /* IPSqueezableViewControllerTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "IPSqueezableViewControllerTests-Info.plist"; sourceTree = ""; };
59 | 18468AD41924928D00F90480 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
60 | 18468AD61924928D00F90480 /* IPSqueezableViewControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IPSqueezableViewControllerTests.m; sourceTree = ""; };
61 | 18996C731927410C00F547D5 /* IPNavBarSqueezableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.objj.h; path = IPNavBarSqueezableViewController.h; sourceTree = ""; };
62 | 18996C741927410C00F547D5 /* IPNavBarSqueezableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IPNavBarSqueezableViewController.m; sourceTree = ""; };
63 | 18996C781927415200F547D5 /* backButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = backButton.png; sourceTree = ""; };
64 | 18996C791927415200F547D5 /* backButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "backButton@2x.png"; sourceTree = ""; };
65 | 18996C7A1927415200F547D5 /* invisibleBackButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = invisibleBackButton.png; sourceTree = ""; };
66 | 18996C7B1927415200F547D5 /* invisibleBackButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "invisibleBackButton@2x.png"; sourceTree = ""; };
67 | /* End PBXFileReference section */
68 |
69 | /* Begin PBXFrameworksBuildPhase section */
70 | 18468AA51924928C00F90480 /* Frameworks */ = {
71 | isa = PBXFrameworksBuildPhase;
72 | buildActionMask = 2147483647;
73 | files = (
74 | 18468AAE1924928C00F90480 /* CoreGraphics.framework in Frameworks */,
75 | 18468AB01924928C00F90480 /* UIKit.framework in Frameworks */,
76 | 18468AAC1924928C00F90480 /* Foundation.framework in Frameworks */,
77 | );
78 | runOnlyForDeploymentPostprocessing = 0;
79 | };
80 | 18468AC61924928D00F90480 /* Frameworks */ = {
81 | isa = PBXFrameworksBuildPhase;
82 | buildActionMask = 2147483647;
83 | files = (
84 | 18468ACB1924928D00F90480 /* XCTest.framework in Frameworks */,
85 | 18468ACD1924928D00F90480 /* UIKit.framework in Frameworks */,
86 | 18468ACC1924928D00F90480 /* Foundation.framework in Frameworks */,
87 | );
88 | runOnlyForDeploymentPostprocessing = 0;
89 | };
90 | /* End PBXFrameworksBuildPhase section */
91 |
92 | /* Begin PBXGroup section */
93 | 18468A9F1924928C00F90480 = {
94 | isa = PBXGroup;
95 | children = (
96 | 18468AB11924928C00F90480 /* IPSqueezableViewController */,
97 | 18468AD01924928D00F90480 /* IPSqueezableViewControllerTests */,
98 | 18468AAA1924928C00F90480 /* Frameworks */,
99 | 18468AA91924928C00F90480 /* Products */,
100 | );
101 | sourceTree = "";
102 | };
103 | 18468AA91924928C00F90480 /* Products */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 18468AA81924928C00F90480 /* IPSqueezableViewController.app */,
107 | 18468AC91924928D00F90480 /* IPSqueezableViewControllerTests.xctest */,
108 | );
109 | name = Products;
110 | sourceTree = "";
111 | };
112 | 18468AAA1924928C00F90480 /* Frameworks */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 18468AAB1924928C00F90480 /* Foundation.framework */,
116 | 18468AAD1924928C00F90480 /* CoreGraphics.framework */,
117 | 18468AAF1924928C00F90480 /* UIKit.framework */,
118 | 18468ACA1924928D00F90480 /* XCTest.framework */,
119 | );
120 | name = Frameworks;
121 | sourceTree = "";
122 | };
123 | 18468AB11924928C00F90480 /* IPSqueezableViewController */ = {
124 | isa = PBXGroup;
125 | children = (
126 | 18996C721927410C00F547D5 /* Classes */,
127 | 18468ABA1924928C00F90480 /* IPAppDelegate.h */,
128 | 18468ABB1924928C00F90480 /* IPAppDelegate.m */,
129 | 18468ABD1924928C00F90480 /* Main.storyboard */,
130 | 18468AC01924928D00F90480 /* IPViewController.h */,
131 | 18468AC11924928D00F90480 /* IPViewController.m */,
132 | 18468AC31924928D00F90480 /* Images.xcassets */,
133 | 18996C771927415200F547D5 /* Resources */,
134 | 18468AB21924928C00F90480 /* Supporting Files */,
135 | );
136 | path = IPSqueezableViewController;
137 | sourceTree = "";
138 | };
139 | 18468AB21924928C00F90480 /* Supporting Files */ = {
140 | isa = PBXGroup;
141 | children = (
142 | 18468AB31924928C00F90480 /* IPSqueezableViewController-Info.plist */,
143 | 18468AB41924928C00F90480 /* InfoPlist.strings */,
144 | 18468AB71924928C00F90480 /* main.m */,
145 | 18468AB91924928C00F90480 /* IPSqueezableViewController-Prefix.pch */,
146 | );
147 | name = "Supporting Files";
148 | sourceTree = "";
149 | };
150 | 18468AD01924928D00F90480 /* IPSqueezableViewControllerTests */ = {
151 | isa = PBXGroup;
152 | children = (
153 | 18468AD61924928D00F90480 /* IPSqueezableViewControllerTests.m */,
154 | 18468AD11924928D00F90480 /* Supporting Files */,
155 | );
156 | path = IPSqueezableViewControllerTests;
157 | sourceTree = "";
158 | };
159 | 18468AD11924928D00F90480 /* Supporting Files */ = {
160 | isa = PBXGroup;
161 | children = (
162 | 18468AD21924928D00F90480 /* IPSqueezableViewControllerTests-Info.plist */,
163 | 18468AD31924928D00F90480 /* InfoPlist.strings */,
164 | );
165 | name = "Supporting Files";
166 | sourceTree = "";
167 | };
168 | 18996C721927410C00F547D5 /* Classes */ = {
169 | isa = PBXGroup;
170 | children = (
171 | 18996C731927410C00F547D5 /* IPNavBarSqueezableViewController.h */,
172 | 18996C741927410C00F547D5 /* IPNavBarSqueezableViewController.m */,
173 | );
174 | name = Classes;
175 | path = ../../Classes;
176 | sourceTree = "";
177 | };
178 | 18996C771927415200F547D5 /* Resources */ = {
179 | isa = PBXGroup;
180 | children = (
181 | 18996C781927415200F547D5 /* backButton.png */,
182 | 18996C791927415200F547D5 /* backButton@2x.png */,
183 | 18996C7A1927415200F547D5 /* invisibleBackButton.png */,
184 | 18996C7B1927415200F547D5 /* invisibleBackButton@2x.png */,
185 | );
186 | name = Resources;
187 | path = ../../Resources;
188 | sourceTree = "";
189 | };
190 | /* End PBXGroup section */
191 |
192 | /* Begin PBXNativeTarget section */
193 | 18468AA71924928C00F90480 /* IPSqueezableViewController */ = {
194 | isa = PBXNativeTarget;
195 | buildConfigurationList = 18468ADA1924928D00F90480 /* Build configuration list for PBXNativeTarget "IPSqueezableViewController" */;
196 | buildPhases = (
197 | 18468AA41924928C00F90480 /* Sources */,
198 | 18468AA51924928C00F90480 /* Frameworks */,
199 | 18468AA61924928C00F90480 /* Resources */,
200 | );
201 | buildRules = (
202 | );
203 | dependencies = (
204 | );
205 | name = IPSqueezableViewController;
206 | productName = IPSqueezableViewController;
207 | productReference = 18468AA81924928C00F90480 /* IPSqueezableViewController.app */;
208 | productType = "com.apple.product-type.application";
209 | };
210 | 18468AC81924928D00F90480 /* IPSqueezableViewControllerTests */ = {
211 | isa = PBXNativeTarget;
212 | buildConfigurationList = 18468ADD1924928D00F90480 /* Build configuration list for PBXNativeTarget "IPSqueezableViewControllerTests" */;
213 | buildPhases = (
214 | 18468AC51924928D00F90480 /* Sources */,
215 | 18468AC61924928D00F90480 /* Frameworks */,
216 | 18468AC71924928D00F90480 /* Resources */,
217 | );
218 | buildRules = (
219 | );
220 | dependencies = (
221 | 18468ACF1924928D00F90480 /* PBXTargetDependency */,
222 | );
223 | name = IPSqueezableViewControllerTests;
224 | productName = IPSqueezableViewControllerTests;
225 | productReference = 18468AC91924928D00F90480 /* IPSqueezableViewControllerTests.xctest */;
226 | productType = "com.apple.product-type.bundle.unit-test";
227 | };
228 | /* End PBXNativeTarget section */
229 |
230 | /* Begin PBXProject section */
231 | 18468AA01924928C00F90480 /* Project object */ = {
232 | isa = PBXProject;
233 | attributes = {
234 | CLASSPREFIX = IP;
235 | LastUpgradeCheck = 0510;
236 | ORGANIZATIONNAME = shotdoor;
237 | TargetAttributes = {
238 | 18468AC81924928D00F90480 = {
239 | TestTargetID = 18468AA71924928C00F90480;
240 | };
241 | };
242 | };
243 | buildConfigurationList = 18468AA31924928C00F90480 /* Build configuration list for PBXProject "IPSqueezableViewController" */;
244 | compatibilityVersion = "Xcode 3.2";
245 | developmentRegion = English;
246 | hasScannedForEncodings = 0;
247 | knownRegions = (
248 | en,
249 | Base,
250 | );
251 | mainGroup = 18468A9F1924928C00F90480;
252 | productRefGroup = 18468AA91924928C00F90480 /* Products */;
253 | projectDirPath = "";
254 | projectRoot = "";
255 | targets = (
256 | 18468AA71924928C00F90480 /* IPSqueezableViewController */,
257 | 18468AC81924928D00F90480 /* IPSqueezableViewControllerTests */,
258 | );
259 | };
260 | /* End PBXProject section */
261 |
262 | /* Begin PBXResourcesBuildPhase section */
263 | 18468AA61924928C00F90480 /* Resources */ = {
264 | isa = PBXResourcesBuildPhase;
265 | buildActionMask = 2147483647;
266 | files = (
267 | 18468AC41924928D00F90480 /* Images.xcassets in Resources */,
268 | 18468AB61924928C00F90480 /* InfoPlist.strings in Resources */,
269 | 18996C7D1927415200F547D5 /* backButton@2x.png in Resources */,
270 | 18996C7F1927415200F547D5 /* invisibleBackButton@2x.png in Resources */,
271 | 18996C7C1927415200F547D5 /* backButton.png in Resources */,
272 | 18996C7E1927415200F547D5 /* invisibleBackButton.png in Resources */,
273 | 18468ABF1924928C00F90480 /* Main.storyboard in Resources */,
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | };
277 | 18468AC71924928D00F90480 /* Resources */ = {
278 | isa = PBXResourcesBuildPhase;
279 | buildActionMask = 2147483647;
280 | files = (
281 | 18468AD51924928D00F90480 /* InfoPlist.strings in Resources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | /* End PBXResourcesBuildPhase section */
286 |
287 | /* Begin PBXSourcesBuildPhase section */
288 | 18468AA41924928C00F90480 /* Sources */ = {
289 | isa = PBXSourcesBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | 18468AB81924928C00F90480 /* main.m in Sources */,
293 | 18996C761927410C00F547D5 /* IPNavBarSqueezableViewController.m in Sources */,
294 | 18468ABC1924928C00F90480 /* IPAppDelegate.m in Sources */,
295 | 18468AC21924928D00F90480 /* IPViewController.m in Sources */,
296 | );
297 | runOnlyForDeploymentPostprocessing = 0;
298 | };
299 | 18468AC51924928D00F90480 /* Sources */ = {
300 | isa = PBXSourcesBuildPhase;
301 | buildActionMask = 2147483647;
302 | files = (
303 | 18468AD71924928D00F90480 /* IPSqueezableViewControllerTests.m in Sources */,
304 | );
305 | runOnlyForDeploymentPostprocessing = 0;
306 | };
307 | /* End PBXSourcesBuildPhase section */
308 |
309 | /* Begin PBXTargetDependency section */
310 | 18468ACF1924928D00F90480 /* PBXTargetDependency */ = {
311 | isa = PBXTargetDependency;
312 | target = 18468AA71924928C00F90480 /* IPSqueezableViewController */;
313 | targetProxy = 18468ACE1924928D00F90480 /* PBXContainerItemProxy */;
314 | };
315 | /* End PBXTargetDependency section */
316 |
317 | /* Begin PBXVariantGroup section */
318 | 18468AB41924928C00F90480 /* InfoPlist.strings */ = {
319 | isa = PBXVariantGroup;
320 | children = (
321 | 18468AB51924928C00F90480 /* en */,
322 | );
323 | name = InfoPlist.strings;
324 | sourceTree = "";
325 | };
326 | 18468ABD1924928C00F90480 /* Main.storyboard */ = {
327 | isa = PBXVariantGroup;
328 | children = (
329 | 18468ABE1924928C00F90480 /* Base */,
330 | );
331 | name = Main.storyboard;
332 | sourceTree = "";
333 | };
334 | 18468AD31924928D00F90480 /* InfoPlist.strings */ = {
335 | isa = PBXVariantGroup;
336 | children = (
337 | 18468AD41924928D00F90480 /* en */,
338 | );
339 | name = InfoPlist.strings;
340 | sourceTree = "";
341 | };
342 | /* End PBXVariantGroup section */
343 |
344 | /* Begin XCBuildConfiguration section */
345 | 18468AD81924928D00F90480 /* Debug */ = {
346 | isa = XCBuildConfiguration;
347 | buildSettings = {
348 | ALWAYS_SEARCH_USER_PATHS = NO;
349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
350 | CLANG_CXX_LIBRARY = "libc++";
351 | CLANG_ENABLE_MODULES = YES;
352 | CLANG_ENABLE_OBJC_ARC = YES;
353 | CLANG_WARN_BOOL_CONVERSION = YES;
354 | CLANG_WARN_CONSTANT_CONVERSION = YES;
355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
356 | CLANG_WARN_EMPTY_BODY = YES;
357 | CLANG_WARN_ENUM_CONVERSION = YES;
358 | CLANG_WARN_INT_CONVERSION = YES;
359 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
362 | COPY_PHASE_STRIP = NO;
363 | GCC_C_LANGUAGE_STANDARD = gnu99;
364 | GCC_DYNAMIC_NO_PIC = NO;
365 | GCC_OPTIMIZATION_LEVEL = 0;
366 | GCC_PREPROCESSOR_DEFINITIONS = (
367 | "DEBUG=1",
368 | "$(inherited)",
369 | );
370 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
371 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
372 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
373 | GCC_WARN_UNDECLARED_SELECTOR = YES;
374 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
375 | GCC_WARN_UNUSED_FUNCTION = YES;
376 | GCC_WARN_UNUSED_VARIABLE = YES;
377 | IPHONEOS_DEPLOYMENT_TARGET = 7.1;
378 | ONLY_ACTIVE_ARCH = YES;
379 | SDKROOT = iphoneos;
380 | };
381 | name = Debug;
382 | };
383 | 18468AD91924928D00F90480 /* Release */ = {
384 | isa = XCBuildConfiguration;
385 | buildSettings = {
386 | ALWAYS_SEARCH_USER_PATHS = NO;
387 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
388 | CLANG_CXX_LIBRARY = "libc++";
389 | CLANG_ENABLE_MODULES = YES;
390 | CLANG_ENABLE_OBJC_ARC = YES;
391 | CLANG_WARN_BOOL_CONVERSION = YES;
392 | CLANG_WARN_CONSTANT_CONVERSION = YES;
393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
394 | CLANG_WARN_EMPTY_BODY = YES;
395 | CLANG_WARN_ENUM_CONVERSION = YES;
396 | CLANG_WARN_INT_CONVERSION = YES;
397 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
398 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
399 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
400 | COPY_PHASE_STRIP = YES;
401 | ENABLE_NS_ASSERTIONS = NO;
402 | GCC_C_LANGUAGE_STANDARD = gnu99;
403 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
404 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
405 | GCC_WARN_UNDECLARED_SELECTOR = YES;
406 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
407 | GCC_WARN_UNUSED_FUNCTION = YES;
408 | GCC_WARN_UNUSED_VARIABLE = YES;
409 | IPHONEOS_DEPLOYMENT_TARGET = 7.1;
410 | SDKROOT = iphoneos;
411 | VALIDATE_PRODUCT = YES;
412 | };
413 | name = Release;
414 | };
415 | 18468ADB1924928D00F90480 /* Debug */ = {
416 | isa = XCBuildConfiguration;
417 | buildSettings = {
418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
419 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
420 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
421 | GCC_PREFIX_HEADER = "IPSqueezableViewController/IPSqueezableViewController-Prefix.pch";
422 | INFOPLIST_FILE = "IPSqueezableViewController/IPSqueezableViewController-Info.plist";
423 | PRODUCT_NAME = "$(TARGET_NAME)";
424 | WRAPPER_EXTENSION = app;
425 | };
426 | name = Debug;
427 | };
428 | 18468ADC1924928D00F90480 /* Release */ = {
429 | isa = XCBuildConfiguration;
430 | buildSettings = {
431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
432 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
433 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
434 | GCC_PREFIX_HEADER = "IPSqueezableViewController/IPSqueezableViewController-Prefix.pch";
435 | INFOPLIST_FILE = "IPSqueezableViewController/IPSqueezableViewController-Info.plist";
436 | PRODUCT_NAME = "$(TARGET_NAME)";
437 | WRAPPER_EXTENSION = app;
438 | };
439 | name = Release;
440 | };
441 | 18468ADE1924928D00F90480 /* Debug */ = {
442 | isa = XCBuildConfiguration;
443 | buildSettings = {
444 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IPSqueezableViewController.app/IPSqueezableViewController";
445 | FRAMEWORK_SEARCH_PATHS = (
446 | "$(SDKROOT)/Developer/Library/Frameworks",
447 | "$(inherited)",
448 | "$(DEVELOPER_FRAMEWORKS_DIR)",
449 | );
450 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
451 | GCC_PREFIX_HEADER = "IPSqueezableViewController/IPSqueezableViewController-Prefix.pch";
452 | GCC_PREPROCESSOR_DEFINITIONS = (
453 | "DEBUG=1",
454 | "$(inherited)",
455 | );
456 | INFOPLIST_FILE = "IPSqueezableViewControllerTests/IPSqueezableViewControllerTests-Info.plist";
457 | PRODUCT_NAME = "$(TARGET_NAME)";
458 | TEST_HOST = "$(BUNDLE_LOADER)";
459 | WRAPPER_EXTENSION = xctest;
460 | };
461 | name = Debug;
462 | };
463 | 18468ADF1924928D00F90480 /* Release */ = {
464 | isa = XCBuildConfiguration;
465 | buildSettings = {
466 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/IPSqueezableViewController.app/IPSqueezableViewController";
467 | FRAMEWORK_SEARCH_PATHS = (
468 | "$(SDKROOT)/Developer/Library/Frameworks",
469 | "$(inherited)",
470 | "$(DEVELOPER_FRAMEWORKS_DIR)",
471 | );
472 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
473 | GCC_PREFIX_HEADER = "IPSqueezableViewController/IPSqueezableViewController-Prefix.pch";
474 | INFOPLIST_FILE = "IPSqueezableViewControllerTests/IPSqueezableViewControllerTests-Info.plist";
475 | PRODUCT_NAME = "$(TARGET_NAME)";
476 | TEST_HOST = "$(BUNDLE_LOADER)";
477 | WRAPPER_EXTENSION = xctest;
478 | };
479 | name = Release;
480 | };
481 | /* End XCBuildConfiguration section */
482 |
483 | /* Begin XCConfigurationList section */
484 | 18468AA31924928C00F90480 /* Build configuration list for PBXProject "IPSqueezableViewController" */ = {
485 | isa = XCConfigurationList;
486 | buildConfigurations = (
487 | 18468AD81924928D00F90480 /* Debug */,
488 | 18468AD91924928D00F90480 /* Release */,
489 | );
490 | defaultConfigurationIsVisible = 0;
491 | defaultConfigurationName = Release;
492 | };
493 | 18468ADA1924928D00F90480 /* Build configuration list for PBXNativeTarget "IPSqueezableViewController" */ = {
494 | isa = XCConfigurationList;
495 | buildConfigurations = (
496 | 18468ADB1924928D00F90480 /* Debug */,
497 | 18468ADC1924928D00F90480 /* Release */,
498 | );
499 | defaultConfigurationIsVisible = 0;
500 | defaultConfigurationName = Release;
501 | };
502 | 18468ADD1924928D00F90480 /* Build configuration list for PBXNativeTarget "IPSqueezableViewControllerTests" */ = {
503 | isa = XCConfigurationList;
504 | buildConfigurations = (
505 | 18468ADE1924928D00F90480 /* Debug */,
506 | 18468ADF1924928D00F90480 /* Release */,
507 | );
508 | defaultConfigurationIsVisible = 0;
509 | defaultConfigurationName = Release;
510 | };
511 | /* End XCConfigurationList section */
512 | };
513 | rootObject = 18468AA01924928C00F90480 /* Project object */;
514 | }
515 |
--------------------------------------------------------------------------------