├── Example
├── LRScrollingSidebarControllerExample
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── LaunchImage.launchimage
│ │ │ └── Contents.json
│ ├── LRScrollingSidebarControllerExample-Prefix.pch
│ ├── LRRandomColor.h
│ ├── LRScrollingSidebarControllerExample-Info.plist
│ ├── LeftViewController.h
│ ├── MainViewController.h
│ ├── RightViewController.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── LeftViewController.m
│ ├── LRRandomColor.m
│ ├── RightViewController.m
│ ├── MainViewController.m
│ ├── LeftViewController.xib
│ ├── RightViewController.xib
│ ├── MainViewController.xib
│ └── AppDelegate.m
├── LRScrollingSidebarControllerExampleTests
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ ├── LRScrollingSidebarControllerExampleTests-Info.plist
│ └── LRScrollingSidebarControllerExampleTests.m
└── LRScrollingSidebarControllerExample.xcodeproj
│ ├── project.xcworkspace
│ └── contents.xcworkspacedata
│ ├── xcshareddata
│ └── xcschemes
│ │ └── LRScrollingSidebarControllerExample.xcscheme
│ └── project.pbxproj
├── .travis.yml
├── .gitignore
├── LRScrollingSidebarController.podspec
├── LICENSE
├── LRScrollingSidebarController
├── UIViewController+LRScrollingSidebarController.h
├── LRSidebarScrollView+Private.h
├── LRSidebarScrollView.h
├── UIViewController+LRScrollingSidebarController.m
├── LRScrollingSidebarControllerStrategy.h
├── LRScrollingSidebarControllerStrategy.m
├── LRScrollingSidebarController.h
├── LRSidebarScrollView.m
└── LRScrollingSidebarController.m
└── README.md
/Example/LRScrollingSidebarControllerExample/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExampleTests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | before_install: cd Example
3 | script: xcodebuild -project LRScrollingSidebarControllerExample.xcodeproj -scheme LRScrollingSidebarControllerExample -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO
4 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
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 | profile
14 | *.moved-aside
15 | DerivedData
16 | .idea/
17 | *.hmap
18 | *.xccheckout
19 |
20 | #CocoaPods
21 | Pods
22 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/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 | }
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-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_3_0
10 | #warning "This project uses features only available in iOS SDK 3.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #import "LRRandomColor.h"
17 | #endif
18 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'LRScrollingSidebarController'
3 | s.version = '0.1'
4 | s.license = 'MIT'
5 | s.summary = 'A scrolling based sidebar controller.'
6 | s.homepage = 'https://github.com/luisrecuenco/LRScrollingSidebarController.git'
7 | s.author = { "Luis Recuenco" => "luisrecuenco@gmail.com" }
8 | s.source = { :git => 'https://github.com/luisrecuenco/LRScrollingSidebarController.git', :tag => '0.1' }
9 | s.platform = :ios, '6.0'
10 | s.source_files = 'LRScrollingSidebarController'
11 | s.requires_arc = true
12 | end
13 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/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 | }
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExampleTests/LRScrollingSidebarControllerExampleTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | Luis-Recuenco.${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 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExampleTests/LRScrollingSidebarControllerExampleTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // LRScrollingSidebarControllerExampleTests.m
3 | // LRScrollingSidebarControllerExampleTests
4 | //
5 | // Created by Luis Recuenco on 20/01/14.
6 | // Copyright (c) 2014 Luis Recuenco. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LRScrollingSidebarControllerExampleTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation LRScrollingSidebarControllerExampleTests
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 |
30 | @end
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 luisrecuenco
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LRRandomColor.h:
--------------------------------------------------------------------------------
1 | // LRRandomColor.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | UIColor *LRGetRandomColor();
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | Luis-Recuenco.${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 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LeftViewController.h:
--------------------------------------------------------------------------------
1 | // LeftViewController.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRScrollingSidebarController.h"
24 |
25 | @interface LeftViewController : UIViewController
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/MainViewController.h:
--------------------------------------------------------------------------------
1 | // MainViewController.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRScrollingSidebarController.h"
24 |
25 | @interface MainViewController : UIViewController
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/RightViewController.h:
--------------------------------------------------------------------------------
1 | // RightViewController.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRScrollingSidebarController.h"
24 |
25 | @interface RightViewController : UIViewController
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | // AppDelegate.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | @interface AppDelegate : UIResponder
26 |
27 | @property (strong, nonatomic) UIWindow *window;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/main.m:
--------------------------------------------------------------------------------
1 | // main.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #import "AppDelegate.h"
26 |
27 | int main(int argc, char * argv[])
28 | {
29 | @autoreleasepool {
30 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/UIViewController+LRScrollingSidebarController.h:
--------------------------------------------------------------------------------
1 | // UIViewController+LRScrollingSidebarController.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRScrollingSidebarController.h"
24 |
25 | @interface UIViewController (LRScrollingSidebarController)
26 |
27 | @property (nonatomic, weak) LRScrollingSidebarController *scrollingSidebarController;
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRSidebarScrollView+Private.h:
--------------------------------------------------------------------------------
1 | // LRSidebarScrollView+Private.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRSidebarScrollView.h"
24 |
25 | @interface LRSidebarScrollView (Private)
26 |
27 | @property (nonatomic, weak) UIView *mainView;
28 | @property (nonatomic) CGFloat gap;
29 | @property (nonatomic) LRSidebarScrollViewState scrollViewState;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRSidebarScrollView.h:
--------------------------------------------------------------------------------
1 | // LRSidebarScrollView.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | typedef NS_ENUM(NSUInteger, LRSidebarScrollViewState)
26 | {
27 | LRSidebarScrollViewStateUnknown,
28 | LRSidebarScrollViewStateLeft,
29 | LRSidebarScrollViewStateCenter,
30 | LRSidebarScrollViewStateRight,
31 | };
32 |
33 | @interface LRSidebarScrollView : UIScrollView
34 |
35 | @property (nonatomic) NSTimeInterval animationTime;
36 | @property (nonatomic) CGFloat animationBounce;
37 | @property (nonatomic) BOOL allowBouncing;
38 |
39 | - (instancetype)initWithGap:(CGFloat)gap;
40 |
41 | - (void)setScrollViewState:(LRSidebarScrollViewState)scrollState animated:(BOOL)animated;
42 |
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/UIViewController+LRScrollingSidebarController.m:
--------------------------------------------------------------------------------
1 | // UIViewController+LRScrollingSidebarController.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "UIViewController+LRScrollingSidebarController.h"
24 | #import
25 |
26 | @implementation UIViewController (LRScrollingSidebarController)
27 |
28 | - (LRScrollingSidebarController *)scrollingSidebarController
29 | {
30 | return objc_getAssociatedObject(self, @selector(scrollingSidebarController));
31 |
32 | }
33 |
34 | - (void)setScrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
35 | {
36 | objc_setAssociatedObject(self, @selector(scrollingSidebarController), scrollingSidebarController, OBJC_ASSOCIATION_ASSIGN);
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRScrollingSidebarControllerStrategy.h:
--------------------------------------------------------------------------------
1 | // LRScrollingSidebarControllerStrategy.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import
24 |
25 | #pragma mark - LRScrollingSidebarControllerStrategy Protocol
26 |
27 | @protocol LRScrollingSidebarControllerStrategy
28 |
29 | - (BOOL)shouldAddLeftViewControllerToHierarchy;
30 | - (BOOL)shouldAddMainViewControllerToHierarchy;
31 | - (BOOL)shouldAddRightViewControllerToHierarchy;
32 |
33 | - (NSUInteger)numberOfPanels;
34 |
35 | @end
36 |
37 | #pragma mark - LRScrollingSidebarControllerStrategyTwoPanels Interface
38 |
39 | @interface LRScrollingSidebarControllerStrategyTwoPanels : NSObject
40 | @end
41 |
42 | #pragma mark - LRScrollingSidebarControllerStrategyThreePanels Interface
43 |
44 | @interface LRScrollingSidebarControllerStrategyThreePanels : NSObject
45 | @end
46 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LeftViewController.m:
--------------------------------------------------------------------------------
1 | // LeftViewController.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LeftViewController.h"
24 | #import "MainViewController.h"
25 | #import "UIViewController+LRScrollingSidebarController.h"
26 |
27 | @implementation LeftViewController
28 |
29 | - (IBAction)showMainPanelButtonTapped:(id)sender
30 | {
31 | [self.scrollingSidebarController showMainViewControllerAnimated:YES];
32 | }
33 |
34 | - (IBAction)replaceMainPanelButtonTapped:(id)sender
35 | {
36 | MainViewController *mainViewController = [[MainViewController alloc] init];
37 | mainViewController.view.backgroundColor = LRGetRandomColor();
38 | [self.scrollingSidebarController showMainViewController:mainViewController animated:YES];
39 | }
40 |
41 | #pragma mark - LRScrollingSidebarController
42 |
43 | - (void)controllerIsVisible:(BOOL)controllerIsVisible
44 | {
45 | NSLog(@"Left view controller is visible: %d", controllerIsVisible);
46 | }
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LRRandomColor.m:
--------------------------------------------------------------------------------
1 | // LRRandomColor.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRRandomColor.h"
24 |
25 | @interface LRRandomColor : NSObject
26 |
27 | + (UIColor *)randomColor;
28 |
29 | @end
30 |
31 | @implementation LRRandomColor
32 |
33 | + (UIColor *)randomColor
34 | {
35 | NSArray *mainPanelAvailableColors = [self mainPanelAvailableColors];
36 | NSUInteger randomIndex = arc4random_uniform([mainPanelAvailableColors count]);
37 | return mainPanelAvailableColors[randomIndex];
38 | }
39 |
40 | + (NSArray *)mainPanelAvailableColors
41 | {
42 | return @[
43 | [UIColor blueColor],
44 | [UIColor blackColor],
45 | [UIColor darkGrayColor],
46 | [UIColor magentaColor],
47 | [UIColor orangeColor],
48 | [UIColor purpleColor],
49 | [UIColor brownColor],
50 | ];
51 | }
52 |
53 | @end
54 |
55 | UIColor *LRGetRandomColor(void)
56 | {
57 | return [LRRandomColor randomColor];
58 | }
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRScrollingSidebarControllerStrategy.m:
--------------------------------------------------------------------------------
1 | // LRScrollingSidebarControllerStrategy.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRScrollingSidebarControllerStrategy.h"
24 |
25 | #pragma mark - LRScrollingSidebarControllerStrategyTwoPanels Implementation
26 |
27 | @implementation LRScrollingSidebarControllerStrategyTwoPanels
28 |
29 | - (BOOL)shouldAddLeftViewControllerToHierarchy
30 | {
31 | return YES;
32 | }
33 |
34 | - (BOOL)shouldAddMainViewControllerToHierarchy
35 | {
36 | return YES;
37 | }
38 |
39 | - (BOOL)shouldAddRightViewControllerToHierarchy
40 | {
41 | return NO;
42 | }
43 |
44 | - (NSUInteger)numberOfPanels
45 | {
46 | return 2;
47 | }
48 |
49 | @end
50 |
51 | #pragma mark - LRScrollingSidebarControllerStrategyThreePanels Implementation
52 |
53 | @implementation LRScrollingSidebarControllerStrategyThreePanels
54 |
55 | - (BOOL)shouldAddLeftViewControllerToHierarchy
56 | {
57 | return YES;
58 | }
59 |
60 | - (BOOL)shouldAddMainViewControllerToHierarchy
61 | {
62 | return YES;
63 | }
64 |
65 | - (BOOL)shouldAddRightViewControllerToHierarchy
66 | {
67 | return YES;
68 | }
69 |
70 | - (NSUInteger)numberOfPanels
71 | {
72 | return 3;
73 | }
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/RightViewController.m:
--------------------------------------------------------------------------------
1 | // RightViewController.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "RightViewController.h"
24 | #import "UIViewController+LRScrollingSidebarController.h"
25 | #import "MainViewController.h"
26 |
27 | @implementation RightViewController
28 |
29 | - (IBAction)showMainPanelButtonTapped:(id)sender
30 | {
31 | [self.scrollingSidebarController showMainViewControllerAnimated:YES];
32 | }
33 |
34 | - (IBAction)replaceMainPanelButtonTapped:(id)sender
35 | {
36 | MainViewController *mainViewController = [[MainViewController alloc] init];
37 | mainViewController.view.backgroundColor = LRGetRandomColor();
38 | [self.scrollingSidebarController showMainViewController:mainViewController animated:YES];
39 | }
40 |
41 | - (NSArray *)mainPanelAvailableColors
42 | {
43 | return @[
44 | [UIColor blueColor],
45 | [UIColor blackColor],
46 | [UIColor darkGrayColor],
47 | [UIColor magentaColor],
48 | [UIColor orangeColor],
49 | [UIColor purpleColor],
50 | [UIColor brownColor],
51 | ];
52 | }
53 |
54 | #pragma mark - LRScrollingSidebarController
55 |
56 | - (void)controllerIsVisible:(BOOL)controllerIsVisible
57 | {
58 | NSLog(@"Right view controller is visible: %d", controllerIsVisible);
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/MainViewController.m:
--------------------------------------------------------------------------------
1 | // MainViewController.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "MainViewController.h"
24 | #import "LeftViewController.h"
25 | #import "RightViewController.h"
26 | #import "UIViewController+LRScrollingSidebarController.h"
27 |
28 | @implementation MainViewController
29 |
30 | - (IBAction)showLeftPanelButtonTapped:(id)sender
31 | {
32 | [self.scrollingSidebarController showLeftViewControllerAnimated:YES];
33 | }
34 |
35 | - (IBAction)replaceLeftPanelButtonTapped:(id)sender
36 | {
37 | LeftViewController *leftViewController = [[LeftViewController alloc] init];
38 | leftViewController.view.backgroundColor = LRGetRandomColor();
39 | [self.scrollingSidebarController showLeftViewController:leftViewController
40 | animated:YES];
41 | }
42 |
43 | - (IBAction)showRightPanelButtonTapped:(id)sender
44 | {
45 | [self.scrollingSidebarController showRightViewControllerAnimated:YES];
46 | }
47 |
48 | - (IBAction)replaceRightPanelButtonTapped:(id)sender
49 | {
50 | RightViewController *rightViewController = [[RightViewController alloc] init];
51 | rightViewController.view.backgroundColor = LRGetRandomColor();
52 | [self.scrollingSidebarController showRightViewController:rightViewController
53 | animated:YES];
54 | }
55 |
56 | - (NSArray *)mainPanelAvailableColors
57 | {
58 | return @[
59 | [UIColor blueColor],
60 | [UIColor blackColor],
61 | [UIColor darkGrayColor],
62 | [UIColor magentaColor],
63 | [UIColor orangeColor],
64 | [UIColor purpleColor],
65 | [UIColor brownColor],
66 | ];
67 | }
68 |
69 | #pragma mark - LRScrollingSidebarController
70 |
71 | - (void)controllerIsVisible:(BOOL)controllerIsVisible
72 | {
73 | NSLog(@"Main view controller is visible: %d", controllerIsVisible);
74 | }
75 |
76 | @end
77 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/LeftViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/RightViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample.xcodeproj/xcshareddata/xcschemes/LRScrollingSidebarControllerExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRScrollingSidebarController.h:
--------------------------------------------------------------------------------
1 | // LRScrollingSidebarController.h
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRSidebarScrollView.h"
24 |
25 | extern NSString *const kScrollViewWillBeginDraggingNotification;
26 | extern NSString *const kScrollViewDidEndDraggingNotification;
27 | extern NSString *const kScrollViewDidEndDeceleratingNotification;
28 |
29 | @protocol LRScrollingSidebarController;
30 | @protocol LRScrollingSidebarControllerDelegate;
31 |
32 | typedef UIViewController *ISSidePanelController;
33 |
34 | #pragma mark - LRScrollingSidebarController Interface
35 |
36 | @interface LRScrollingSidebarController : UIViewController
37 |
38 | @property (nonatomic, strong, readonly) ISSidePanelController leftViewController;
39 | @property (nonatomic, strong, readonly) ISSidePanelController mainViewController;
40 | @property (nonatomic, strong, readonly) ISSidePanelController rightViewController;
41 |
42 | @property (nonatomic, readonly) CGFloat mainViewControllerGap;
43 |
44 | @property (nonatomic) LRSidebarScrollViewState initialState;
45 |
46 | @property (nonatomic) UIColor *mainViewControllerOverlayColor;
47 | @property (nonatomic) CGFloat mainViewControllerOverlayMaxAlpha;
48 |
49 | @property (nonatomic) NSTimeInterval animationTime;
50 | @property (nonatomic) CGFloat animationBounce;
51 |
52 | @property (nonatomic) BOOL allowBouncing;
53 | @property (nonatomic) BOOL allowParallax;
54 |
55 | @property (nonatomic, weak) id delegate;
56 |
57 | - (instancetype)initWithLeftViewController:(ISSidePanelController)leftViewController
58 | mainViewController:(ISSidePanelController)mainViewController
59 | rightViewController:(ISSidePanelController)rightViewController
60 | mainViewControllerGap:(CGFloat)mainViewControllerGap;
61 |
62 | - (void)showLeftViewControllerAnimated:(BOOL)animated;
63 | - (void)showMainViewControllerAnimated:(BOOL)animated;
64 | - (void)showRightViewControllerAnimated:(BOOL)animated;
65 |
66 | - (void)replaceLeftViewController:(ISSidePanelController)leftViewController;
67 | - (void)replaceMainViewController:(ISSidePanelController)mainViewController;
68 | - (void)replaceRightViewController:(ISSidePanelController)rightViewController;
69 |
70 | - (void)showLeftViewController:(ISSidePanelController)leftViewController
71 | animated:(BOOL)animated;
72 |
73 | - (void)showMainViewController:(ISSidePanelController)mainViewController
74 | animated:(BOOL)animated;
75 |
76 | - (void)showRightViewController:(ISSidePanelController)rightViewController
77 | animated:(BOOL)animated;
78 |
79 | - (void)activateScrollingSidebarNavigation;
80 | - (void)deactivateScrollingSidebarNavigation;
81 |
82 | - (UIViewController *)visibleController;
83 |
84 | @end
85 |
86 | #pragma mark - LRScrollingSidebarControllerDelegate
87 |
88 | @protocol LRScrollingSidebarControllerDelegate
89 |
90 | @optional
91 |
92 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
93 | willBeginDraggingMainPanelWithScrollView:(UIScrollView *)scrollView;
94 |
95 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
96 | didScrollMainPanelWithScrollView:(UIScrollView *)scrollView;
97 |
98 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
99 | didEndDraggingMainPanelWithScrollView:(UIScrollView *)scrollView;
100 |
101 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
102 | didEndDeceleratingWithScrollView:(UIScrollView *)scrollView;
103 |
104 | @end
105 |
106 | #pragma mark - LRScrollingSidebarController Protocol
107 |
108 | @protocol LRScrollingSidebarController
109 |
110 | @optional
111 |
112 | - (void)controllerIsVisible:(BOOL)controllerIsVisible;
113 |
114 | @end
115 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/MainViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
39 |
50 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | // AppDelegate.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "AppDelegate.h"
24 | #import "LRScrollingSidebarController.h"
25 | #import "LeftViewController.h"
26 | #import "MainViewController.h"
27 | #import "RightViewController.h"
28 |
29 | @interface AppDelegate ()
30 |
31 | @end
32 |
33 | @implementation AppDelegate
34 |
35 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
36 | {
37 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
38 |
39 | ISSidePanelController leftViewController = [[LeftViewController alloc] init];
40 | ISSidePanelController mainViewController = [[MainViewController alloc] init];
41 | ISSidePanelController rightViewController = [[RightViewController alloc] init];
42 |
43 | LRScrollingSidebarController *rootViewController = [[LRScrollingSidebarController alloc]
44 | initWithLeftViewController:leftViewController
45 | mainViewController:mainViewController
46 | rightViewController:rightViewController
47 | mainViewControllerGap:15.0f];
48 |
49 | rootViewController.mainViewControllerOverlayColor = [UIColor cyanColor];
50 | rootViewController.mainViewControllerOverlayMaxAlpha = 0.7;
51 | rootViewController.delegate = self;
52 |
53 | self.window.rootViewController = rootViewController;
54 |
55 | [self.window makeKeyAndVisible];
56 | return YES;
57 | }
58 |
59 | #pragma mark - LRScrollingSidebarControllerDelegate
60 |
61 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
62 | willBeginDraggingMainPanelWithScrollView:(UIScrollView *)scrollView
63 | {
64 | NSLog(@"%@", NSStringFromSelector(_cmd));
65 | }
66 |
67 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
68 | didScrollMainPanelWithScrollView:(UIScrollView *)scrollView
69 | {
70 | NSLog(@"%@", NSStringFromSelector(_cmd));
71 | }
72 |
73 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
74 | didEndDraggingMainPanelWithScrollView:(UIScrollView *)scrollView
75 | {
76 | NSLog(@"%@", NSStringFromSelector(_cmd));
77 | }
78 |
79 | - (void)scrollingSidebarController:(LRScrollingSidebarController *)scrollingSidebarController
80 | didEndDeceleratingWithScrollView:(UIScrollView *)scrollView
81 | {
82 | NSLog(@"%@", NSStringFromSelector(_cmd));
83 | }
84 |
85 | #pragma mark - App Delegate
86 |
87 | - (void)applicationWillResignActive:(UIApplication *)application
88 | {
89 | // 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.
90 | // 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.
91 | }
92 |
93 | - (void)applicationDidEnterBackground:(UIApplication *)application
94 | {
95 | // 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.
96 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
97 | }
98 |
99 | - (void)applicationWillEnterForeground:(UIApplication *)application
100 | {
101 | // 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.
102 | }
103 |
104 | - (void)applicationDidBecomeActive:(UIApplication *)application
105 | {
106 | // 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.
107 | }
108 |
109 | - (void)applicationWillTerminate:(UIApplication *)application
110 | {
111 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
112 | }
113 |
114 | @end
115 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRSidebarScrollView.m:
--------------------------------------------------------------------------------
1 | // LRSidebarScrollView.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRSidebarScrollView.h"
24 | #import "LRSidebarScrollView+Private.h"
25 |
26 | static NSTimeInterval const kDefaultAnimationTime = 0.2f;
27 | static CGFloat const kEdgeDraggingFactor = -10.0f;
28 |
29 | @interface LRSidebarScrollView ()
30 |
31 | @property (nonatomic, weak) UIView *mainView;
32 | @property (nonatomic) CGFloat gap;
33 |
34 | @end
35 |
36 | @implementation LRSidebarScrollView
37 |
38 | - (instancetype)initWithGap:(CGFloat)gap
39 | {
40 | if (!(self = [super init])) return nil;
41 |
42 | _gap = gap;
43 |
44 | return self;
45 | }
46 |
47 | - (LRSidebarScrollViewState)scrollViewState
48 | {
49 | if (self.contentOffset.x == CGPointZero.x)
50 | {
51 | return LRSidebarScrollViewStateLeft;
52 | }
53 | else if (self.contentOffset.x == self.frame.size.width)
54 | {
55 | return LRSidebarScrollViewStateCenter;
56 | }
57 | else if (self.contentOffset.x == self.frame.size.width * 2)
58 | {
59 | return LRSidebarScrollViewStateRight;
60 | }
61 | else
62 | {
63 | return LRSidebarScrollViewStateUnknown;
64 | }
65 | }
66 |
67 | - (void)setScrollViewState:(LRSidebarScrollViewState)scrollState
68 | {
69 | [self setScrollViewState:scrollState animated:NO];
70 | }
71 |
72 | - (void)setScrollViewState:(LRSidebarScrollViewState)scrollState animated:(BOOL)animated
73 | {
74 | switch (scrollState)
75 | {
76 | case LRSidebarScrollViewStateLeft:
77 | {
78 | [self performAnimation:(CGPoint){0 - self.animationBounce, 0}
79 | secondPoint:CGPointZero
80 | animated:animated];
81 | break;
82 | }
83 | case LRSidebarScrollViewStateCenter:
84 | {
85 | CGFloat finalPoint = self.scrollViewState == LRSidebarScrollViewStateLeft ?
86 | self.animationBounce : -self.animationBounce;
87 | [self performAnimation:(CGPoint){self.frame.size.width + finalPoint, 0}
88 | secondPoint:(CGPoint){self.frame.size.width, 0}
89 | animated:animated];
90 | break;
91 | }
92 | case LRSidebarScrollViewStateRight:
93 | {
94 | [self performAnimation:(CGPoint){self.frame.size.width * 2 + self.animationBounce, 0}
95 | secondPoint:(CGPoint){self.frame.size.width * 2, 0}
96 | animated:animated];
97 | break;
98 | }
99 | case LRSidebarScrollViewStateUnknown:
100 | {
101 | NSAssert(NO, @"Shouldn't be here");
102 | }
103 | }
104 | }
105 |
106 | - (void)performAnimation:(CGPoint)firstPoint
107 | secondPoint:(CGPoint)secondPoint
108 | animated:(BOOL)animated
109 | {
110 | void (^completion)(BOOL finished) = ^(BOOL finished){
111 | [self.delegate scrollViewDidEndDecelerating:self];
112 | };
113 |
114 | if (animated)
115 | {
116 | [self performAnimation:firstPoint
117 | secondPoint:secondPoint
118 | completion:completion];
119 | }
120 | else
121 | {
122 | self.contentOffset = secondPoint;
123 | completion(YES);
124 | }
125 | }
126 |
127 | - (void)performAnimation:(CGPoint)firstPoint
128 | secondPoint:(CGPoint)secondPoint
129 | completion:(void(^)(BOOL finished))completion
130 | {
131 | self.scrollEnabled = NO;
132 |
133 | [UIView animateWithDuration:self.animationTime
134 | delay:0.0f
135 | options:UIViewAnimationOptionCurveEaseInOut
136 | animations:^{
137 | self.contentOffset = firstPoint;
138 | } completion:^(BOOL finished) {
139 |
140 | [UIView animateWithDuration:self.animationTime
141 | delay:0.0f
142 | options:UIViewAnimationOptionCurveEaseOut
143 | animations:^{
144 | self.contentOffset = secondPoint;
145 | } completion:^(BOOL finished) {
146 | self.scrollEnabled = YES;
147 | completion(finished);
148 | }];
149 | }];
150 | }
151 |
152 | - (NSTimeInterval)animationTime
153 | {
154 | return _animationTime ?: [self defaultAnimationTime];
155 | }
156 |
157 | - (CGFloat)animationBounce
158 | {
159 | CGFloat bounce = 0.0f;
160 |
161 | if (self.allowBouncing)
162 | {
163 | bounce = _animationBounce ?: [self defaultAnimationBounce];
164 | }
165 |
166 | return bounce;
167 | }
168 |
169 | - (NSTimeInterval)defaultAnimationTime
170 | {
171 | return kDefaultAnimationTime;
172 | }
173 |
174 | - (CGFloat)defaultAnimationBounce
175 | {
176 | return self.gap / 2;
177 | }
178 |
179 | #pragma mark - Hit Testing Tweaking
180 |
181 | - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
182 | {
183 | return CGRectContainsPoint([self effectiveFrame], point);
184 | }
185 |
186 | - (CGRect)effectiveFrame
187 | {
188 | return CGRectInset(self.mainView.frame, kEdgeDraggingFactor, 0);
189 | }
190 |
191 | @end
192 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | LRScrollingSidebarController
2 | ============================
3 |
4 | [](https://travis-ci.org/luisrecuenco/LRScrollingSidebarController)
5 | [](http://cocoadocs.org/docsets/LRScrollingSidebarController/)
6 | [](http://cocoadocs.org/docsets/LRScrollingSidebarController/)
7 | [](https://www.apache.org/licenses/LICENSE-2.0.html)
8 |
9 | A scrolling based sidebar controller
10 |
11 | ### The problem about current implementations
12 |
13 | Sidebar controllers are certainly one the the most implemented UX patterns in iOS. They became very popular due to Facebook and Path implementation. Nowadays, there are a lot of them, [too may](http://bitly.com/bundles/o_27ukkruo5l/1) I'd say. They've replaced a lot of the tab-bar based apps, but unfortunately, they all share the same problem, they are all wrong in terms of physics. Yes, there are some out there that are [kind of cool](https://github.com/monospacecollective/MSDynamicsDrawerViewController/) based on iOS 7 dynamics, but still, they don't work the way I expect this kind of controls to work. When you drag and release the panels, you feel like they stop suddenly, sharply, the panels don't flow and slide like they should. Mimicking physics as most of the libraries try is very, very difficult, you won't do it perfectly and you will feel this sudden speed changes or sharpness and abruptness when releasing the finger with a certain velocity.
14 |
15 | So? What's the solution? Pretty simple actually: use a scroll view. That simple. We are all used to the scroll view physics... Why just don't use it for this very purpose? The result is a sidebar controller that is a pleasure to use... Install it on your device and use it, you'll se the difference.
16 |
17 | This library is one of the reasons why everybody loves to use [iShows](http://ishowsapp.com/)
18 |
19 | ### Installation
20 |
21 | 1. **Using CocoaPods**
22 |
23 | Add LRScrollingSidebarController to your Podfile:
24 |
25 | ```
26 | platform :ios, "6.0"
27 | pod 'LRScrollingSidebarController'
28 | ```
29 |
30 | Run the following command:
31 |
32 | ```
33 | pod install
34 | ```
35 |
36 | 2. **Manually**
37 |
38 | Clone the project or add it as a submodule. Drag the whole LRScrollingSidebarController folder to your project.
39 |
40 | ### Usage
41 |
42 | To instanciate the container controller, just provide the three child view controllers and a gap.
43 |
44 | ```
45 | - (instancetype)initWithLeftViewController:(ISSidePanelController)leftViewController
46 | mainViewController:(ISSidePanelController)mainViewController
47 | rightViewController:(ISSidePanelController)rightViewController
48 | mainViewControllerGap:(CGFloat)mainViewControllerGap;
49 | ```
50 |
51 | Then, you can just assign the result as your window root view controller. That's enough to get started.
52 |
53 | There are some other cool features you can do with LRScrollingSidebarController.
54 |
55 | Customize the animation time.
56 |
57 | ```
58 | @property (nonatomic) NSTimeInterval animationTime;
59 | ```
60 |
61 | Specify a bounce animation displacement.
62 |
63 | ```
64 | @property (nonatomic) CGFloat animationBounce;
65 | ```
66 |
67 | Of course you can disable the bounce animation as well as the default parallax effect in the side panels.
68 |
69 | ```
70 | @property (nonatomic) BOOL allowBouncing;
71 | @property (nonatomic) BOOL allowParallax;
72 | ```
73 |
74 | By default, the main panel has an overlay on top of it. You can customize the alpha and color of it.
75 |
76 | ```
77 | @property (nonatomic, strong) UIColor *mainViewControllerOverlayColor;
78 | @property (nonatomic) CGFloat mainViewControllerOverlayMaxAlpha;
79 | ```
80 |
81 | Once you have the container controller configured with the three child controllers, you can just show them with the following methods:
82 |
83 | ```
84 | - (void)showLeftViewControllerAnimated:(BOOL)animated;
85 | - (void)showMainViewControllerAnimated:(BOOL)animated;
86 | - (void)showRightViewControllerAnimated:(BOOL)animated;
87 | ```
88 |
89 | You can also replace any of the child controllers at any moment:
90 |
91 | ```
92 | - (void)replaceLeftViewController:(ISSidePanelController)leftViewController;
93 | - (void)replaceMainViewController:(ISSidePanelController)mainViewController;
94 | - (void)replaceRightViewController:(ISSidePanelController)rightViewController;
95 |
96 | - (void)showLeftViewController:(ISSidePanelController)leftViewController
97 | animated:(BOOL)animated;
98 |
99 | - (void)showMainViewController:(ISSidePanelController)mainViewController
100 | animated:(BOOL)animated;
101 |
102 | - (void)showRightViewController:(ISSidePanelController)rightViewController
103 | animated:(BOOL)animated;
104 | ```
105 |
106 | To get the visible controller.
107 |
108 | ```
109 | - (UIViewController *)visibleController;
110 | ```
111 |
112 | The category UIViewController+LRScrollingSidebarController aims at making every view controller have a scrollingSidebarController property (the very same way every view controller has a navigationController, a tabBarController or a splitViewController property). If a view controller is embedded in the scrolling sidebar controller, it will have property pointing weakly to the container, otherwise, it will be nil. This way, you can be at a child controller, and interact directly with the sidebar controller.
113 |
114 | ```
115 | [self.scrollingSidebarController showMainViewControllerAnimated:YES];
116 | ```
117 |
118 | ### Requirements
119 |
120 | LRScrollingSidebarController requires both iOS 6.0 and ARC.
121 |
122 | You can still use LRScrollingSidebarController in your non-arc project. Just set -fobjc-arc compiler flag in every source file.
123 |
124 | ### Contact
125 |
126 | LRScrollingSidebarController was created by Luis Recuenco: [@luisrecuenco](https://twitter.com/luisrecuenco).
127 |
128 | ### Contributing
129 |
130 | If you want to contribute to the project just follow this steps:
131 |
132 | 1. Fork the repository.
133 | 2. Clone your fork to your local machine.
134 | 3. Create your feature branch with the appropriate tests.
135 | 4. Commit your changes, push to your fork and submit a pull request.
136 |
137 | ## License
138 |
139 | LRScrollingSidebarController is available under the MIT license. See the [LICENSE file](https://github.com/luisrecuenco/LRScrollingSidebarController/blob/master/LICENSE) for more info.
140 |
--------------------------------------------------------------------------------
/LRScrollingSidebarController/LRScrollingSidebarController.m:
--------------------------------------------------------------------------------
1 | // LRScrollingSidebarController.m
2 | //
3 | // Copyright (c) 2014 Luis Recuenco
4 | //
5 | // Permission is hereby granted, free of charge, to any person obtaining a copy
6 | // of this software and associated documentation files (the "Software"), to deal
7 | // in the Software without restriction, including without limitation the rights
8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | // copies of the Software, and to permit persons to whom the Software is
10 | // furnished to do so, subject to the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be included in
13 | // all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | // THE SOFTWARE.
22 |
23 | #import "LRScrollingSidebarController.h"
24 | #import "LRSidebarScrollView+Private.h"
25 | #import "UIViewController+LRScrollingSidebarController.h"
26 | #import "LRScrollingSidebarControllerStrategy.h"
27 |
28 | NSString *const kScrollViewWillBeginDraggingNotification = @"kScrollViewWillBeginDraggingNotification";
29 | NSString *const kScrollViewDidEndDraggingNotification = @"kScrollViewDidEndDraggingNotification";
30 | NSString *const kScrollViewDidEndDeceleratingNotification = @"kScrollViewDidEndDeceleratingNotification";
31 |
32 | static CGFloat const kParallaxEffectConstant = 0.15f;
33 | static CGFloat const kMainViewControllerOverlayMaxAlpha = 0.9f;
34 |
35 | @interface LRScrollingSidebarController ()
36 |
37 | @property (nonatomic, strong) LRSidebarScrollView *scrollView;
38 |
39 | @property (nonatomic, strong) UIView *overlay;
40 |
41 | @property (nonatomic, strong) id strategy;
42 |
43 | @end
44 |
45 | @implementation LRScrollingSidebarController
46 |
47 | - (instancetype)initWithLeftViewController:(ISSidePanelController)leftViewController
48 | mainViewController:(ISSidePanelController)mainViewController
49 | rightViewController:(ISSidePanelController)rightViewController
50 | mainViewControllerGap:(CGFloat)mainViewControllerGap
51 | {
52 | if (!(self = [super init])) return nil;
53 |
54 | _leftViewController = leftViewController;
55 | _mainViewController = mainViewController;
56 | _rightViewController = rightViewController;
57 |
58 | _mainViewControllerGap = mainViewControllerGap;
59 |
60 | _strategy = _rightViewController ? [[LRScrollingSidebarControllerStrategyThreePanels alloc] init] :
61 | [[LRScrollingSidebarControllerStrategyTwoPanels alloc] init];
62 |
63 | [self applyDefaults];
64 |
65 | return self;
66 | }
67 |
68 | - (void)applyDefaults
69 | {
70 | _allowBouncing = YES;
71 | _allowParallax = YES;
72 | _mainViewControllerOverlayMaxAlpha = kMainViewControllerOverlayMaxAlpha;
73 | }
74 |
75 | - (void)loadView
76 | {
77 | self.view =
78 | ({
79 | UIView *view = [[UIView alloc] initWithFrame:self.mainViewController.view.frame];
80 | self.scrollView = [[LRSidebarScrollView alloc] initWithGap:self.mainViewControllerGap];
81 | self.scrollView.frame = CGRectInset(view.frame, self.mainViewControllerGap, 0);
82 | self.scrollView.clipsToBounds = NO;
83 | self.scrollView.pagingEnabled = YES;
84 | self.scrollView.showsHorizontalScrollIndicator = NO;
85 | self.scrollView.alwaysBounceHorizontal = YES;
86 | self.scrollView.scrollsToTop = NO;
87 | self.scrollView.delegate = self;
88 | self.scrollView.animationTime = self.animationTime;
89 | self.scrollView.animationBounce = self.animationBounce;
90 | self.scrollView.allowBouncing = self.allowBouncing;
91 | view;
92 | });
93 |
94 | [self buildUpMainHierarchy];
95 | [self showInitialPanel];
96 | [self activateScrollingSidebarNavigation];
97 | }
98 |
99 | - (void)showInitialPanel
100 | {
101 | switch (self.initialState)
102 | {
103 | case LRSidebarScrollViewStateUnknown:
104 | case LRSidebarScrollViewStateLeft:
105 | [self showLeftViewControllerAnimated:NO];
106 | break;
107 | case LRSidebarScrollViewStateCenter:
108 | [self showMainViewControllerAnimated:NO];
109 | break;
110 | case LRSidebarScrollViewStateRight:
111 | [self showRightViewControllerAnimated:NO];
112 | break;
113 | default:
114 | break;
115 | }
116 | }
117 |
118 | - (void)buildUpMainHierarchy
119 | {
120 | self.overlay = [[UIView alloc] initWithFrame:self.mainViewController.view.bounds];
121 | self.overlay.backgroundColor = self.mainViewControllerOverlayColor;
122 | self.overlay.alpha = self.mainViewControllerOverlayMaxAlpha;
123 |
124 | [self replaceLeftViewController:self.leftViewController];
125 | [self replaceRightViewController:self.rightViewController];
126 | [self replaceMainViewController:self.mainViewController];
127 |
128 | [self.view addSubview:self.scrollView];
129 | }
130 |
131 | - (void)replaceLeftViewController:(ISSidePanelController)leftViewController
132 | {
133 | if (![self.strategy shouldAddLeftViewControllerToHierarchy]) return;
134 |
135 | [self removeSidePanelViewController:_leftViewController];
136 | _leftViewController = leftViewController;
137 | [self setScrollingSidebarControllerToChildViewController:_leftViewController];
138 |
139 | [self addSidePanelViewController:_leftViewController parentView:self.view];
140 | [self.view sendSubviewToBack:_leftViewController.view];
141 | }
142 |
143 | - (void)replaceMainViewController:(ISSidePanelController)mainViewController
144 | {
145 | if (![self.strategy shouldAddMainViewControllerToHierarchy]) return;
146 |
147 | [self removeSidePanelViewController:_mainViewController];
148 | _mainViewController = mainViewController;
149 | [self setScrollingSidebarControllerToChildViewController:_mainViewController];
150 |
151 | _mainViewController.view.frame =
152 | ({
153 | CGRect mainControllerFrame = _mainViewController.view.frame;
154 | mainControllerFrame.origin.x += self.scrollView.frame.size.width - self.mainViewControllerGap;
155 | mainControllerFrame;
156 | });
157 |
158 | self.scrollView.mainView = _mainViewController.view;
159 |
160 | [self addSidePanelViewController:_mainViewController
161 | parentView:self.scrollView];
162 | [self.view bringSubviewToFront:self.scrollView];
163 |
164 | [self.mainViewController.view addSubview:self.overlay];
165 | }
166 |
167 | - (void)replaceRightViewController:(ISSidePanelController)rightViewController
168 | {
169 | if (![self.strategy shouldAddRightViewControllerToHierarchy]) return;
170 |
171 | [self removeSidePanelViewController:_rightViewController];
172 | _rightViewController = rightViewController;
173 | [self setScrollingSidebarControllerToChildViewController:_rightViewController];
174 |
175 | [self addSidePanelViewController:_rightViewController parentView:self.view];
176 | [self.view sendSubviewToBack:_rightViewController.view];
177 | }
178 |
179 | - (void)showLeftViewController:(ISSidePanelController)leftViewController
180 | animated:(BOOL)animated
181 | {
182 | [self replaceLeftViewController:leftViewController];
183 | [self showLeftViewControllerAnimated:animated];
184 | }
185 |
186 | - (void)showMainViewController:(ISSidePanelController)mainViewController
187 | animated:(BOOL)animated
188 | {
189 | [self replaceMainViewController:mainViewController];
190 | [self showMainViewControllerAnimated:animated];
191 | }
192 |
193 | - (void)showRightViewController:(ISSidePanelController)rightViewController
194 | animated:(BOOL)animated
195 | {
196 | [self replaceRightViewController:rightViewController];
197 | [self showRightViewControllerAnimated:animated];
198 | }
199 |
200 | - (void)showLeftViewControllerAnimated:(BOOL)animated
201 | {
202 | if (![self.strategy shouldAddLeftViewControllerToHierarchy]) return;
203 |
204 | [self scrollViewWillBeginDragging:self.scrollView];
205 |
206 | self.leftViewController.view.hidden = NO;
207 | self.rightViewController.view.hidden = YES;
208 |
209 | [self.scrollView setScrollViewState:LRSidebarScrollViewStateLeft animated:animated];
210 | }
211 |
212 | - (void)showMainViewControllerAnimated:(BOOL)animated
213 | {
214 | if (![self.strategy shouldAddMainViewControllerToHierarchy]) return;
215 |
216 | [self scrollViewWillBeginDragging:self.scrollView];
217 |
218 | [self activateScrollingSidebarNavigation];
219 |
220 | if (!self.scrollView.tracking)
221 | {
222 | [self.scrollView setScrollViewState:LRSidebarScrollViewStateCenter animated:animated];
223 | }
224 | }
225 |
226 | - (void)showRightViewControllerAnimated:(BOOL)animated
227 | {
228 | if (![self.strategy shouldAddRightViewControllerToHierarchy]) return;
229 |
230 | [self scrollViewWillBeginDragging:self.scrollView];
231 |
232 | self.leftViewController.view.hidden = YES;
233 | self.rightViewController.view.hidden = NO;
234 |
235 | [self.scrollView setScrollViewState:LRSidebarScrollViewStateRight animated:animated];
236 | }
237 |
238 | - (void)addSidePanelViewController:(UIViewController *)childViewController
239 | parentView:(UIView *)parentView
240 | {
241 | [self addChildViewController:childViewController];
242 | [parentView addSubview:childViewController.view];
243 | [childViewController didMoveToParentViewController:self];
244 | }
245 |
246 | - (void)removeSidePanelViewController:(ISSidePanelController)childViewController
247 | {
248 | [childViewController removeFromParentViewController];
249 | [childViewController.view removeFromSuperview];
250 | childViewController.scrollingSidebarController = nil;
251 | }
252 |
253 | - (void)setScrollingSidebarControllerToChildViewController:(ISSidePanelController)childViewController
254 | {
255 | childViewController.scrollingSidebarController = self;
256 | }
257 |
258 | #pragma mark - Activate & Deactiviate scrolling sidebar navigation
259 |
260 | - (void)activateScrollingSidebarNavigation
261 | {
262 | self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width *
263 | [self.strategy numberOfPanels],
264 | self.scrollView.frame.size.height);
265 | }
266 |
267 | - (void)deactivateScrollingSidebarNavigation
268 | {
269 | // It could also be deactivated via scrollEnabled property in UIScrollView.
270 | // Doing it this way the user can drag the gap and see that the main panel
271 | // is actually something to move...
272 | self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width,
273 | self.scrollView.frame.size.height);
274 | }
275 |
276 | #pragma mark - UIScrollViewDelegate
277 |
278 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
279 | {
280 | [[NSNotificationCenter defaultCenter] postNotificationName:kScrollViewWillBeginDraggingNotification
281 | object:self.scrollView];
282 |
283 | if ([self.delegate respondsToSelector:
284 | @selector(scrollingSidebarController:willBeginDraggingMainPanelWithScrollView:)])
285 | {
286 | [self.delegate scrollingSidebarController:self
287 | willBeginDraggingMainPanelWithScrollView:self.scrollView];
288 | }
289 | }
290 |
291 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView
292 | {
293 | if ([self.delegate respondsToSelector:
294 | @selector(scrollingSidebarController:didScrollMainPanelWithScrollView:)])
295 | {
296 | [self.delegate scrollingSidebarController:self
297 | didScrollMainPanelWithScrollView:self.scrollView];
298 | }
299 |
300 | if (self.scrollView.scrollEnabled)
301 | {
302 | CGFloat scrollViewFrameWidth = self.scrollView.frame.size.width;
303 | self.rightViewController.view.hidden = self.scrollView.contentOffset.x < scrollViewFrameWidth;
304 | self.leftViewController.view.hidden = self.scrollView.contentOffset.x > scrollViewFrameWidth;
305 | }
306 |
307 | [self applyParallaxEffect];
308 | [self applyOverlayEffect];
309 | }
310 |
311 | - (void)applyParallaxEffect
312 | {
313 | if (!self.allowParallax) return;
314 |
315 | if ([self isDraggingLeft])
316 | {
317 | self.leftViewController.view.frame =
318 | ({
319 | CGRect frame = self.leftViewController.view.frame;
320 | frame.origin.x = -self.scrollView.contentOffset.x * kParallaxEffectConstant;
321 | frame;
322 | });
323 | }
324 | else
325 | {
326 | self.rightViewController.view.frame =
327 | ({
328 | CGRect frame = self.rightViewController.view.frame;
329 | frame.origin.x = (self.scrollView.frame.size.width - self.scrollView.contentOffset.x) *
330 | kParallaxEffectConstant + self.mainViewControllerGap * 3;
331 | frame;
332 | });
333 | }
334 | }
335 |
336 | - (void)applyOverlayEffect
337 | {
338 | CGFloat mainViewFrameWidth = self.mainViewController.view.frame.size.width;
339 |
340 | if ([self isDraggingLeft])
341 | {
342 | self.overlay.alpha = self.mainViewControllerOverlayMaxAlpha - self.scrollView.contentOffset.x *
343 | self.mainViewControllerOverlayMaxAlpha / (mainViewFrameWidth - self.mainViewControllerGap * 2);
344 | }
345 | else
346 | {
347 | self.overlay.alpha = (self.scrollView.contentOffset.x / (mainViewFrameWidth -
348 | self.mainViewControllerGap * 2) - 1.0f) * self.mainViewControllerOverlayMaxAlpha;
349 | }
350 | }
351 |
352 | - (BOOL)isDraggingLeft
353 | {
354 | CGFloat mainViewFrameWidth = self.mainViewController.view.frame.size.width;
355 |
356 | return self.scrollView.contentOffset.x <= mainViewFrameWidth - self.mainViewControllerGap * 2;
357 | }
358 |
359 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
360 | {
361 | [[NSNotificationCenter defaultCenter] postNotificationName:kScrollViewDidEndDraggingNotification
362 | object:self.scrollView];
363 | if ([self.delegate respondsToSelector:
364 | @selector(scrollingSidebarController:didEndDraggingMainPanelWithScrollView:)])
365 | {
366 | [self.delegate scrollingSidebarController:self
367 | didEndDraggingMainPanelWithScrollView:self.scrollView];
368 | }
369 | }
370 |
371 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
372 | {
373 | [self notifyControllerIsVisible:self.leftViewController];
374 | [self notifyControllerIsVisible:self.mainViewController];
375 | [self notifyControllerIsVisible:self.rightViewController];
376 |
377 | [[NSNotificationCenter defaultCenter] postNotificationName:kScrollViewDidEndDeceleratingNotification
378 | object:self.scrollView];
379 |
380 | if ([self.delegate respondsToSelector:
381 | @selector(scrollingSidebarController:didEndDeceleratingWithScrollView:)])
382 | {
383 | [self.delegate scrollingSidebarController:self
384 | didEndDeceleratingWithScrollView:self.scrollView];
385 | }
386 | }
387 |
388 | - (void)notifyControllerIsVisible:(ISSidePanelController)viewController
389 | {
390 | if ([viewController respondsToSelector:@selector(controllerIsVisible:)])
391 | {
392 | [viewController controllerIsVisible:self.visibleController == viewController];
393 | }
394 | }
395 |
396 | - (UIViewController *)visibleController
397 | {
398 | switch (self.scrollView.scrollViewState)
399 | {
400 | case LRSidebarScrollViewStateLeft:
401 | return self.leftViewController;
402 | case LRSidebarScrollViewStateCenter:
403 | return self.mainViewController;
404 | case LRSidebarScrollViewStateRight:
405 | return self.rightViewController;
406 | case LRSidebarScrollViewStateUnknown:
407 | return nil;
408 | }
409 | }
410 |
411 | #pragma mark - Supported Orientations (Only portrait for now)
412 |
413 | - (NSUInteger)supportedInterfaceOrientations
414 | {
415 | return UIInterfaceOrientationMaskPortrait;
416 | }
417 |
418 | @end
419 |
--------------------------------------------------------------------------------
/Example/LRScrollingSidebarControllerExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 336317D318B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 336317D218B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.m */; };
11 | 33C7DDB9188CA54D00116FEC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33C7DDB8188CA54D00116FEC /* Foundation.framework */; };
12 | 33C7DDBB188CA54D00116FEC /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33C7DDBA188CA54D00116FEC /* CoreGraphics.framework */; };
13 | 33C7DDBD188CA54D00116FEC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33C7DDBC188CA54D00116FEC /* UIKit.framework */; };
14 | 33C7DDC3188CA54D00116FEC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33C7DDC1188CA54D00116FEC /* InfoPlist.strings */; };
15 | 33C7DDC5188CA54D00116FEC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C7DDC4188CA54D00116FEC /* main.m */; };
16 | 33C7DDC9188CA54D00116FEC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C7DDC8188CA54D00116FEC /* AppDelegate.m */; };
17 | 33C7DDCB188CA54D00116FEC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33C7DDCA188CA54D00116FEC /* Images.xcassets */; };
18 | 33C7DDD2188CA54D00116FEC /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33C7DDD1188CA54D00116FEC /* XCTest.framework */; };
19 | 33C7DDD3188CA54D00116FEC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33C7DDB8188CA54D00116FEC /* Foundation.framework */; };
20 | 33C7DDD4188CA54D00116FEC /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33C7DDBC188CA54D00116FEC /* UIKit.framework */; };
21 | 33C7DDDC188CA54D00116FEC /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33C7DDDA188CA54D00116FEC /* InfoPlist.strings */; };
22 | 33C7DDDE188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33C7DDDD188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.m */; };
23 | 33F506E0188CA5900066B30B /* LRSidebarScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506DC188CA5900066B30B /* LRSidebarScrollView.m */; };
24 | 33F506E1188CA5900066B30B /* LRScrollingSidebarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506DE188CA5900066B30B /* LRScrollingSidebarController.m */; };
25 | 33F506EE188CBD910066B30B /* LeftViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506ED188CBD910066B30B /* LeftViewController.m */; };
26 | 33F506F1188CBD9B0066B30B /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506F0188CBD9B0066B30B /* MainViewController.m */; };
27 | 33F506F4188CBDA20066B30B /* RightViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506F3188CBDA20066B30B /* RightViewController.m */; };
28 | 33F506F7188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506F6188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.m */; };
29 | 33F506F9188DEF230066B30B /* LeftViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33F506F8188DEF230066B30B /* LeftViewController.xib */; };
30 | 33F506FB188DEFA50066B30B /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33F506FA188DEFA50066B30B /* MainViewController.xib */; };
31 | 33F506FD188DEFAD0066B30B /* RightViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33F506FC188DEFAD0066B30B /* RightViewController.xib */; };
32 | 33F50700188E0BB70066B30B /* LRRandomColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 33F506FF188E0BB70066B30B /* LRRandomColor.m */; };
33 | /* End PBXBuildFile section */
34 |
35 | /* Begin PBXContainerItemProxy section */
36 | 33C7DDD5188CA54D00116FEC /* PBXContainerItemProxy */ = {
37 | isa = PBXContainerItemProxy;
38 | containerPortal = 33C7DDAD188CA54D00116FEC /* Project object */;
39 | proxyType = 1;
40 | remoteGlobalIDString = 33C7DDB4188CA54D00116FEC;
41 | remoteInfo = LRScrollingSidebarControllerExample;
42 | };
43 | /* End PBXContainerItemProxy section */
44 |
45 | /* Begin PBXFileReference section */
46 | 336317D118B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LRScrollingSidebarControllerStrategy.h; path = ../../LRScrollingSidebarController/LRScrollingSidebarControllerStrategy.h; sourceTree = ""; };
47 | 336317D218B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LRScrollingSidebarControllerStrategy.m; path = ../../LRScrollingSidebarController/LRScrollingSidebarControllerStrategy.m; sourceTree = ""; };
48 | 33C7DDB5188CA54D00116FEC /* LRScrollingSidebarControllerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LRScrollingSidebarControllerExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
49 | 33C7DDB8188CA54D00116FEC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
50 | 33C7DDBA188CA54D00116FEC /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
51 | 33C7DDBC188CA54D00116FEC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
52 | 33C7DDC0188CA54D00116FEC /* LRScrollingSidebarControllerExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LRScrollingSidebarControllerExample-Info.plist"; sourceTree = ""; };
53 | 33C7DDC2188CA54D00116FEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
54 | 33C7DDC4188CA54D00116FEC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
55 | 33C7DDC6188CA54D00116FEC /* LRScrollingSidebarControllerExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LRScrollingSidebarControllerExample-Prefix.pch"; sourceTree = ""; };
56 | 33C7DDC7188CA54D00116FEC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
57 | 33C7DDC8188CA54D00116FEC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
58 | 33C7DDCA188CA54D00116FEC /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
59 | 33C7DDD0188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LRScrollingSidebarControllerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
60 | 33C7DDD1188CA54D00116FEC /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
61 | 33C7DDD9188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LRScrollingSidebarControllerExampleTests-Info.plist"; sourceTree = ""; };
62 | 33C7DDDB188CA54D00116FEC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
63 | 33C7DDDD188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LRScrollingSidebarControllerExampleTests.m; sourceTree = ""; };
64 | 33F506DB188CA5900066B30B /* LRSidebarScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LRSidebarScrollView.h; path = ../../LRScrollingSidebarController/LRSidebarScrollView.h; sourceTree = ""; };
65 | 33F506DC188CA5900066B30B /* LRSidebarScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LRSidebarScrollView.m; path = ../../LRScrollingSidebarController/LRSidebarScrollView.m; sourceTree = ""; };
66 | 33F506DD188CA5900066B30B /* LRScrollingSidebarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LRScrollingSidebarController.h; path = ../../LRScrollingSidebarController/LRScrollingSidebarController.h; sourceTree = ""; };
67 | 33F506DE188CA5900066B30B /* LRScrollingSidebarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LRScrollingSidebarController.m; path = ../../LRScrollingSidebarController/LRScrollingSidebarController.m; sourceTree = ""; };
68 | 33F506E2188CB3DF0066B30B /* LRSidebarScrollView+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "LRSidebarScrollView+Private.h"; path = "../../LRScrollingSidebarController/LRSidebarScrollView+Private.h"; sourceTree = ""; };
69 | 33F506EC188CBD910066B30B /* LeftViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeftViewController.h; sourceTree = ""; };
70 | 33F506ED188CBD910066B30B /* LeftViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LeftViewController.m; sourceTree = ""; };
71 | 33F506EF188CBD9B0066B30B /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; };
72 | 33F506F0188CBD9B0066B30B /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; wrapsLines = 0; };
73 | 33F506F2188CBDA20066B30B /* RightViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightViewController.h; sourceTree = ""; };
74 | 33F506F3188CBDA20066B30B /* RightViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RightViewController.m; sourceTree = ""; };
75 | 33F506F5188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+LRScrollingSidebarController.h"; path = "../../LRScrollingSidebarController/UIViewController+LRScrollingSidebarController.h"; sourceTree = ""; };
76 | 33F506F6188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+LRScrollingSidebarController.m"; path = "../../LRScrollingSidebarController/UIViewController+LRScrollingSidebarController.m"; sourceTree = ""; };
77 | 33F506F8188DEF230066B30B /* LeftViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LeftViewController.xib; sourceTree = ""; };
78 | 33F506FA188DEFA50066B30B /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; };
79 | 33F506FC188DEFAD0066B30B /* RightViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RightViewController.xib; sourceTree = ""; };
80 | 33F506FE188E0BB70066B30B /* LRRandomColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LRRandomColor.h; sourceTree = ""; };
81 | 33F506FF188E0BB70066B30B /* LRRandomColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LRRandomColor.m; sourceTree = ""; };
82 | /* End PBXFileReference section */
83 |
84 | /* Begin PBXFrameworksBuildPhase section */
85 | 33C7DDB2188CA54D00116FEC /* Frameworks */ = {
86 | isa = PBXFrameworksBuildPhase;
87 | buildActionMask = 2147483647;
88 | files = (
89 | 33C7DDBB188CA54D00116FEC /* CoreGraphics.framework in Frameworks */,
90 | 33C7DDBD188CA54D00116FEC /* UIKit.framework in Frameworks */,
91 | 33C7DDB9188CA54D00116FEC /* Foundation.framework in Frameworks */,
92 | );
93 | runOnlyForDeploymentPostprocessing = 0;
94 | };
95 | 33C7DDCD188CA54D00116FEC /* Frameworks */ = {
96 | isa = PBXFrameworksBuildPhase;
97 | buildActionMask = 2147483647;
98 | files = (
99 | 33C7DDD2188CA54D00116FEC /* XCTest.framework in Frameworks */,
100 | 33C7DDD4188CA54D00116FEC /* UIKit.framework in Frameworks */,
101 | 33C7DDD3188CA54D00116FEC /* Foundation.framework in Frameworks */,
102 | );
103 | runOnlyForDeploymentPostprocessing = 0;
104 | };
105 | /* End PBXFrameworksBuildPhase section */
106 |
107 | /* Begin PBXGroup section */
108 | 33C7DDAC188CA54D00116FEC = {
109 | isa = PBXGroup;
110 | children = (
111 | 33C7DDBE188CA54D00116FEC /* LRScrollingSidebarControllerExample */,
112 | 33C7DDD7188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests */,
113 | 33C7DDB7188CA54D00116FEC /* Frameworks */,
114 | 33C7DDB6188CA54D00116FEC /* Products */,
115 | );
116 | sourceTree = "";
117 | };
118 | 33C7DDB6188CA54D00116FEC /* Products */ = {
119 | isa = PBXGroup;
120 | children = (
121 | 33C7DDB5188CA54D00116FEC /* LRScrollingSidebarControllerExample.app */,
122 | 33C7DDD0188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.xctest */,
123 | );
124 | name = Products;
125 | sourceTree = "";
126 | };
127 | 33C7DDB7188CA54D00116FEC /* Frameworks */ = {
128 | isa = PBXGroup;
129 | children = (
130 | 33C7DDB8188CA54D00116FEC /* Foundation.framework */,
131 | 33C7DDBA188CA54D00116FEC /* CoreGraphics.framework */,
132 | 33C7DDBC188CA54D00116FEC /* UIKit.framework */,
133 | 33C7DDD1188CA54D00116FEC /* XCTest.framework */,
134 | );
135 | name = Frameworks;
136 | sourceTree = "";
137 | };
138 | 33C7DDBE188CA54D00116FEC /* LRScrollingSidebarControllerExample */ = {
139 | isa = PBXGroup;
140 | children = (
141 | 33F50701188E0C890066B30B /* Random Color Helper */,
142 | 33F506EB188CBD790066B30B /* Sidebar Controllers */,
143 | 33F506DA188CA57C0066B30B /* LRScrollingSidebarController */,
144 | 33C7DDC7188CA54D00116FEC /* AppDelegate.h */,
145 | 33C7DDC8188CA54D00116FEC /* AppDelegate.m */,
146 | 33C7DDCA188CA54D00116FEC /* Images.xcassets */,
147 | 33C7DDBF188CA54D00116FEC /* Supporting Files */,
148 | );
149 | path = LRScrollingSidebarControllerExample;
150 | sourceTree = "";
151 | };
152 | 33C7DDBF188CA54D00116FEC /* Supporting Files */ = {
153 | isa = PBXGroup;
154 | children = (
155 | 33C7DDC0188CA54D00116FEC /* LRScrollingSidebarControllerExample-Info.plist */,
156 | 33C7DDC1188CA54D00116FEC /* InfoPlist.strings */,
157 | 33C7DDC4188CA54D00116FEC /* main.m */,
158 | 33C7DDC6188CA54D00116FEC /* LRScrollingSidebarControllerExample-Prefix.pch */,
159 | );
160 | name = "Supporting Files";
161 | sourceTree = "";
162 | };
163 | 33C7DDD7188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests */ = {
164 | isa = PBXGroup;
165 | children = (
166 | 33C7DDDD188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.m */,
167 | 33C7DDD8188CA54D00116FEC /* Supporting Files */,
168 | );
169 | path = LRScrollingSidebarControllerExampleTests;
170 | sourceTree = "";
171 | };
172 | 33C7DDD8188CA54D00116FEC /* Supporting Files */ = {
173 | isa = PBXGroup;
174 | children = (
175 | 33C7DDD9188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests-Info.plist */,
176 | 33C7DDDA188CA54D00116FEC /* InfoPlist.strings */,
177 | );
178 | name = "Supporting Files";
179 | sourceTree = "";
180 | };
181 | 33F506DA188CA57C0066B30B /* LRScrollingSidebarController */ = {
182 | isa = PBXGroup;
183 | children = (
184 | 33F506DD188CA5900066B30B /* LRScrollingSidebarController.h */,
185 | 33F506DE188CA5900066B30B /* LRScrollingSidebarController.m */,
186 | 33F506DB188CA5900066B30B /* LRSidebarScrollView.h */,
187 | 33F506DC188CA5900066B30B /* LRSidebarScrollView.m */,
188 | 33F506E2188CB3DF0066B30B /* LRSidebarScrollView+Private.h */,
189 | 33F506F5188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.h */,
190 | 33F506F6188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.m */,
191 | 336317D118B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.h */,
192 | 336317D218B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.m */,
193 | );
194 | name = LRScrollingSidebarController;
195 | sourceTree = "";
196 | };
197 | 33F506EB188CBD790066B30B /* Sidebar Controllers */ = {
198 | isa = PBXGroup;
199 | children = (
200 | 33F506EC188CBD910066B30B /* LeftViewController.h */,
201 | 33F506ED188CBD910066B30B /* LeftViewController.m */,
202 | 33F506F8188DEF230066B30B /* LeftViewController.xib */,
203 | 33F506EF188CBD9B0066B30B /* MainViewController.h */,
204 | 33F506F0188CBD9B0066B30B /* MainViewController.m */,
205 | 33F506FA188DEFA50066B30B /* MainViewController.xib */,
206 | 33F506F2188CBDA20066B30B /* RightViewController.h */,
207 | 33F506F3188CBDA20066B30B /* RightViewController.m */,
208 | 33F506FC188DEFAD0066B30B /* RightViewController.xib */,
209 | );
210 | name = "Sidebar Controllers";
211 | sourceTree = "";
212 | };
213 | 33F50701188E0C890066B30B /* Random Color Helper */ = {
214 | isa = PBXGroup;
215 | children = (
216 | 33F506FE188E0BB70066B30B /* LRRandomColor.h */,
217 | 33F506FF188E0BB70066B30B /* LRRandomColor.m */,
218 | );
219 | name = "Random Color Helper";
220 | sourceTree = "";
221 | };
222 | /* End PBXGroup section */
223 |
224 | /* Begin PBXNativeTarget section */
225 | 33C7DDB4188CA54D00116FEC /* LRScrollingSidebarControllerExample */ = {
226 | isa = PBXNativeTarget;
227 | buildConfigurationList = 33C7DDE1188CA54D00116FEC /* Build configuration list for PBXNativeTarget "LRScrollingSidebarControllerExample" */;
228 | buildPhases = (
229 | 33C7DDB1188CA54D00116FEC /* Sources */,
230 | 33C7DDB2188CA54D00116FEC /* Frameworks */,
231 | 33C7DDB3188CA54D00116FEC /* Resources */,
232 | );
233 | buildRules = (
234 | );
235 | dependencies = (
236 | );
237 | name = LRScrollingSidebarControllerExample;
238 | productName = LRScrollingSidebarControllerExample;
239 | productReference = 33C7DDB5188CA54D00116FEC /* LRScrollingSidebarControllerExample.app */;
240 | productType = "com.apple.product-type.application";
241 | };
242 | 33C7DDCF188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests */ = {
243 | isa = PBXNativeTarget;
244 | buildConfigurationList = 33C7DDE4188CA54D00116FEC /* Build configuration list for PBXNativeTarget "LRScrollingSidebarControllerExampleTests" */;
245 | buildPhases = (
246 | 33C7DDCC188CA54D00116FEC /* Sources */,
247 | 33C7DDCD188CA54D00116FEC /* Frameworks */,
248 | 33C7DDCE188CA54D00116FEC /* Resources */,
249 | );
250 | buildRules = (
251 | );
252 | dependencies = (
253 | 33C7DDD6188CA54D00116FEC /* PBXTargetDependency */,
254 | );
255 | name = LRScrollingSidebarControllerExampleTests;
256 | productName = LRScrollingSidebarControllerExampleTests;
257 | productReference = 33C7DDD0188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.xctest */;
258 | productType = "com.apple.product-type.bundle.unit-test";
259 | };
260 | /* End PBXNativeTarget section */
261 |
262 | /* Begin PBXProject section */
263 | 33C7DDAD188CA54D00116FEC /* Project object */ = {
264 | isa = PBXProject;
265 | attributes = {
266 | LastUpgradeCheck = 0500;
267 | ORGANIZATIONNAME = "Luis Recuenco";
268 | TargetAttributes = {
269 | 33C7DDCF188CA54D00116FEC = {
270 | TestTargetID = 33C7DDB4188CA54D00116FEC;
271 | };
272 | };
273 | };
274 | buildConfigurationList = 33C7DDB0188CA54D00116FEC /* Build configuration list for PBXProject "LRScrollingSidebarControllerExample" */;
275 | compatibilityVersion = "Xcode 3.2";
276 | developmentRegion = English;
277 | hasScannedForEncodings = 0;
278 | knownRegions = (
279 | en,
280 | );
281 | mainGroup = 33C7DDAC188CA54D00116FEC;
282 | productRefGroup = 33C7DDB6188CA54D00116FEC /* Products */;
283 | projectDirPath = "";
284 | projectRoot = "";
285 | targets = (
286 | 33C7DDB4188CA54D00116FEC /* LRScrollingSidebarControllerExample */,
287 | 33C7DDCF188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests */,
288 | );
289 | };
290 | /* End PBXProject section */
291 |
292 | /* Begin PBXResourcesBuildPhase section */
293 | 33C7DDB3188CA54D00116FEC /* Resources */ = {
294 | isa = PBXResourcesBuildPhase;
295 | buildActionMask = 2147483647;
296 | files = (
297 | 33C7DDC3188CA54D00116FEC /* InfoPlist.strings in Resources */,
298 | 33F506FD188DEFAD0066B30B /* RightViewController.xib in Resources */,
299 | 33F506F9188DEF230066B30B /* LeftViewController.xib in Resources */,
300 | 33C7DDCB188CA54D00116FEC /* Images.xcassets in Resources */,
301 | 33F506FB188DEFA50066B30B /* MainViewController.xib in Resources */,
302 | );
303 | runOnlyForDeploymentPostprocessing = 0;
304 | };
305 | 33C7DDCE188CA54D00116FEC /* Resources */ = {
306 | isa = PBXResourcesBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | 33C7DDDC188CA54D00116FEC /* InfoPlist.strings in Resources */,
310 | );
311 | runOnlyForDeploymentPostprocessing = 0;
312 | };
313 | /* End PBXResourcesBuildPhase section */
314 |
315 | /* Begin PBXSourcesBuildPhase section */
316 | 33C7DDB1188CA54D00116FEC /* Sources */ = {
317 | isa = PBXSourcesBuildPhase;
318 | buildActionMask = 2147483647;
319 | files = (
320 | 33F506F4188CBDA20066B30B /* RightViewController.m in Sources */,
321 | 33F506E1188CA5900066B30B /* LRScrollingSidebarController.m in Sources */,
322 | 33F506F1188CBD9B0066B30B /* MainViewController.m in Sources */,
323 | 33F506F7188CBF3E0066B30B /* UIViewController+LRScrollingSidebarController.m in Sources */,
324 | 33F506EE188CBD910066B30B /* LeftViewController.m in Sources */,
325 | 336317D318B0E58B00F1A209 /* LRScrollingSidebarControllerStrategy.m in Sources */,
326 | 33F506E0188CA5900066B30B /* LRSidebarScrollView.m in Sources */,
327 | 33F50700188E0BB70066B30B /* LRRandomColor.m in Sources */,
328 | 33C7DDC9188CA54D00116FEC /* AppDelegate.m in Sources */,
329 | 33C7DDC5188CA54D00116FEC /* main.m in Sources */,
330 | );
331 | runOnlyForDeploymentPostprocessing = 0;
332 | };
333 | 33C7DDCC188CA54D00116FEC /* Sources */ = {
334 | isa = PBXSourcesBuildPhase;
335 | buildActionMask = 2147483647;
336 | files = (
337 | 33C7DDDE188CA54D00116FEC /* LRScrollingSidebarControllerExampleTests.m in Sources */,
338 | );
339 | runOnlyForDeploymentPostprocessing = 0;
340 | };
341 | /* End PBXSourcesBuildPhase section */
342 |
343 | /* Begin PBXTargetDependency section */
344 | 33C7DDD6188CA54D00116FEC /* PBXTargetDependency */ = {
345 | isa = PBXTargetDependency;
346 | target = 33C7DDB4188CA54D00116FEC /* LRScrollingSidebarControllerExample */;
347 | targetProxy = 33C7DDD5188CA54D00116FEC /* PBXContainerItemProxy */;
348 | };
349 | /* End PBXTargetDependency section */
350 |
351 | /* Begin PBXVariantGroup section */
352 | 33C7DDC1188CA54D00116FEC /* InfoPlist.strings */ = {
353 | isa = PBXVariantGroup;
354 | children = (
355 | 33C7DDC2188CA54D00116FEC /* en */,
356 | );
357 | name = InfoPlist.strings;
358 | sourceTree = "";
359 | };
360 | 33C7DDDA188CA54D00116FEC /* InfoPlist.strings */ = {
361 | isa = PBXVariantGroup;
362 | children = (
363 | 33C7DDDB188CA54D00116FEC /* en */,
364 | );
365 | name = InfoPlist.strings;
366 | sourceTree = "";
367 | };
368 | /* End PBXVariantGroup section */
369 |
370 | /* Begin XCBuildConfiguration section */
371 | 33C7DDDF188CA54D00116FEC /* Debug */ = {
372 | isa = XCBuildConfiguration;
373 | buildSettings = {
374 | ALWAYS_SEARCH_USER_PATHS = NO;
375 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
376 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
377 | CLANG_CXX_LIBRARY = "libc++";
378 | CLANG_ENABLE_MODULES = YES;
379 | CLANG_ENABLE_OBJC_ARC = YES;
380 | CLANG_WARN_BOOL_CONVERSION = YES;
381 | CLANG_WARN_CONSTANT_CONVERSION = YES;
382 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
383 | CLANG_WARN_EMPTY_BODY = YES;
384 | CLANG_WARN_ENUM_CONVERSION = YES;
385 | CLANG_WARN_INT_CONVERSION = YES;
386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
387 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
388 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
389 | COPY_PHASE_STRIP = NO;
390 | GCC_C_LANGUAGE_STANDARD = gnu99;
391 | GCC_DYNAMIC_NO_PIC = NO;
392 | GCC_OPTIMIZATION_LEVEL = 0;
393 | GCC_PREPROCESSOR_DEFINITIONS = (
394 | "DEBUG=1",
395 | "$(inherited)",
396 | );
397 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
398 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
399 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
400 | GCC_WARN_UNDECLARED_SELECTOR = YES;
401 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
402 | GCC_WARN_UNUSED_FUNCTION = YES;
403 | GCC_WARN_UNUSED_VARIABLE = YES;
404 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
405 | ONLY_ACTIVE_ARCH = YES;
406 | SDKROOT = iphoneos;
407 | };
408 | name = Debug;
409 | };
410 | 33C7DDE0188CA54D00116FEC /* Release */ = {
411 | isa = XCBuildConfiguration;
412 | buildSettings = {
413 | ALWAYS_SEARCH_USER_PATHS = NO;
414 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
415 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
416 | CLANG_CXX_LIBRARY = "libc++";
417 | CLANG_ENABLE_MODULES = YES;
418 | CLANG_ENABLE_OBJC_ARC = YES;
419 | CLANG_WARN_BOOL_CONVERSION = YES;
420 | CLANG_WARN_CONSTANT_CONVERSION = YES;
421 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
422 | CLANG_WARN_EMPTY_BODY = YES;
423 | CLANG_WARN_ENUM_CONVERSION = YES;
424 | CLANG_WARN_INT_CONVERSION = YES;
425 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
427 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
428 | COPY_PHASE_STRIP = YES;
429 | ENABLE_NS_ASSERTIONS = NO;
430 | GCC_C_LANGUAGE_STANDARD = gnu99;
431 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
432 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
433 | GCC_WARN_UNDECLARED_SELECTOR = YES;
434 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
435 | GCC_WARN_UNUSED_FUNCTION = YES;
436 | GCC_WARN_UNUSED_VARIABLE = YES;
437 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
438 | SDKROOT = iphoneos;
439 | VALIDATE_PRODUCT = YES;
440 | };
441 | name = Release;
442 | };
443 | 33C7DDE2188CA54D00116FEC /* Debug */ = {
444 | isa = XCBuildConfiguration;
445 | buildSettings = {
446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
447 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
448 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
449 | GCC_PREFIX_HEADER = "LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Prefix.pch";
450 | INFOPLIST_FILE = "LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Info.plist";
451 | PRODUCT_NAME = "$(TARGET_NAME)";
452 | WRAPPER_EXTENSION = app;
453 | };
454 | name = Debug;
455 | };
456 | 33C7DDE3188CA54D00116FEC /* Release */ = {
457 | isa = XCBuildConfiguration;
458 | buildSettings = {
459 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
460 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
461 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
462 | GCC_PREFIX_HEADER = "LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Prefix.pch";
463 | INFOPLIST_FILE = "LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Info.plist";
464 | PRODUCT_NAME = "$(TARGET_NAME)";
465 | WRAPPER_EXTENSION = app;
466 | };
467 | name = Release;
468 | };
469 | 33C7DDE5188CA54D00116FEC /* Debug */ = {
470 | isa = XCBuildConfiguration;
471 | buildSettings = {
472 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
473 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LRScrollingSidebarControllerExample.app/LRScrollingSidebarControllerExample";
474 | FRAMEWORK_SEARCH_PATHS = (
475 | "$(SDKROOT)/Developer/Library/Frameworks",
476 | "$(inherited)",
477 | "$(DEVELOPER_FRAMEWORKS_DIR)",
478 | );
479 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
480 | GCC_PREFIX_HEADER = "LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Prefix.pch";
481 | GCC_PREPROCESSOR_DEFINITIONS = (
482 | "DEBUG=1",
483 | "$(inherited)",
484 | );
485 | INFOPLIST_FILE = "LRScrollingSidebarControllerExampleTests/LRScrollingSidebarControllerExampleTests-Info.plist";
486 | PRODUCT_NAME = "$(TARGET_NAME)";
487 | TEST_HOST = "$(BUNDLE_LOADER)";
488 | WRAPPER_EXTENSION = xctest;
489 | };
490 | name = Debug;
491 | };
492 | 33C7DDE6188CA54D00116FEC /* Release */ = {
493 | isa = XCBuildConfiguration;
494 | buildSettings = {
495 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
496 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LRScrollingSidebarControllerExample.app/LRScrollingSidebarControllerExample";
497 | FRAMEWORK_SEARCH_PATHS = (
498 | "$(SDKROOT)/Developer/Library/Frameworks",
499 | "$(inherited)",
500 | "$(DEVELOPER_FRAMEWORKS_DIR)",
501 | );
502 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
503 | GCC_PREFIX_HEADER = "LRScrollingSidebarControllerExample/LRScrollingSidebarControllerExample-Prefix.pch";
504 | INFOPLIST_FILE = "LRScrollingSidebarControllerExampleTests/LRScrollingSidebarControllerExampleTests-Info.plist";
505 | PRODUCT_NAME = "$(TARGET_NAME)";
506 | TEST_HOST = "$(BUNDLE_LOADER)";
507 | WRAPPER_EXTENSION = xctest;
508 | };
509 | name = Release;
510 | };
511 | /* End XCBuildConfiguration section */
512 |
513 | /* Begin XCConfigurationList section */
514 | 33C7DDB0188CA54D00116FEC /* Build configuration list for PBXProject "LRScrollingSidebarControllerExample" */ = {
515 | isa = XCConfigurationList;
516 | buildConfigurations = (
517 | 33C7DDDF188CA54D00116FEC /* Debug */,
518 | 33C7DDE0188CA54D00116FEC /* Release */,
519 | );
520 | defaultConfigurationIsVisible = 0;
521 | defaultConfigurationName = Release;
522 | };
523 | 33C7DDE1188CA54D00116FEC /* Build configuration list for PBXNativeTarget "LRScrollingSidebarControllerExample" */ = {
524 | isa = XCConfigurationList;
525 | buildConfigurations = (
526 | 33C7DDE2188CA54D00116FEC /* Debug */,
527 | 33C7DDE3188CA54D00116FEC /* Release */,
528 | );
529 | defaultConfigurationIsVisible = 0;
530 | defaultConfigurationName = Release;
531 | };
532 | 33C7DDE4188CA54D00116FEC /* Build configuration list for PBXNativeTarget "LRScrollingSidebarControllerExampleTests" */ = {
533 | isa = XCConfigurationList;
534 | buildConfigurations = (
535 | 33C7DDE5188CA54D00116FEC /* Debug */,
536 | 33C7DDE6188CA54D00116FEC /* Release */,
537 | );
538 | defaultConfigurationIsVisible = 0;
539 | defaultConfigurationName = Release;
540 | };
541 | /* End XCConfigurationList section */
542 | };
543 | rootObject = 33C7DDAD188CA54D00116FEC /* Project object */;
544 | }
545 |
--------------------------------------------------------------------------------