├── .travis.yml ├── Demos ├── TinderLike │ ├── Default-568h@2x.png │ ├── TinderLike.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── TinderLike.xccheckout │ │ │ └── xcuserdata │ │ │ │ ├── kingsoft_ios.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ │ └── stefan.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ ├── kingsoft_ios.xcuserdatad │ │ │ └── xcschemes │ │ │ │ ├── TinderLike.xcscheme │ │ │ │ └── xcschememanagement.plist │ │ │ └── stefan.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── TinderLike.xcscheme │ │ │ └── xcschememanagement.plist │ ├── TinderLike │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── chat.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── rchat.png │ │ │ │ └── rchat@2x.png │ │ │ ├── gear.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── gear.png │ │ │ │ └── gear@2x.png │ │ │ └── profile.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── chat_full.png │ │ │ │ └── chat_full@2x.png │ │ ├── Info.plist │ │ ├── TinderLike-Prefix.pch │ │ └── main.m │ ├── TinderLikeTests │ │ ├── Info.plist │ │ └── TinderLikeTests.m │ ├── navigation_style.gif │ └── tinder.gif ├── TinderStoryboard │ ├── .DS_Store │ ├── TinderStoryboard.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── TinderStoryboard.xccheckout │ │ │ └── xcuserdata │ │ │ │ ├── kingsoft_ios.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ │ └── stefan.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcuserdata │ │ │ ├── kingsoft_ios.xcuserdatad │ │ │ └── xcschemes │ │ │ │ ├── TinderStoryboard.xcscheme │ │ │ │ └── xcschememanagement.plist │ │ │ └── stefan.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── TinderStoryboard.xcscheme │ │ │ └── xcschememanagement.plist │ ├── TinderStoryboard │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── ChatController.h │ │ ├── ChatController.m │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── chat.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── rchat.png │ │ │ │ └── rchat@2x.png │ │ │ ├── gear.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── gear.png │ │ │ │ └── gear@2x.png │ │ │ └── profile.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── chat_full.png │ │ │ │ └── chat_full@2x.png │ │ ├── Info.plist │ │ ├── ProfileController.h │ │ ├── ProfileController.m │ │ ├── SettingsController.h │ │ ├── SettingsController.m │ │ └── main.m │ ├── navigation_bar_color.png │ └── segue_params.png └── TwitterLike │ ├── Default-568h@2x.png │ ├── TwitterLike.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── TwitterLike.xccheckout │ │ └── xcuserdata │ │ │ ├── kingsoft_ios.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── stefan.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── kingsoft_ios.xcuserdatad │ │ └── xcschemes │ │ │ ├── TwitterLike.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── stefan.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── TwitterLike.xcscheme │ │ └── xcschememanagement.plist │ ├── TwitterLike │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Image.imageset │ │ │ └── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── avatar_0.imageset │ │ │ ├── Contents.json │ │ │ └── avatar_twt.jpg │ │ ├── avatar_1.imageset │ │ │ ├── Contents.json │ │ │ └── avatar_shaq.jpg │ │ └── avatar_2.imageset │ │ │ ├── Contents.json │ │ │ └── avatar_hs.jpg │ ├── Info.plist │ ├── TwitterLike-Prefix.pch │ └── main.m │ ├── TwitterLikeTests │ ├── Info.plist │ └── TwitterLikeTests.m │ └── twitter.gif ├── LICENSE ├── README.md ├── SLPagingView.podspec └── SLPagingView ├── .gitignore ├── Categories ├── UIColor+SLAddition.h ├── UIColor+SLAddition.m ├── UIScrollView+UpdateContentSize.h └── UIScrollView+UpdateContentSize.m ├── SLPagingViewController.h ├── SLPagingViewController.m └── ShareResources.h /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | -------------------------------------------------------------------------------- /Demos/TinderLike/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/Default-568h@2x.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F8C7A99A1A731EEE004AF72A /* UIColor+SLAddition.m in Sources */ = {isa = PBXBuildFile; fileRef = F8C7A9971A731EEE004AF72A /* UIColor+SLAddition.m */; }; 11 | F8C7A99B1A731EEE004AF72A /* UIScrollView+UpdateContentSize.m in Sources */ = {isa = PBXBuildFile; fileRef = F8C7A9991A731EEE004AF72A /* UIScrollView+UpdateContentSize.m */; }; 12 | F8E86B881A24BBA700E15006 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E86B871A24BBA700E15006 /* main.m */; }; 13 | F8E86B8B1A24BBA700E15006 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E86B8A1A24BBA700E15006 /* AppDelegate.m */; }; 14 | F8E86B931A24BBA700E15006 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F8E86B921A24BBA700E15006 /* Images.xcassets */; }; 15 | F8E86BA21A24BBA700E15006 /* TinderLikeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E86BA11A24BBA700E15006 /* TinderLikeTests.m */; }; 16 | F8E86BAD1A24BC5800E15006 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F8E86BAC1A24BC5800E15006 /* Default-568h@2x.png */; }; 17 | F8E86BB11A24BCA300E15006 /* SLPagingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E86BB01A24BCA300E15006 /* SLPagingViewController.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | F8E86B9C1A24BBA700E15006 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = F8E86B7A1A24BBA700E15006 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = F8E86B811A24BBA700E15006; 26 | remoteInfo = TinderLike; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | F8C7A9951A731EE1004AF72A /* ShareResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShareResources.h; path = ../../SLPagingView/ShareResources.h; sourceTree = ""; }; 32 | F8C7A9961A731EEE004AF72A /* UIColor+SLAddition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+SLAddition.h"; path = "../../SLPagingView/Categories/UIColor+SLAddition.h"; sourceTree = ""; }; 33 | F8C7A9971A731EEE004AF72A /* UIColor+SLAddition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+SLAddition.m"; path = "../../SLPagingView/Categories/UIColor+SLAddition.m"; sourceTree = ""; }; 34 | F8C7A9981A731EEE004AF72A /* UIScrollView+UpdateContentSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+UpdateContentSize.h"; path = "../../SLPagingView/Categories/UIScrollView+UpdateContentSize.h"; sourceTree = ""; }; 35 | F8C7A9991A731EEE004AF72A /* UIScrollView+UpdateContentSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+UpdateContentSize.m"; path = "../../SLPagingView/Categories/UIScrollView+UpdateContentSize.m"; sourceTree = ""; }; 36 | F8E86B821A24BBA700E15006 /* TinderLike.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TinderLike.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | F8E86B861A24BBA700E15006 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | F8E86B871A24BBA700E15006 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | F8E86B891A24BBA700E15006 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | F8E86B8A1A24BBA700E15006 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | F8E86B921A24BBA700E15006 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 42 | F8E86B9B1A24BBA700E15006 /* TinderLikeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TinderLikeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | F8E86BA01A24BBA700E15006 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | F8E86BA11A24BBA700E15006 /* TinderLikeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TinderLikeTests.m; sourceTree = ""; }; 45 | F8E86BAB1A24BBE500E15006 /* TinderLike-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TinderLike-Prefix.pch"; sourceTree = ""; }; 46 | F8E86BAC1A24BC5800E15006 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; 47 | F8E86BAF1A24BCA300E15006 /* SLPagingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SLPagingViewController.h; path = ../../SLPagingView/SLPagingViewController.h; sourceTree = ""; }; 48 | F8E86BB01A24BCA300E15006 /* SLPagingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SLPagingViewController.m; path = ../../SLPagingView/SLPagingViewController.m; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | F8E86B7F1A24BBA700E15006 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | F8E86B981A24BBA700E15006 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | F8E86B791A24BBA700E15006 = { 70 | isa = PBXGroup; 71 | children = ( 72 | F8E86BAE1A24BC8C00E15006 /* SLPagingView */, 73 | F8E86B841A24BBA700E15006 /* TinderLike */, 74 | F8E86B9E1A24BBA700E15006 /* TinderLikeTests */, 75 | F8E86B831A24BBA700E15006 /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | F8E86B831A24BBA700E15006 /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | F8E86B821A24BBA700E15006 /* TinderLike.app */, 83 | F8E86B9B1A24BBA700E15006 /* TinderLikeTests.xctest */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | F8E86B841A24BBA700E15006 /* TinderLike */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | F8E86B891A24BBA700E15006 /* AppDelegate.h */, 92 | F8E86B8A1A24BBA700E15006 /* AppDelegate.m */, 93 | F8E86B921A24BBA700E15006 /* Images.xcassets */, 94 | F8E86B851A24BBA700E15006 /* Supporting Files */, 95 | ); 96 | path = TinderLike; 97 | sourceTree = ""; 98 | }; 99 | F8E86B851A24BBA700E15006 /* Supporting Files */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | F8E86BAC1A24BC5800E15006 /* Default-568h@2x.png */, 103 | F8E86B861A24BBA700E15006 /* Info.plist */, 104 | F8E86B871A24BBA700E15006 /* main.m */, 105 | F8E86BAB1A24BBE500E15006 /* TinderLike-Prefix.pch */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | F8E86B9E1A24BBA700E15006 /* TinderLikeTests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | F8E86BA11A24BBA700E15006 /* TinderLikeTests.m */, 114 | F8E86B9F1A24BBA700E15006 /* Supporting Files */, 115 | ); 116 | path = TinderLikeTests; 117 | sourceTree = ""; 118 | }; 119 | F8E86B9F1A24BBA700E15006 /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | F8E86BA01A24BBA700E15006 /* Info.plist */, 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | F8E86BAE1A24BC8C00E15006 /* SLPagingView */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | F8C7A9961A731EEE004AF72A /* UIColor+SLAddition.h */, 131 | F8C7A9971A731EEE004AF72A /* UIColor+SLAddition.m */, 132 | F8C7A9981A731EEE004AF72A /* UIScrollView+UpdateContentSize.h */, 133 | F8C7A9991A731EEE004AF72A /* UIScrollView+UpdateContentSize.m */, 134 | F8C7A9951A731EE1004AF72A /* ShareResources.h */, 135 | F8E86BAF1A24BCA300E15006 /* SLPagingViewController.h */, 136 | F8E86BB01A24BCA300E15006 /* SLPagingViewController.m */, 137 | ); 138 | name = SLPagingView; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | F8E86B811A24BBA700E15006 /* TinderLike */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = F8E86BA51A24BBA700E15006 /* Build configuration list for PBXNativeTarget "TinderLike" */; 147 | buildPhases = ( 148 | F8E86B7E1A24BBA700E15006 /* Sources */, 149 | F8E86B7F1A24BBA700E15006 /* Frameworks */, 150 | F8E86B801A24BBA700E15006 /* Resources */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = TinderLike; 157 | productName = TinderLike; 158 | productReference = F8E86B821A24BBA700E15006 /* TinderLike.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | F8E86B9A1A24BBA700E15006 /* TinderLikeTests */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = F8E86BA81A24BBA700E15006 /* Build configuration list for PBXNativeTarget "TinderLikeTests" */; 164 | buildPhases = ( 165 | F8E86B971A24BBA700E15006 /* Sources */, 166 | F8E86B981A24BBA700E15006 /* Frameworks */, 167 | F8E86B991A24BBA700E15006 /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | F8E86B9D1A24BBA700E15006 /* PBXTargetDependency */, 173 | ); 174 | name = TinderLikeTests; 175 | productName = TinderLikeTests; 176 | productReference = F8E86B9B1A24BBA700E15006 /* TinderLikeTests.xctest */; 177 | productType = "com.apple.product-type.bundle.unit-test"; 178 | }; 179 | /* End PBXNativeTarget section */ 180 | 181 | /* Begin PBXProject section */ 182 | F8E86B7A1A24BBA700E15006 /* Project object */ = { 183 | isa = PBXProject; 184 | attributes = { 185 | LastUpgradeCheck = 0610; 186 | ORGANIZATIONNAME = "Stefan Lage"; 187 | TargetAttributes = { 188 | F8E86B811A24BBA700E15006 = { 189 | CreatedOnToolsVersion = 6.1; 190 | }; 191 | F8E86B9A1A24BBA700E15006 = { 192 | CreatedOnToolsVersion = 6.1; 193 | TestTargetID = F8E86B811A24BBA700E15006; 194 | }; 195 | }; 196 | }; 197 | buildConfigurationList = F8E86B7D1A24BBA700E15006 /* Build configuration list for PBXProject "TinderLike" */; 198 | compatibilityVersion = "Xcode 3.2"; 199 | developmentRegion = English; 200 | hasScannedForEncodings = 0; 201 | knownRegions = ( 202 | en, 203 | Base, 204 | ); 205 | mainGroup = F8E86B791A24BBA700E15006; 206 | productRefGroup = F8E86B831A24BBA700E15006 /* Products */; 207 | projectDirPath = ""; 208 | projectRoot = ""; 209 | targets = ( 210 | F8E86B811A24BBA700E15006 /* TinderLike */, 211 | F8E86B9A1A24BBA700E15006 /* TinderLikeTests */, 212 | ); 213 | }; 214 | /* End PBXProject section */ 215 | 216 | /* Begin PBXResourcesBuildPhase section */ 217 | F8E86B801A24BBA700E15006 /* Resources */ = { 218 | isa = PBXResourcesBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | F8E86B931A24BBA700E15006 /* Images.xcassets in Resources */, 222 | F8E86BAD1A24BC5800E15006 /* Default-568h@2x.png in Resources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | F8E86B991A24BBA700E15006 /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXResourcesBuildPhase section */ 234 | 235 | /* Begin PBXSourcesBuildPhase section */ 236 | F8E86B7E1A24BBA700E15006 /* Sources */ = { 237 | isa = PBXSourcesBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | F8E86B8B1A24BBA700E15006 /* AppDelegate.m in Sources */, 241 | F8C7A99B1A731EEE004AF72A /* UIScrollView+UpdateContentSize.m in Sources */, 242 | F8E86B881A24BBA700E15006 /* main.m in Sources */, 243 | F8C7A99A1A731EEE004AF72A /* UIColor+SLAddition.m in Sources */, 244 | F8E86BB11A24BCA300E15006 /* SLPagingViewController.m in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | F8E86B971A24BBA700E15006 /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | F8E86BA21A24BBA700E15006 /* TinderLikeTests.m in Sources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXSourcesBuildPhase section */ 257 | 258 | /* Begin PBXTargetDependency section */ 259 | F8E86B9D1A24BBA700E15006 /* PBXTargetDependency */ = { 260 | isa = PBXTargetDependency; 261 | target = F8E86B811A24BBA700E15006 /* TinderLike */; 262 | targetProxy = F8E86B9C1A24BBA700E15006 /* PBXContainerItemProxy */; 263 | }; 264 | /* End PBXTargetDependency section */ 265 | 266 | /* Begin XCBuildConfiguration section */ 267 | F8E86BA31A24BBA700E15006 /* Debug */ = { 268 | isa = XCBuildConfiguration; 269 | buildSettings = { 270 | ALWAYS_SEARCH_USER_PATHS = NO; 271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 272 | CLANG_CXX_LIBRARY = "libc++"; 273 | CLANG_ENABLE_MODULES = YES; 274 | CLANG_ENABLE_OBJC_ARC = YES; 275 | CLANG_WARN_BOOL_CONVERSION = YES; 276 | CLANG_WARN_CONSTANT_CONVERSION = YES; 277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 278 | CLANG_WARN_EMPTY_BODY = YES; 279 | CLANG_WARN_ENUM_CONVERSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_UNREACHABLE_CODE = YES; 283 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 284 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 285 | COPY_PHASE_STRIP = NO; 286 | ENABLE_STRICT_OBJC_MSGSEND = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_DYNAMIC_NO_PIC = NO; 289 | GCC_OPTIMIZATION_LEVEL = 0; 290 | GCC_PREPROCESSOR_DEFINITIONS = ( 291 | "DEBUG=1", 292 | "$(inherited)", 293 | ); 294 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 295 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 296 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 297 | GCC_WARN_UNDECLARED_SELECTOR = YES; 298 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 299 | GCC_WARN_UNUSED_FUNCTION = YES; 300 | GCC_WARN_UNUSED_VARIABLE = YES; 301 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 302 | MTL_ENABLE_DEBUG_INFO = YES; 303 | ONLY_ACTIVE_ARCH = YES; 304 | SDKROOT = iphoneos; 305 | }; 306 | name = Debug; 307 | }; 308 | F8E86BA41A24BBA700E15006 /* Release */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_MODULES = YES; 315 | CLANG_ENABLE_OBJC_ARC = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INT_CONVERSION = YES; 322 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 323 | CLANG_WARN_UNREACHABLE_CODE = YES; 324 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 325 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 326 | COPY_PHASE_STRIP = YES; 327 | ENABLE_NS_ASSERTIONS = NO; 328 | ENABLE_STRICT_OBJC_MSGSEND = YES; 329 | GCC_C_LANGUAGE_STANDARD = gnu99; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 337 | MTL_ENABLE_DEBUG_INFO = NO; 338 | SDKROOT = iphoneos; 339 | VALIDATE_PRODUCT = YES; 340 | }; 341 | name = Release; 342 | }; 343 | F8E86BA61A24BBA700E15006 /* Debug */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 347 | GCC_PREFIX_HEADER = "$SRCROOT/$PROJECT_NAME/TinderLike-Prefix.pch"; 348 | INFOPLIST_FILE = TinderLike/Info.plist; 349 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 350 | PRODUCT_NAME = "$(TARGET_NAME)"; 351 | }; 352 | name = Debug; 353 | }; 354 | F8E86BA71A24BBA700E15006 /* Release */ = { 355 | isa = XCBuildConfiguration; 356 | buildSettings = { 357 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 358 | GCC_PREFIX_HEADER = "$SRCROOT/$PROJECT_NAME/TinderLike-Prefix.pch"; 359 | INFOPLIST_FILE = TinderLike/Info.plist; 360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 361 | PRODUCT_NAME = "$(TARGET_NAME)"; 362 | }; 363 | name = Release; 364 | }; 365 | F8E86BA91A24BBA700E15006 /* Debug */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | BUNDLE_LOADER = "$(TEST_HOST)"; 369 | FRAMEWORK_SEARCH_PATHS = ( 370 | "$(SDKROOT)/Developer/Library/Frameworks", 371 | "$(inherited)", 372 | ); 373 | GCC_PREPROCESSOR_DEFINITIONS = ( 374 | "DEBUG=1", 375 | "$(inherited)", 376 | ); 377 | INFOPLIST_FILE = TinderLikeTests/Info.plist; 378 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 379 | PRODUCT_NAME = "$(TARGET_NAME)"; 380 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TinderLike.app/TinderLike"; 381 | }; 382 | name = Debug; 383 | }; 384 | F8E86BAA1A24BBA700E15006 /* Release */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | BUNDLE_LOADER = "$(TEST_HOST)"; 388 | FRAMEWORK_SEARCH_PATHS = ( 389 | "$(SDKROOT)/Developer/Library/Frameworks", 390 | "$(inherited)", 391 | ); 392 | INFOPLIST_FILE = TinderLikeTests/Info.plist; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TinderLike.app/TinderLike"; 396 | }; 397 | name = Release; 398 | }; 399 | /* End XCBuildConfiguration section */ 400 | 401 | /* Begin XCConfigurationList section */ 402 | F8E86B7D1A24BBA700E15006 /* Build configuration list for PBXProject "TinderLike" */ = { 403 | isa = XCConfigurationList; 404 | buildConfigurations = ( 405 | F8E86BA31A24BBA700E15006 /* Debug */, 406 | F8E86BA41A24BBA700E15006 /* Release */, 407 | ); 408 | defaultConfigurationIsVisible = 0; 409 | defaultConfigurationName = Release; 410 | }; 411 | F8E86BA51A24BBA700E15006 /* Build configuration list for PBXNativeTarget "TinderLike" */ = { 412 | isa = XCConfigurationList; 413 | buildConfigurations = ( 414 | F8E86BA61A24BBA700E15006 /* Debug */, 415 | F8E86BA71A24BBA700E15006 /* Release */, 416 | ); 417 | defaultConfigurationIsVisible = 0; 418 | defaultConfigurationName = Release; 419 | }; 420 | F8E86BA81A24BBA700E15006 /* Build configuration list for PBXNativeTarget "TinderLikeTests" */ = { 421 | isa = XCConfigurationList; 422 | buildConfigurations = ( 423 | F8E86BA91A24BBA700E15006 /* Debug */, 424 | F8E86BAA1A24BBA700E15006 /* Release */, 425 | ); 426 | defaultConfigurationIsVisible = 0; 427 | defaultConfigurationName = Release; 428 | }; 429 | /* End XCConfigurationList section */ 430 | }; 431 | rootObject = F8E86B7A1A24BBA700E15006 /* Project object */; 432 | } 433 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/project.xcworkspace/xcshareddata/TinderLike.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | E592ED92-7087-4BB1-8C88-F7B92B104779 9 | IDESourceControlProjectName 10 | TinderLike 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 14 | github.com:StefanLage/SLPagingView.git 15 | 16 | IDESourceControlProjectPath 17 | Demos/TinderLike/TinderLike.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:StefanLage/SLPagingView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 36 | IDESourceControlWCCName 37 | SLPagingView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/project.xcworkspace/xcuserdata/kingsoft_ios.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike.xcodeproj/project.xcworkspace/xcuserdata/kingsoft_ios.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/xcuserdata/kingsoft_ios.xcuserdatad/xcschemes/TinderLike.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/xcuserdata/kingsoft_ios.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TinderLike.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F8E86B811A24BBA700E15006 16 | 17 | primary 18 | 19 | 20 | F8E86B9A1A24BBA700E15006 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/xcuserdata/stefan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/xcuserdata/stefan.xcuserdatad/xcschemes/TinderLike.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike.xcodeproj/xcuserdata/stefan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TinderLike.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F8E86B811A24BBA700E15006 16 | 17 | primary 18 | 19 | 20 | F8E86B9A1A24BBA700E15006 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TinderLike 4 | // 5 | // Created by Stefan Lage on 25/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TinderLike 4 | // 5 | // Created by Stefan Lage on 25/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "SLPagingViewController.h" 11 | #import "UIColor+SLAddition.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @property (strong, nonatomic) UINavigationController *nav; 16 | 17 | @end 18 | 19 | @implementation AppDelegate 20 | 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 23 | // Override point for customization after application launch. 24 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 25 | 26 | UIColor *orange = [UIColor colorWithRed:255/255 27 | green:69.0/255 28 | blue:0.0/255 29 | alpha:1.0]; 30 | 31 | UIColor *gray = [UIColor colorWithRed:.84 32 | green:.84 33 | blue:.84 34 | alpha:1.0]; 35 | 36 | // Make views for the navigation bar 37 | UIImage *img1 = [UIImage imageNamed:@"gear"]; 38 | img1 = [img1 imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 39 | 40 | UIImage *img2 = [UIImage imageNamed:@"profile"]; 41 | img2 = [img2 imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 42 | 43 | UIImage *img3 = [UIImage imageNamed:@"chat"]; 44 | img3 = [img3 imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 45 | 46 | SLPagingViewController *pageViewController = [[SLPagingViewController alloc] initWithNavBarItems:@[[[UIImageView alloc] initWithImage:img1], [[UIImageView alloc] initWithImage:img2], [[UIImageView alloc] initWithImage:img3]] 47 | navBarBackground:[UIColor whiteColor] 48 | views:@[[self viewWithBackground:orange], [self viewWithBackground:[UIColor yellowColor]], [self viewWithBackground:gray]] 49 | showPageControl:NO]; 50 | pageViewController.navigationSideItemsStyle = SLNavigationSideItemsStyleOnBounds; 51 | float minX = 45.0; 52 | // Tinder Like 53 | pageViewController.pagingViewMoving = ^(NSArray *subviews){ 54 | float mid = [UIScreen mainScreen].bounds.size.width/2 - minX; 55 | float midM = [UIScreen mainScreen].bounds.size.width - minX; 56 | for(UIImageView *v in subviews){ 57 | UIColor *c = gray; 58 | if(v.frame.origin.x > minX 59 | && v.frame.origin.x < mid) 60 | // Left part 61 | c = [UIColor gradient:v.frame.origin.x 62 | top:minX+1 63 | bottom:mid-1 64 | init:orange 65 | goal:gray]; 66 | else if(v.frame.origin.x > mid 67 | && v.frame.origin.x < midM) 68 | // Right part 69 | c = [UIColor gradient:v.frame.origin.x 70 | top:mid+1 71 | bottom:midM-1 72 | init:gray 73 | goal:orange]; 74 | else if(v.frame.origin.x == mid) 75 | c = orange; 76 | v.tintColor= c; 77 | } 78 | }; 79 | 80 | self.nav = [[UINavigationController alloc] initWithRootViewController:pageViewController]; 81 | [self.window setRootViewController:self.nav]; 82 | self.window.backgroundColor = [UIColor whiteColor]; 83 | [self.window makeKeyAndVisible]; 84 | 85 | [self setWindow:self.window]; 86 | return YES; 87 | } 88 | 89 | 90 | -(UIView*)viewWithBackground:(UIColor *)color{ 91 | UIView *v = [UIView new]; 92 | v.backgroundColor = color; 93 | return v; 94 | } 95 | 96 | - (void)applicationWillResignActive:(UIApplication *)application { 97 | // 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. 98 | // 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. 99 | } 100 | 101 | - (void)applicationDidEnterBackground:(UIApplication *)application { 102 | // 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. 103 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 104 | } 105 | 106 | - (void)applicationWillEnterForeground:(UIApplication *)application { 107 | // 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. 108 | } 109 | 110 | - (void)applicationDidBecomeActive:(UIApplication *)application { 111 | // 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. 112 | } 113 | 114 | - (void)applicationWillTerminate:(UIApplication *)application { 115 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/chat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "rchat.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "rchat@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/chat.imageset/rchat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike/Images.xcassets/chat.imageset/rchat.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/chat.imageset/rchat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike/Images.xcassets/chat.imageset/rchat@2x.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/gear.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "gear.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "gear@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/gear.imageset/gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike/Images.xcassets/gear.imageset/gear.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/gear.imageset/gear@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike/Images.xcassets/gear.imageset/gear@2x.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/profile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chat_full.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chat_full@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/profile.imageset/chat_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike/Images.xcassets/profile.imageset/chat_full.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Images.xcassets/profile.imageset/chat_full@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/TinderLike/Images.xcassets/profile.imageset/chat_full@2x.png -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | SL.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/TinderLike-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // TinderLike-Prefix.pch 3 | // TinderLike 4 | // 5 | // Created by Stefan Lage on 25/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef __IPHONE_3_0 12 | #warning "This project uses features only available in iOS SDK 3.0 and later." 13 | #endif 14 | 15 | #ifdef __OBJC__ 16 | #import 17 | #import 18 | #endif -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLike/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TinderLike 4 | // 5 | // Created by Stefan Lage on 25/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLikeTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | SL.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Demos/TinderLike/TinderLikeTests/TinderLikeTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TinderLikeTests.m 3 | // TinderLikeTests 4 | // 5 | // Created by Stefan Lage on 25/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface TinderLikeTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation TinderLikeTests 17 | 18 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demos/TinderLike/navigation_style.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/navigation_style.gif -------------------------------------------------------------------------------- /Demos/TinderLike/tinder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderLike/tinder.gif -------------------------------------------------------------------------------- /Demos/TinderStoryboard/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/.DS_Store -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F8C7A9931A731DA5004AF72A /* UIColor+SLAddition.m in Sources */ = {isa = PBXBuildFile; fileRef = F8C7A9901A731DA5004AF72A /* UIColor+SLAddition.m */; }; 11 | F8C7A9941A731DA5004AF72A /* UIScrollView+UpdateContentSize.m in Sources */ = {isa = PBXBuildFile; fileRef = F8C7A9921A731DA5004AF72A /* UIScrollView+UpdateContentSize.m */; }; 12 | F8E1581F1A63DD6100AA1A2E /* SLPagingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E1581E1A63DD6100AA1A2E /* SLPagingViewController.m */; }; 13 | F8E1582D1A64373600AA1A2E /* ChatController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E158281A64373600AA1A2E /* ChatController.m */; }; 14 | F8E1582E1A64373600AA1A2E /* ProfileController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E1582A1A64373600AA1A2E /* ProfileController.m */; }; 15 | F8E1582F1A64373600AA1A2E /* SettingsController.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E1582C1A64373600AA1A2E /* SettingsController.m */; }; 16 | F8E158331A64374D00AA1A2E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E158311A64374D00AA1A2E /* AppDelegate.m */; }; 17 | F8E158341A64374D00AA1A2E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F8E158321A64374D00AA1A2E /* Images.xcassets */; }; 18 | F8E158371A64378000AA1A2E /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F8E158351A64378000AA1A2E /* Info.plist */; }; 19 | F8E158381A64378000AA1A2E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F8E158361A64378000AA1A2E /* main.m */; }; 20 | F8E1583D1A64379200AA1A2E /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8E158391A64379200AA1A2E /* LaunchScreen.xib */; }; 21 | F8E1583E1A64379200AA1A2E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8E1583B1A64379200AA1A2E /* Main.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | F8C7A98E1A731D9D004AF72A /* ShareResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShareResources.h; path = ../../SLPagingView/ShareResources.h; sourceTree = ""; }; 26 | F8C7A98F1A731DA5004AF72A /* UIColor+SLAddition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+SLAddition.h"; path = "../../SLPagingView/Categories/UIColor+SLAddition.h"; sourceTree = ""; }; 27 | F8C7A9901A731DA5004AF72A /* UIColor+SLAddition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+SLAddition.m"; path = "../../SLPagingView/Categories/UIColor+SLAddition.m"; sourceTree = ""; }; 28 | F8C7A9911A731DA5004AF72A /* UIScrollView+UpdateContentSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+UpdateContentSize.h"; path = "../../SLPagingView/Categories/UIScrollView+UpdateContentSize.h"; sourceTree = ""; }; 29 | F8C7A9921A731DA5004AF72A /* UIScrollView+UpdateContentSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+UpdateContentSize.m"; path = "../../SLPagingView/Categories/UIScrollView+UpdateContentSize.m"; sourceTree = ""; }; 30 | F8E157F31A63DD3C00AA1A2E /* TinderStoryboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TinderStoryboard.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | F8E1581D1A63DD6100AA1A2E /* SLPagingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SLPagingViewController.h; path = ../../SLPagingView/SLPagingViewController.h; sourceTree = ""; }; 32 | F8E1581E1A63DD6100AA1A2E /* SLPagingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SLPagingViewController.m; path = ../../SLPagingView/SLPagingViewController.m; sourceTree = ""; }; 33 | F8E158271A64373600AA1A2E /* ChatController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ChatController.h; path = TinderStoryboard/ChatController.h; sourceTree = SOURCE_ROOT; }; 34 | F8E158281A64373600AA1A2E /* ChatController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ChatController.m; path = TinderStoryboard/ChatController.m; sourceTree = SOURCE_ROOT; }; 35 | F8E158291A64373600AA1A2E /* ProfileController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileController.h; path = TinderStoryboard/ProfileController.h; sourceTree = SOURCE_ROOT; }; 36 | F8E1582A1A64373600AA1A2E /* ProfileController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProfileController.m; path = TinderStoryboard/ProfileController.m; sourceTree = SOURCE_ROOT; }; 37 | F8E1582B1A64373600AA1A2E /* SettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SettingsController.h; path = TinderStoryboard/SettingsController.h; sourceTree = SOURCE_ROOT; }; 38 | F8E1582C1A64373600AA1A2E /* SettingsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SettingsController.m; path = TinderStoryboard/SettingsController.m; sourceTree = SOURCE_ROOT; }; 39 | F8E158301A64374D00AA1A2E /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = TinderStoryboard/AppDelegate.h; sourceTree = SOURCE_ROOT; }; 40 | F8E158311A64374D00AA1A2E /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = TinderStoryboard/AppDelegate.m; sourceTree = SOURCE_ROOT; }; 41 | F8E158321A64374D00AA1A2E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = TinderStoryboard/Images.xcassets; sourceTree = SOURCE_ROOT; }; 42 | F8E158351A64378000AA1A2E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = TinderStoryboard/Info.plist; sourceTree = SOURCE_ROOT; }; 43 | F8E158361A64378000AA1A2E /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = TinderStoryboard/main.m; sourceTree = SOURCE_ROOT; }; 44 | F8E1583A1A64379200AA1A2E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = TinderStoryboard/Base.lproj/LaunchScreen.xib; sourceTree = SOURCE_ROOT; }; 45 | F8E1583C1A64379200AA1A2E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = TinderStoryboard/Base.lproj/Main.storyboard; sourceTree = SOURCE_ROOT; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | F8E157F01A63DD3C00AA1A2E /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | F8E157EA1A63DD3C00AA1A2E = { 60 | isa = PBXGroup; 61 | children = ( 62 | F8E1581C1A63DD5000AA1A2E /* SLPagingView */, 63 | F8E157F51A63DD3C00AA1A2E /* TinderStoryboard */, 64 | F8E157F41A63DD3C00AA1A2E /* Products */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | F8E157F41A63DD3C00AA1A2E /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | F8E157F31A63DD3C00AA1A2E /* TinderStoryboard.app */, 72 | ); 73 | name = Products; 74 | sourceTree = ""; 75 | }; 76 | F8E157F51A63DD3C00AA1A2E /* TinderStoryboard */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | F8E158391A64379200AA1A2E /* LaunchScreen.xib */, 80 | F8E1583B1A64379200AA1A2E /* Main.storyboard */, 81 | F8E158301A64374D00AA1A2E /* AppDelegate.h */, 82 | F8E158311A64374D00AA1A2E /* AppDelegate.m */, 83 | F8E158321A64374D00AA1A2E /* Images.xcassets */, 84 | F8E158231A64337C00AA1A2E /* Controllers */, 85 | F8E157F61A63DD3C00AA1A2E /* Supporting Files */, 86 | ); 87 | path = TinderStoryboard; 88 | sourceTree = ""; 89 | }; 90 | F8E157F61A63DD3C00AA1A2E /* Supporting Files */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | F8E158351A64378000AA1A2E /* Info.plist */, 94 | F8E158361A64378000AA1A2E /* main.m */, 95 | ); 96 | name = "Supporting Files"; 97 | sourceTree = ""; 98 | }; 99 | F8E1581C1A63DD5000AA1A2E /* SLPagingView */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | F8C7A98F1A731DA5004AF72A /* UIColor+SLAddition.h */, 103 | F8C7A9901A731DA5004AF72A /* UIColor+SLAddition.m */, 104 | F8C7A9911A731DA5004AF72A /* UIScrollView+UpdateContentSize.h */, 105 | F8C7A9921A731DA5004AF72A /* UIScrollView+UpdateContentSize.m */, 106 | F8C7A98E1A731D9D004AF72A /* ShareResources.h */, 107 | F8E1581D1A63DD6100AA1A2E /* SLPagingViewController.h */, 108 | F8E1581E1A63DD6100AA1A2E /* SLPagingViewController.m */, 109 | ); 110 | name = SLPagingView; 111 | sourceTree = ""; 112 | }; 113 | F8E158231A64337C00AA1A2E /* Controllers */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | F8E158271A64373600AA1A2E /* ChatController.h */, 117 | F8E158281A64373600AA1A2E /* ChatController.m */, 118 | F8E158291A64373600AA1A2E /* ProfileController.h */, 119 | F8E1582A1A64373600AA1A2E /* ProfileController.m */, 120 | F8E1582B1A64373600AA1A2E /* SettingsController.h */, 121 | F8E1582C1A64373600AA1A2E /* SettingsController.m */, 122 | ); 123 | name = Controllers; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | F8E157F21A63DD3C00AA1A2E /* TinderStoryboard */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = F8E158161A63DD3D00AA1A2E /* Build configuration list for PBXNativeTarget "TinderStoryboard" */; 132 | buildPhases = ( 133 | F8E157EF1A63DD3C00AA1A2E /* Sources */, 134 | F8E157F01A63DD3C00AA1A2E /* Frameworks */, 135 | F8E157F11A63DD3C00AA1A2E /* Resources */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = TinderStoryboard; 142 | productName = TinderStoryboard; 143 | productReference = F8E157F31A63DD3C00AA1A2E /* TinderStoryboard.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | F8E157EB1A63DD3C00AA1A2E /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0610; 153 | ORGANIZATIONNAME = "Stefan Lage"; 154 | TargetAttributes = { 155 | F8E157F21A63DD3C00AA1A2E = { 156 | CreatedOnToolsVersion = 6.1.1; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = F8E157EE1A63DD3C00AA1A2E /* Build configuration list for PBXProject "TinderStoryboard" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = English; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = F8E157EA1A63DD3C00AA1A2E; 169 | productRefGroup = F8E157F41A63DD3C00AA1A2E /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | F8E157F21A63DD3C00AA1A2E /* TinderStoryboard */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | F8E157F11A63DD3C00AA1A2E /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | F8E158371A64378000AA1A2E /* Info.plist in Resources */, 184 | F8E1583D1A64379200AA1A2E /* LaunchScreen.xib in Resources */, 185 | F8E158341A64374D00AA1A2E /* Images.xcassets in Resources */, 186 | F8E1583E1A64379200AA1A2E /* Main.storyboard in Resources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXResourcesBuildPhase section */ 191 | 192 | /* Begin PBXSourcesBuildPhase section */ 193 | F8E157EF1A63DD3C00AA1A2E /* Sources */ = { 194 | isa = PBXSourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | F8E1582F1A64373600AA1A2E /* SettingsController.m in Sources */, 198 | F8E1582E1A64373600AA1A2E /* ProfileController.m in Sources */, 199 | F8E1582D1A64373600AA1A2E /* ChatController.m in Sources */, 200 | F8E1581F1A63DD6100AA1A2E /* SLPagingViewController.m in Sources */, 201 | F8E158381A64378000AA1A2E /* main.m in Sources */, 202 | F8E158331A64374D00AA1A2E /* AppDelegate.m in Sources */, 203 | F8C7A9941A731DA5004AF72A /* UIScrollView+UpdateContentSize.m in Sources */, 204 | F8C7A9931A731DA5004AF72A /* UIColor+SLAddition.m in Sources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | /* End PBXSourcesBuildPhase section */ 209 | 210 | /* Begin PBXVariantGroup section */ 211 | F8E158391A64379200AA1A2E /* LaunchScreen.xib */ = { 212 | isa = PBXVariantGroup; 213 | children = ( 214 | F8E1583A1A64379200AA1A2E /* Base */, 215 | ); 216 | name = LaunchScreen.xib; 217 | sourceTree = ""; 218 | }; 219 | F8E1583B1A64379200AA1A2E /* Main.storyboard */ = { 220 | isa = PBXVariantGroup; 221 | children = ( 222 | F8E1583C1A64379200AA1A2E /* Base */, 223 | ); 224 | name = Main.storyboard; 225 | sourceTree = ""; 226 | }; 227 | /* End PBXVariantGroup section */ 228 | 229 | /* Begin XCBuildConfiguration section */ 230 | F8E158141A63DD3D00AA1A2E /* Debug */ = { 231 | isa = XCBuildConfiguration; 232 | buildSettings = { 233 | ALWAYS_SEARCH_USER_PATHS = NO; 234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 235 | CLANG_CXX_LIBRARY = "libc++"; 236 | CLANG_ENABLE_MODULES = YES; 237 | CLANG_ENABLE_OBJC_ARC = YES; 238 | CLANG_WARN_BOOL_CONVERSION = YES; 239 | CLANG_WARN_CONSTANT_CONVERSION = YES; 240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 241 | CLANG_WARN_EMPTY_BODY = YES; 242 | CLANG_WARN_ENUM_CONVERSION = YES; 243 | CLANG_WARN_INT_CONVERSION = YES; 244 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 245 | CLANG_WARN_UNREACHABLE_CODE = YES; 246 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 247 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 248 | COPY_PHASE_STRIP = NO; 249 | ENABLE_STRICT_OBJC_MSGSEND = YES; 250 | GCC_C_LANGUAGE_STANDARD = gnu99; 251 | GCC_DYNAMIC_NO_PIC = NO; 252 | GCC_OPTIMIZATION_LEVEL = 0; 253 | GCC_PREPROCESSOR_DEFINITIONS = ( 254 | "DEBUG=1", 255 | "$(inherited)", 256 | ); 257 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 258 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 259 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 260 | GCC_WARN_UNDECLARED_SELECTOR = YES; 261 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 262 | GCC_WARN_UNUSED_FUNCTION = YES; 263 | GCC_WARN_UNUSED_VARIABLE = YES; 264 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 265 | MTL_ENABLE_DEBUG_INFO = YES; 266 | ONLY_ACTIVE_ARCH = YES; 267 | SDKROOT = iphoneos; 268 | }; 269 | name = Debug; 270 | }; 271 | F8E158151A63DD3D00AA1A2E /* Release */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | ALWAYS_SEARCH_USER_PATHS = NO; 275 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 276 | CLANG_CXX_LIBRARY = "libc++"; 277 | CLANG_ENABLE_MODULES = YES; 278 | CLANG_ENABLE_OBJC_ARC = YES; 279 | CLANG_WARN_BOOL_CONVERSION = YES; 280 | CLANG_WARN_CONSTANT_CONVERSION = YES; 281 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 282 | CLANG_WARN_EMPTY_BODY = YES; 283 | CLANG_WARN_ENUM_CONVERSION = YES; 284 | CLANG_WARN_INT_CONVERSION = YES; 285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 286 | CLANG_WARN_UNREACHABLE_CODE = YES; 287 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 288 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 289 | COPY_PHASE_STRIP = YES; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 294 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 295 | GCC_WARN_UNDECLARED_SELECTOR = YES; 296 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 297 | GCC_WARN_UNUSED_FUNCTION = YES; 298 | GCC_WARN_UNUSED_VARIABLE = YES; 299 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 300 | MTL_ENABLE_DEBUG_INFO = NO; 301 | SDKROOT = iphoneos; 302 | VALIDATE_PRODUCT = YES; 303 | }; 304 | name = Release; 305 | }; 306 | F8E158171A63DD3D00AA1A2E /* Debug */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | INFOPLIST_FILE = TinderStoryboard/Info.plist; 311 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 312 | PRODUCT_NAME = TinderStoryboard; 313 | }; 314 | name = Debug; 315 | }; 316 | F8E158181A63DD3D00AA1A2E /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 320 | INFOPLIST_FILE = TinderStoryboard/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | PRODUCT_NAME = TinderStoryboard; 323 | }; 324 | name = Release; 325 | }; 326 | /* End XCBuildConfiguration section */ 327 | 328 | /* Begin XCConfigurationList section */ 329 | F8E157EE1A63DD3C00AA1A2E /* Build configuration list for PBXProject "TinderStoryboard" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | F8E158141A63DD3D00AA1A2E /* Debug */, 333 | F8E158151A63DD3D00AA1A2E /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | F8E158161A63DD3D00AA1A2E /* Build configuration list for PBXNativeTarget "TinderStoryboard" */ = { 339 | isa = XCConfigurationList; 340 | buildConfigurations = ( 341 | F8E158171A63DD3D00AA1A2E /* Debug */, 342 | F8E158181A63DD3D00AA1A2E /* Release */, 343 | ); 344 | defaultConfigurationIsVisible = 0; 345 | defaultConfigurationName = Release; 346 | }; 347 | /* End XCConfigurationList section */ 348 | }; 349 | rootObject = F8E157EB1A63DD3C00AA1A2E /* Project object */; 350 | } 351 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/xcshareddata/TinderStoryboard.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 6266DF21-4635-4111-858C-19ED45B07175 9 | IDESourceControlProjectName 10 | TinderStoryboard 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 14 | https://github.com/StefanLage/SLPagingView.git 15 | 16 | IDESourceControlProjectPath 17 | Demos/TinderStoryboard/TinderStoryboard.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/StefanLage/SLPagingView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 36 | IDESourceControlWCCName 37 | SLPagingView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/xcuserdata/kingsoft_ios.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/xcuserdata/kingsoft_ios.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/xcuserdata/kingsoft_ios.xcuserdatad/xcschemes/TinderStoryboard.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/xcuserdata/kingsoft_ios.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TinderStoryboard.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F8E157F21A63DD3C00AA1A2E 16 | 17 | primary 18 | 19 | 20 | F8E1580B1A63DD3D00AA1A2E 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/xcuserdata/stefan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/xcuserdata/stefan.xcuserdatad/xcschemes/TinderStoryboard.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard.xcodeproj/xcuserdata/stefan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SuppressBuildableAutocreation 6 | 7 | F8E157F21A63DD3C00AA1A2E 8 | 9 | primary 10 | 11 | 12 | F8E1580B1A63DD3D00AA1A2E 13 | 14 | primary 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "SLPagingViewController.h" 11 | #import "UIColor+SLAddition.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | // Override point for customization after application launch. 22 | 23 | UIColor *orange = [UIColor colorWithRed:255/255 24 | green:69.0/255 25 | blue:0.0/255 26 | alpha:1.0]; 27 | 28 | UIColor *gray = [UIColor colorWithRed:.84 29 | green:.84 30 | blue:.84 31 | alpha:1.0]; 32 | 33 | SLPagingViewController *pageViewController = self.window.rootViewController.childViewControllers.firstObject; 34 | pageViewController.navigationSideItemsStyle = SLNavigationSideItemsStyleOnBounds; 35 | [pageViewController setCurrentIndex:1 36 | animated:NO]; 37 | float minX = 45.0; 38 | // Tinder Like 39 | pageViewController.pagingViewMoving = ^(NSArray *subviews){ 40 | float mid = [UIScreen mainScreen].bounds.size.width/2 - minX; 41 | float midM = [UIScreen mainScreen].bounds.size.width - minX; 42 | for(UIImageView *v in subviews){ 43 | UIColor *c = gray; 44 | if(v.frame.origin.x > minX 45 | && v.frame.origin.x < mid) 46 | // Left part 47 | c = [UIColor gradient:v.frame.origin.x 48 | top:minX+1 49 | bottom:mid-1 50 | init:orange 51 | goal:gray]; 52 | else if(v.frame.origin.x > mid 53 | && v.frame.origin.x < midM) 54 | // Right part 55 | c = [UIColor gradient:v.frame.origin.x 56 | top:mid+1 57 | bottom:midM-1 58 | init:gray 59 | goal:orange]; 60 | else if(v.frame.origin.x == mid) 61 | c = orange; 62 | v.tintColor= c; 63 | } 64 | }; 65 | 66 | return YES; 67 | } 68 | 69 | - (void)applicationWillResignActive:(UIApplication *)application { 70 | // 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. 71 | // 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. 72 | } 73 | 74 | - (void)applicationDidEnterBackground:(UIApplication *)application { 75 | // 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. 76 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 77 | } 78 | 79 | - (void)applicationWillEnterForeground:(UIApplication *)application { 80 | // 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. 81 | } 82 | 83 | - (void)applicationDidBecomeActive:(UIApplication *)application { 84 | // 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. 85 | } 86 | 87 | - (void)applicationWillTerminate:(UIApplication *)application { 88 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/ChatController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatController.h 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ChatController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/ChatController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ChatController.m 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "ChatController.h" 10 | 11 | @interface ChatController () 12 | 13 | @property (nonatomic, strong) UIImageView* titleView; 14 | 15 | @end 16 | 17 | @implementation ChatController 18 | 19 | -(id)initWithCoder:(NSCoder *)aDecoder{ 20 | self = [super initWithCoder:aDecoder]; 21 | if(self){ 22 | 23 | UIImage *logo = [UIImage imageNamed:@"chat"]; 24 | logo = [logo imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 25 | _titleView = [[UIImageView alloc] initWithImage:logo]; 26 | self.navigationItem.titleView = _titleView; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | UIImage *logo = [UIImage imageNamed:@"chat"]; 34 | logo = [logo imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 35 | _titleView = [[UIImageView alloc] initWithImage:logo]; 36 | self.navigationItem.titleView = self.titleView; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | } 39 | - (void)didReceiveMemoryWarning { 40 | [super didReceiveMemoryWarning]; 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/chat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "rchat.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "rchat@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/chat.imageset/rchat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/chat.imageset/rchat.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/chat.imageset/rchat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/chat.imageset/rchat@2x.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/gear.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "gear.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "gear@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/gear.imageset/gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/gear.imageset/gear.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/gear.imageset/gear@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/gear.imageset/gear@2x.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/profile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "chat_full.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "chat_full@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/profile.imageset/chat_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/profile.imageset/chat_full.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/profile.imageset/chat_full@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/TinderStoryboard/Images.xcassets/profile.imageset/chat_full@2x.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | SL.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/ProfileController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProfileController.h 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ProfileController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/ProfileController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ProfileController.m 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "ProfileController.h" 10 | 11 | @interface ProfileController () 12 | 13 | @property (nonatomic, strong) UIImageView* titleView; 14 | 15 | @end 16 | 17 | @implementation ProfileController 18 | 19 | -(id)initWithCoder:(NSCoder *)aDecoder{ 20 | self = [super initWithCoder:aDecoder]; 21 | if(self){ 22 | 23 | UIImage *logo = [UIImage imageNamed:@"profile"]; 24 | logo = [logo imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 25 | _titleView = [[UIImageView alloc] initWithImage:logo]; 26 | self.navigationItem.titleView = _titleView; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | UIImage *logo = [UIImage imageNamed:@"profile"]; 34 | logo = [logo imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 35 | _titleView = [[UIImageView alloc] initWithImage:logo]; 36 | self.navigationItem.titleView = self.titleView; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | } 39 | 40 | - (void)didReceiveMemoryWarning { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/SettingsController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsController.h 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SettingsController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/SettingsController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsController.m 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "SettingsController.h" 10 | 11 | @interface SettingsController () 12 | 13 | @property (nonatomic, strong) UIImageView* titleView; 14 | 15 | @end 16 | 17 | @implementation SettingsController 18 | 19 | -(id)initWithCoder:(NSCoder *)aDecoder{ 20 | self = [super initWithCoder:aDecoder]; 21 | if(self){ 22 | 23 | UIImage *logo = [UIImage imageNamed:@"gear"]; 24 | logo = [logo imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 25 | _titleView = [[UIImageView alloc] initWithImage:logo]; 26 | self.navigationItem.titleView = _titleView; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | UIImage *logo = [UIImage imageNamed:@"gear"]; 34 | logo = [logo imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 35 | _titleView = [[UIImageView alloc] initWithImage:logo]; 36 | self.navigationItem.titleView = self.titleView; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | } 39 | 40 | - (void)didReceiveMemoryWarning { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/TinderStoryboard/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 12/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demos/TinderStoryboard/navigation_bar_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/navigation_bar_color.png -------------------------------------------------------------------------------- /Demos/TinderStoryboard/segue_params.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TinderStoryboard/segue_params.png -------------------------------------------------------------------------------- /Demos/TwitterLike/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/Default-568h@2x.png -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F82198631A2373CC00BDF49B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F82198621A2373CC00BDF49B /* main.m */; }; 11 | F82198661A2373CC00BDF49B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F82198651A2373CC00BDF49B /* AppDelegate.m */; }; 12 | F821987D1A2373CC00BDF49B /* TwitterLikeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F821987C1A2373CC00BDF49B /* TwitterLikeTests.m */; }; 13 | F821988A1A23748100BDF49B /* SLPagingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F82198891A23748100BDF49B /* SLPagingViewController.m */; }; 14 | F821988E1A23759600BDF49B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F821988D1A23759600BDF49B /* Default-568h@2x.png */; }; 15 | F82198951A23BC0800BDF49B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F82198941A23BC0800BDF49B /* Images.xcassets */; }; 16 | F8C7A9A11A732015004AF72A /* UIColor+SLAddition.m in Sources */ = {isa = PBXBuildFile; fileRef = F8C7A99E1A732015004AF72A /* UIColor+SLAddition.m */; }; 17 | F8C7A9A21A732015004AF72A /* UIScrollView+UpdateContentSize.m in Sources */ = {isa = PBXBuildFile; fileRef = F8C7A9A01A732015004AF72A /* UIScrollView+UpdateContentSize.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | F82198771A2373CC00BDF49B /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = F82198551A2373CC00BDF49B /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = F821985C1A2373CC00BDF49B; 26 | remoteInfo = TwitterLike; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | F821985D1A2373CC00BDF49B /* TwitterLike.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TwitterLike.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | F82198611A2373CC00BDF49B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | F82198621A2373CC00BDF49B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | F82198641A2373CC00BDF49B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | F82198651A2373CC00BDF49B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | F82198761A2373CC00BDF49B /* TwitterLikeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TwitterLikeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | F821987B1A2373CC00BDF49B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | F821987C1A2373CC00BDF49B /* TwitterLikeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TwitterLikeTests.m; sourceTree = ""; }; 39 | F82198861A23741500BDF49B /* TwitterLike-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TwitterLike-Prefix.pch"; sourceTree = ""; }; 40 | F82198881A23748100BDF49B /* SLPagingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SLPagingViewController.h; path = ../../SLPagingView/SLPagingViewController.h; sourceTree = ""; }; 41 | F82198891A23748100BDF49B /* SLPagingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SLPagingViewController.m; path = ../../SLPagingView/SLPagingViewController.m; sourceTree = ""; }; 42 | F821988D1A23759600BDF49B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; 43 | F82198941A23BC0800BDF49B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 44 | F8C7A99C1A732006004AF72A /* ShareResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShareResources.h; path = ../../SLPagingView/ShareResources.h; sourceTree = ""; }; 45 | F8C7A99D1A732015004AF72A /* UIColor+SLAddition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+SLAddition.h"; path = "../../SLPagingView/Categories/UIColor+SLAddition.h"; sourceTree = ""; }; 46 | F8C7A99E1A732015004AF72A /* UIColor+SLAddition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+SLAddition.m"; path = "../../SLPagingView/Categories/UIColor+SLAddition.m"; sourceTree = ""; }; 47 | F8C7A99F1A732015004AF72A /* UIScrollView+UpdateContentSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIScrollView+UpdateContentSize.h"; path = "../../SLPagingView/Categories/UIScrollView+UpdateContentSize.h"; sourceTree = ""; }; 48 | F8C7A9A01A732015004AF72A /* UIScrollView+UpdateContentSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIScrollView+UpdateContentSize.m"; path = "../../SLPagingView/Categories/UIScrollView+UpdateContentSize.m"; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | F821985A1A2373CC00BDF49B /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | F82198731A2373CC00BDF49B /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | F82198541A2373CC00BDF49B = { 70 | isa = PBXGroup; 71 | children = ( 72 | F82198871A23745800BDF49B /* SLPagingView */, 73 | F821985F1A2373CC00BDF49B /* TwitterLike */, 74 | F82198791A2373CC00BDF49B /* TwitterLikeTests */, 75 | F821985E1A2373CC00BDF49B /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | F821985E1A2373CC00BDF49B /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | F821985D1A2373CC00BDF49B /* TwitterLike.app */, 83 | F82198761A2373CC00BDF49B /* TwitterLikeTests.xctest */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | F821985F1A2373CC00BDF49B /* TwitterLike */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | F82198641A2373CC00BDF49B /* AppDelegate.h */, 92 | F82198651A2373CC00BDF49B /* AppDelegate.m */, 93 | F82198601A2373CC00BDF49B /* Supporting Files */, 94 | ); 95 | path = TwitterLike; 96 | sourceTree = ""; 97 | }; 98 | F82198601A2373CC00BDF49B /* Supporting Files */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | F82198941A23BC0800BDF49B /* Images.xcassets */, 102 | F821988D1A23759600BDF49B /* Default-568h@2x.png */, 103 | F82198611A2373CC00BDF49B /* Info.plist */, 104 | F82198621A2373CC00BDF49B /* main.m */, 105 | F82198861A23741500BDF49B /* TwitterLike-Prefix.pch */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | F82198791A2373CC00BDF49B /* TwitterLikeTests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | F821987C1A2373CC00BDF49B /* TwitterLikeTests.m */, 114 | F821987A1A2373CC00BDF49B /* Supporting Files */, 115 | ); 116 | path = TwitterLikeTests; 117 | sourceTree = ""; 118 | }; 119 | F821987A1A2373CC00BDF49B /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | F821987B1A2373CC00BDF49B /* Info.plist */, 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | F82198871A23745800BDF49B /* SLPagingView */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | F8C7A99D1A732015004AF72A /* UIColor+SLAddition.h */, 131 | F8C7A99E1A732015004AF72A /* UIColor+SLAddition.m */, 132 | F8C7A99F1A732015004AF72A /* UIScrollView+UpdateContentSize.h */, 133 | F8C7A9A01A732015004AF72A /* UIScrollView+UpdateContentSize.m */, 134 | F8C7A99C1A732006004AF72A /* ShareResources.h */, 135 | F82198881A23748100BDF49B /* SLPagingViewController.h */, 136 | F82198891A23748100BDF49B /* SLPagingViewController.m */, 137 | ); 138 | name = SLPagingView; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | F821985C1A2373CC00BDF49B /* TwitterLike */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = F82198801A2373CC00BDF49B /* Build configuration list for PBXNativeTarget "TwitterLike" */; 147 | buildPhases = ( 148 | F82198591A2373CC00BDF49B /* Sources */, 149 | F821985A1A2373CC00BDF49B /* Frameworks */, 150 | F821985B1A2373CC00BDF49B /* Resources */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = TwitterLike; 157 | productName = TwitterLike; 158 | productReference = F821985D1A2373CC00BDF49B /* TwitterLike.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | F82198751A2373CC00BDF49B /* TwitterLikeTests */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = F82198831A2373CC00BDF49B /* Build configuration list for PBXNativeTarget "TwitterLikeTests" */; 164 | buildPhases = ( 165 | F82198721A2373CC00BDF49B /* Sources */, 166 | F82198731A2373CC00BDF49B /* Frameworks */, 167 | F82198741A2373CC00BDF49B /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | F82198781A2373CC00BDF49B /* PBXTargetDependency */, 173 | ); 174 | name = TwitterLikeTests; 175 | productName = TwitterLikeTests; 176 | productReference = F82198761A2373CC00BDF49B /* TwitterLikeTests.xctest */; 177 | productType = "com.apple.product-type.bundle.unit-test"; 178 | }; 179 | /* End PBXNativeTarget section */ 180 | 181 | /* Begin PBXProject section */ 182 | F82198551A2373CC00BDF49B /* Project object */ = { 183 | isa = PBXProject; 184 | attributes = { 185 | LastUpgradeCheck = 0610; 186 | ORGANIZATIONNAME = "Stefan Lage"; 187 | TargetAttributes = { 188 | F821985C1A2373CC00BDF49B = { 189 | CreatedOnToolsVersion = 6.1; 190 | DevelopmentTeam = 9PGSU2Z7CB; 191 | }; 192 | F82198751A2373CC00BDF49B = { 193 | CreatedOnToolsVersion = 6.1; 194 | TestTargetID = F821985C1A2373CC00BDF49B; 195 | }; 196 | }; 197 | }; 198 | buildConfigurationList = F82198581A2373CC00BDF49B /* Build configuration list for PBXProject "TwitterLike" */; 199 | compatibilityVersion = "Xcode 3.2"; 200 | developmentRegion = English; 201 | hasScannedForEncodings = 0; 202 | knownRegions = ( 203 | en, 204 | Base, 205 | ); 206 | mainGroup = F82198541A2373CC00BDF49B; 207 | productRefGroup = F821985E1A2373CC00BDF49B /* Products */; 208 | projectDirPath = ""; 209 | projectRoot = ""; 210 | targets = ( 211 | F821985C1A2373CC00BDF49B /* TwitterLike */, 212 | F82198751A2373CC00BDF49B /* TwitterLikeTests */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | F821985B1A2373CC00BDF49B /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | F821988E1A23759600BDF49B /* Default-568h@2x.png in Resources */, 223 | F82198951A23BC0800BDF49B /* Images.xcassets in Resources */, 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | F82198741A2373CC00BDF49B /* Resources */ = { 228 | isa = PBXResourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXResourcesBuildPhase section */ 235 | 236 | /* Begin PBXSourcesBuildPhase section */ 237 | F82198591A2373CC00BDF49B /* Sources */ = { 238 | isa = PBXSourcesBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | F82198661A2373CC00BDF49B /* AppDelegate.m in Sources */, 242 | F8C7A9A21A732015004AF72A /* UIScrollView+UpdateContentSize.m in Sources */, 243 | F82198631A2373CC00BDF49B /* main.m in Sources */, 244 | F8C7A9A11A732015004AF72A /* UIColor+SLAddition.m in Sources */, 245 | F821988A1A23748100BDF49B /* SLPagingViewController.m in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | F82198721A2373CC00BDF49B /* Sources */ = { 250 | isa = PBXSourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | F821987D1A2373CC00BDF49B /* TwitterLikeTests.m in Sources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | /* End PBXSourcesBuildPhase section */ 258 | 259 | /* Begin PBXTargetDependency section */ 260 | F82198781A2373CC00BDF49B /* PBXTargetDependency */ = { 261 | isa = PBXTargetDependency; 262 | target = F821985C1A2373CC00BDF49B /* TwitterLike */; 263 | targetProxy = F82198771A2373CC00BDF49B /* PBXContainerItemProxy */; 264 | }; 265 | /* End PBXTargetDependency section */ 266 | 267 | /* Begin XCBuildConfiguration section */ 268 | F821987E1A2373CC00BDF49B /* Debug */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ALWAYS_SEARCH_USER_PATHS = NO; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BOOL_CONVERSION = YES; 277 | CLANG_WARN_CONSTANT_CONVERSION = YES; 278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 279 | CLANG_WARN_EMPTY_BODY = YES; 280 | CLANG_WARN_ENUM_CONVERSION = YES; 281 | CLANG_WARN_INT_CONVERSION = YES; 282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_DYNAMIC_NO_PIC = NO; 290 | GCC_OPTIMIZATION_LEVEL = 0; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 303 | MTL_ENABLE_DEBUG_INFO = YES; 304 | ONLY_ACTIVE_ARCH = YES; 305 | SDKROOT = iphoneos; 306 | }; 307 | name = Debug; 308 | }; 309 | F821987F1A2373CC00BDF49B /* Release */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ALWAYS_SEARCH_USER_PATHS = NO; 313 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 314 | CLANG_CXX_LIBRARY = "libc++"; 315 | CLANG_ENABLE_MODULES = YES; 316 | CLANG_ENABLE_OBJC_ARC = YES; 317 | CLANG_WARN_BOOL_CONVERSION = YES; 318 | CLANG_WARN_CONSTANT_CONVERSION = YES; 319 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 320 | CLANG_WARN_EMPTY_BODY = YES; 321 | CLANG_WARN_ENUM_CONVERSION = YES; 322 | CLANG_WARN_INT_CONVERSION = YES; 323 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 324 | CLANG_WARN_UNREACHABLE_CODE = YES; 325 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 326 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 327 | COPY_PHASE_STRIP = YES; 328 | ENABLE_NS_ASSERTIONS = NO; 329 | ENABLE_STRICT_OBJC_MSGSEND = YES; 330 | GCC_C_LANGUAGE_STANDARD = gnu99; 331 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 332 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 333 | GCC_WARN_UNDECLARED_SELECTOR = YES; 334 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 335 | GCC_WARN_UNUSED_FUNCTION = YES; 336 | GCC_WARN_UNUSED_VARIABLE = YES; 337 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 338 | MTL_ENABLE_DEBUG_INFO = NO; 339 | SDKROOT = iphoneos; 340 | VALIDATE_PRODUCT = YES; 341 | }; 342 | name = Release; 343 | }; 344 | F82198811A2373CC00BDF49B /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | CODE_SIGN_IDENTITY = "iPhone Developer"; 348 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 349 | GCC_PREFIX_HEADER = "$SRCROOT/$PROJECT_NAME/TwitterLike-Prefix.pch"; 350 | INFOPLIST_FILE = TwitterLike/Info.plist; 351 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 352 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 353 | PRODUCT_NAME = "$(TARGET_NAME)"; 354 | }; 355 | name = Debug; 356 | }; 357 | F82198821A2373CC00BDF49B /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | CODE_SIGN_IDENTITY = "iPhone Developer"; 361 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 362 | GCC_PREFIX_HEADER = "$SRCROOT/$PROJECT_NAME/TwitterLike-Prefix.pch"; 363 | INFOPLIST_FILE = TwitterLike/Info.plist; 364 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 365 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | }; 368 | name = Release; 369 | }; 370 | F82198841A2373CC00BDF49B /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | BUNDLE_LOADER = "$(TEST_HOST)"; 374 | FRAMEWORK_SEARCH_PATHS = ( 375 | "$(SDKROOT)/Developer/Library/Frameworks", 376 | "$(inherited)", 377 | ); 378 | GCC_PREPROCESSOR_DEFINITIONS = ( 379 | "DEBUG=1", 380 | "$(inherited)", 381 | ); 382 | INFOPLIST_FILE = TwitterLikeTests/Info.plist; 383 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 384 | PRODUCT_NAME = "$(TARGET_NAME)"; 385 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TwitterLike.app/TwitterLike"; 386 | }; 387 | name = Debug; 388 | }; 389 | F82198851A2373CC00BDF49B /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | BUNDLE_LOADER = "$(TEST_HOST)"; 393 | FRAMEWORK_SEARCH_PATHS = ( 394 | "$(SDKROOT)/Developer/Library/Frameworks", 395 | "$(inherited)", 396 | ); 397 | INFOPLIST_FILE = TwitterLikeTests/Info.plist; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 399 | PRODUCT_NAME = "$(TARGET_NAME)"; 400 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TwitterLike.app/TwitterLike"; 401 | }; 402 | name = Release; 403 | }; 404 | /* End XCBuildConfiguration section */ 405 | 406 | /* Begin XCConfigurationList section */ 407 | F82198581A2373CC00BDF49B /* Build configuration list for PBXProject "TwitterLike" */ = { 408 | isa = XCConfigurationList; 409 | buildConfigurations = ( 410 | F821987E1A2373CC00BDF49B /* Debug */, 411 | F821987F1A2373CC00BDF49B /* Release */, 412 | ); 413 | defaultConfigurationIsVisible = 0; 414 | defaultConfigurationName = Release; 415 | }; 416 | F82198801A2373CC00BDF49B /* Build configuration list for PBXNativeTarget "TwitterLike" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | F82198811A2373CC00BDF49B /* Debug */, 420 | F82198821A2373CC00BDF49B /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | F82198831A2373CC00BDF49B /* Build configuration list for PBXNativeTarget "TwitterLikeTests" */ = { 426 | isa = XCConfigurationList; 427 | buildConfigurations = ( 428 | F82198841A2373CC00BDF49B /* Debug */, 429 | F82198851A2373CC00BDF49B /* Release */, 430 | ); 431 | defaultConfigurationIsVisible = 0; 432 | defaultConfigurationName = Release; 433 | }; 434 | /* End XCConfigurationList section */ 435 | }; 436 | rootObject = F82198551A2373CC00BDF49B /* Project object */; 437 | } 438 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/project.xcworkspace/xcshareddata/TwitterLike.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 08690069-FA13-4794-8673-3E0FB62599D9 9 | IDESourceControlProjectName 10 | TwitterLike 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 14 | github.com:StefanLage/SLPagingView.git 15 | 16 | IDESourceControlProjectPath 17 | Demos/TwitterLike/TwitterLike.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:StefanLage/SLPagingView.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 7E9B3FD320861BBF3C8B43C744839F2E67552682 36 | IDESourceControlWCCName 37 | SLPagingView 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/project.xcworkspace/xcuserdata/kingsoft_ios.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/TwitterLike.xcodeproj/project.xcworkspace/xcuserdata/kingsoft_ios.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/TwitterLike.xcodeproj/project.xcworkspace/xcuserdata/stefan.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/xcuserdata/kingsoft_ios.xcuserdatad/xcschemes/TwitterLike.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/xcuserdata/kingsoft_ios.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TwitterLike.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F821985C1A2373CC00BDF49B 16 | 17 | primary 18 | 19 | 20 | F82198751A2373CC00BDF49B 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/xcuserdata/stefan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/xcuserdata/stefan.xcuserdatad/xcschemes/TwitterLike.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike.xcodeproj/xcuserdata/stefan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TwitterLike.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F821985C1A2373CC00BDF49B 16 | 17 | primary 18 | 19 | 20 | F82198751A2373CC00BDF49B 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TwitterLike 4 | // 5 | // Created by Stefan Lage on 24/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | @property (nonatomic, strong) UINavigationController *rootViewController; 15 | @property (nonatomic, strong) NSMutableArray *dataSource; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TwitterLike 4 | // 5 | // Created by Stefan Lage on 24/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "SLPagingViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @property (strong, nonatomic) UINavigationController *nav; 15 | 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | // Override point for customization after application launch. 23 | 24 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 25 | 26 | self.dataSource = [[NSMutableArray alloc] initWithArray:@[@"Hello world!", @"Shaqtin' a fool!", @"YEAHHH!", 27 | @"Hello world!", @"Shaqtin' a fool!", @"YEAHHH!", 28 | @"Hello world!", @"Shaqtin' a fool!", @"YEAHHH!", 29 | @"Hello world!", @"Shaqtin' a fool!", @"YEAHHH!", 30 | @"Hello world!", @"Shaqtin' a fool!", @"YEAHHH!"]]; 31 | 32 | UILabel *navTitleLabel1 = [UILabel new]; 33 | navTitleLabel1.text = @"Home"; 34 | navTitleLabel1.font = [UIFont fontWithName:@"Helvetica" size:20]; 35 | navTitleLabel1.textColor = [UIColor whiteColor]; 36 | 37 | UILabel *navTitleLabel2 = [UILabel new]; 38 | navTitleLabel2.text = @"Discover"; 39 | navTitleLabel2.font = [UIFont fontWithName:@"Helvetica" size:20]; 40 | navTitleLabel2.textColor = [UIColor whiteColor]; 41 | 42 | UILabel *navTitleLabel3 = [UILabel new]; 43 | navTitleLabel3.text = @"Activity"; 44 | navTitleLabel3.font = [UIFont fontWithName:@"Helvetica" size:20]; 45 | navTitleLabel3.textColor = [UIColor whiteColor]; 46 | 47 | SLPagingViewController *pageViewController = [[SLPagingViewController alloc] initWithNavBarItems:@[navTitleLabel1, navTitleLabel2, navTitleLabel3] 48 | navBarBackground:[UIColor colorWithRed:0.33 green:0.68 blue:0.91 alpha:1.000] 49 | views:@[[self tableView], [self tableView], [self tableView]] 50 | showPageControl:YES]; 51 | [pageViewController setCurrentPageControlColor:[UIColor whiteColor]]; 52 | [pageViewController setTintPageControlColor:[UIColor colorWithWhite:0.799 alpha:1.000]]; 53 | [pageViewController updateUserInteractionOnNavigation:NO]; 54 | 55 | // Twitter Like 56 | pageViewController.pagingViewMovingRedefine = ^(UIScrollView *scrollView, NSArray *subviews){ 57 | float mid = [UIScreen mainScreen].bounds.size.width/2 - 45.0; 58 | float width = [UIScreen mainScreen].bounds.size.width; 59 | CGFloat xOffset = scrollView.contentOffset.x; 60 | int i = 0; 61 | for(UILabel *v in subviews){ 62 | CGFloat alpha = 0.0; 63 | if(v.frame.origin.x < mid) 64 | alpha = 1 - (xOffset - i*width) / width; 65 | else if(v.frame.origin.x >mid) 66 | alpha=(xOffset - i*width) / width + 1; 67 | else if(v.frame.origin.x == mid-5) 68 | alpha = 1.0; 69 | i++; 70 | v.alpha = alpha; 71 | } 72 | }; 73 | 74 | pageViewController.didChangedPage = ^(NSInteger currentPageIndex){ 75 | // Do something 76 | NSLog(@"index %ld", (long)currentPageIndex); 77 | }; 78 | 79 | self.nav = [[UINavigationController alloc] initWithRootViewController:pageViewController]; 80 | [self.window setRootViewController:self.nav]; 81 | self.window.backgroundColor = [UIColor colorWithRed:0.33 green:0.68 blue:0.91 alpha:1.000]; 82 | [self.window makeKeyAndVisible]; 83 | 84 | [self setWindow:self.window]; 85 | 86 | return YES; 87 | } 88 | 89 | - (void)applicationWillResignActive:(UIApplication *)application { 90 | // 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. 91 | // 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. 92 | } 93 | 94 | - (void)applicationDidEnterBackground:(UIApplication *)application { 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 | // 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. 101 | } 102 | 103 | - (void)applicationDidBecomeActive:(UIApplication *)application { 104 | // 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. 105 | } 106 | 107 | - (void)applicationWillTerminate:(UIApplication *)application { 108 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 109 | } 110 | 111 | - (UITableView*)tableView { 112 | CGRect tableViewFrame = CGRectMake(0, 0, 320, 568); 113 | tableViewFrame.size.height -= 44; 114 | UITableView *tableView = [[UITableView alloc] initWithFrame:tableViewFrame 115 | style:UITableViewStylePlain]; 116 | tableView.delegate = self; 117 | tableView.dataSource = self; 118 | [tableView setScrollsToTop:NO]; 119 | return tableView; 120 | } 121 | 122 | #pragma mark - UITableView DataSource 123 | 124 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 125 | return 1; 126 | } 127 | 128 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 129 | return self.dataSource.count; 130 | } 131 | 132 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 133 | return 120; 134 | } 135 | 136 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 137 | static NSString *cellIdentifier = @"cellIdentifier"; 138 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 139 | if (!cell) { 140 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 141 | reuseIdentifier:cellIdentifier]; 142 | cell.textLabel.numberOfLines = 0; 143 | } 144 | cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"avatar_%d.jpg", (indexPath.row % 3)]]; 145 | cell.textLabel.text = self.dataSource[indexPath.row]; 146 | 147 | return cell; 148 | } 149 | 150 | @end 151 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/Image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "scale" : "3x" 14 | } 15 | ], 16 | "info" : { 17 | "version" : 1, 18 | "author" : "xcode" 19 | } 20 | } -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "8.0", 8 | "subtype" : "736h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "landscape", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "8.0", 16 | "subtype" : "736h", 17 | "scale" : "3x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "8.0", 24 | "subtype" : "667h", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "orientation" : "portrait", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "7.0", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "orientation" : "portrait", 36 | "idiom" : "iphone", 37 | "extent" : "full-screen", 38 | "minimum-system-version" : "7.0", 39 | "subtype" : "retina4", 40 | "scale" : "2x" 41 | }, 42 | { 43 | "orientation" : "portrait", 44 | "idiom" : "ipad", 45 | "extent" : "full-screen", 46 | "minimum-system-version" : "7.0", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "orientation" : "landscape", 51 | "idiom" : "ipad", 52 | "extent" : "full-screen", 53 | "minimum-system-version" : "7.0", 54 | "scale" : "1x" 55 | }, 56 | { 57 | "orientation" : "portrait", 58 | "idiom" : "ipad", 59 | "extent" : "full-screen", 60 | "minimum-system-version" : "7.0", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "orientation" : "landscape", 65 | "idiom" : "ipad", 66 | "extent" : "full-screen", 67 | "minimum-system-version" : "7.0", 68 | "scale" : "2x" 69 | }, 70 | { 71 | "orientation" : "portrait", 72 | "idiom" : "iphone", 73 | "extent" : "full-screen", 74 | "scale" : "1x" 75 | }, 76 | { 77 | "orientation" : "portrait", 78 | "idiom" : "iphone", 79 | "extent" : "full-screen", 80 | "scale" : "2x" 81 | }, 82 | { 83 | "orientation" : "portrait", 84 | "idiom" : "iphone", 85 | "extent" : "full-screen", 86 | "subtype" : "retina4", 87 | "scale" : "2x" 88 | }, 89 | { 90 | "orientation" : "portrait", 91 | "idiom" : "ipad", 92 | "extent" : "to-status-bar", 93 | "scale" : "1x" 94 | }, 95 | { 96 | "orientation" : "portrait", 97 | "idiom" : "ipad", 98 | "extent" : "full-screen", 99 | "scale" : "1x" 100 | }, 101 | { 102 | "orientation" : "landscape", 103 | "idiom" : "ipad", 104 | "extent" : "to-status-bar", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "orientation" : "landscape", 109 | "idiom" : "ipad", 110 | "extent" : "full-screen", 111 | "scale" : "1x" 112 | }, 113 | { 114 | "orientation" : "portrait", 115 | "idiom" : "ipad", 116 | "extent" : "to-status-bar", 117 | "scale" : "2x" 118 | }, 119 | { 120 | "orientation" : "portrait", 121 | "idiom" : "ipad", 122 | "extent" : "full-screen", 123 | "scale" : "2x" 124 | }, 125 | { 126 | "orientation" : "landscape", 127 | "idiom" : "ipad", 128 | "extent" : "to-status-bar", 129 | "scale" : "2x" 130 | }, 131 | { 132 | "orientation" : "landscape", 133 | "idiom" : "ipad", 134 | "extent" : "full-screen", 135 | "scale" : "2x" 136 | } 137 | ], 138 | "info" : { 139 | "version" : 1, 140 | "author" : "xcode" 141 | } 142 | } -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_0.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "avatar_twt.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_0.imageset/avatar_twt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_0.imageset/avatar_twt.jpg -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "avatar_shaq.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_1.imageset/avatar_shaq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_1.imageset/avatar_shaq.jpg -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "avatar_hs.jpg" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_2.imageset/avatar_hs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/TwitterLike/Images.xcassets/avatar_2.imageset/avatar_hs.jpg -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | SL.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UIStatusBarStyle 30 | UIStatusBarStyleBlackOpaque 31 | UIStatusBarHidden 32 | 33 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Translucent 38 | 39 | Style 40 | UIBarStyleDefault 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/TwitterLike-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // TwitterLike-Prefix.pch 3 | // TwitterLike 4 | // 5 | // Created by Stefan Lage on 24/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef __IPHONE_3_0 12 | #warning "This project uses features only available in iOS SDK 3.0 and later." 13 | #endif 14 | 15 | #ifdef __OBJC__ 16 | #import 17 | #import 18 | #endif -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLike/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TwitterLike 4 | // 5 | // Created by Stefan Lage on 24/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLikeTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | SL.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Demos/TwitterLike/TwitterLikeTests/TwitterLikeTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TwitterLikeTests.m 3 | // TwitterLikeTests 4 | // 5 | // Created by Stefan Lage on 24/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface TwitterLikeTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation TwitterLikeTests 17 | 18 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demos/TwitterLike/twitter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StefanLage/SLPagingView/a8354776e60a11529cf2c680717d12794f550f25/Demos/TwitterLike/twitter.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 stefanlage 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SLPagingView 2 | [![Build Status](https://travis-ci.org/StefanLage/SLPagingView.svg?branch=master)](https://travis-ci.org/StefanLage/SLPagingView) 3 | [![Version](https://img.shields.io/cocoapods/v/SLPagingView.svg?style=flat)](http://cocoadocs.org/docsets/SLPagingView) 4 | [![License](https://img.shields.io/cocoapods/l/SLPagingView.svg?style=flat)](http://cocoadocs.org/docsets/SLPagingView) 5 | 6 | A navigation bar system allowing to do a Tinder like or Twitter like. 7 | 8 |
9 | 10 | 11 |
12 | 13 | ## Requirements 14 | 15 | * iOS 7.0+ 16 | * ARC 17 | 18 | ## Installation 19 | 20 | ### CocoaPods 21 | 22 | [CocosPods](http://cocosPods.org) is the recommended method to install SLPagingView. 23 | 24 | Add the following line to your Podfile: 25 | 26 | ```ruby 27 | pod 'SLPagingView' 28 | ``` 29 | 30 | And run 31 | ```ruby 32 | pod install 33 | ``` 34 | 35 | ### Manual 36 | 37 | Import SLPagingView folder into your project. 38 | 39 | 40 | ## How to use 41 | 42 | Easy to implement: 43 | 44 | ```` objective-c 45 | 46 | // Make views for the navigation bar 47 | UIImage *img1 = [UIImage imageNamed:@"gear"]; 48 | img1 = [img1 imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 49 | 50 | UIImage *img2 = [UIImage imageNamed:@"profile"]; 51 | img2 = [img2 imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 52 | 53 | UIImage *img3 = [UIImage imageNamed:@"chat"]; 54 | img3 = [img3 imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 55 | 56 | NSArray *titles = @[[[UIImageView alloc] initWithImage:img1], [[UIImageView alloc] initWithImage:img2], [[UIImageView alloc] initWithImage:img3]]; 57 | NSArray *views = @[[self viewWithBackground:orange], [self viewWithBackground:[UIColor yellowColor]], [self viewWithBackground:gray]]; 58 | 59 | SLPagingViewController *pageViewController = [[SLPagingViewController alloc] initWithNavBarItems:titles 60 | navBarBackground:[UIColor whiteColor] 61 | views:views 62 | showPageControl:NO]; 63 | 64 | ```` 65 | 66 | Then you can make your own behaviors: 67 | 68 | ````objective-c 69 | 70 | // Tinder Like 71 | pageViewController.pagingViewMovingRedefine = ^(UIScrollView *scrollView, NSArray *subviews){ 72 | int i = 0; 73 | for(UIImageView *v in subviews){ 74 | UIColor *c = gray; 75 | if(v.frame.origin.x > 45 76 | && v.frame.origin.x < 145) 77 | // Left part 78 | c = [self gradient:v.frame.origin.x 79 | top:46 80 | bottom:144 81 | init:orange 82 | goal:gray]; 83 | else if(v.frame.origin.x > 145 84 | && v.frame.origin.x < 245) 85 | // Right part 86 | c = [self gradient:v.frame.origin.x 87 | top:146 88 | bottom:244 89 | init:gray 90 | goal:orange]; 91 | else if(v.frame.origin.x == 145) 92 | c = orange; 93 | v.tintColor= c; 94 | i++; 95 | } 96 | }; 97 | 98 | ```` 99 | 100 | ##Other sample 101 | 102 | Twitter like behaviors 103 | 104 | ````objective-c 105 | 106 | // Twitter Like 107 | pageViewController.pagingViewMovingRedefine = ^(UIScrollView *scrollView, NSArray *subviews){ 108 | CGFloat xOffset = scrollView.contentOffset.x; 109 | int i = 0; 110 | for(UILabel *v in subviews){ 111 | CGFloat alpha = 0.0; 112 | if(v.frame.origin.x < 145) 113 | alpha = 1 - (xOffset - i*320) / 320; 114 | else if(v.frame.origin.x >145) 115 | alpha=(xOffset - i*320) / 320 + 1; 116 | else if(v.frame.origin.x == 140) 117 | alpha = 1.0; 118 | i++; 119 | v.alpha = alpha; 120 | } 121 | }; 122 | ```` 123 | 124 | ##API 125 | 126 | ###Set current page 127 | 128 | If you want to changed the default page control index (or whatever) you can do it calling: 129 | 130 | ````objective-c 131 | 132 | -(void)setCurrentIndex:(NSInteger)index animated:(BOOL)animated; 133 | ```` 134 | 135 | ###Navigation items style 136 | 137 | 138 | 139 | You can easily customized the navigation items setting up: 140 | 141 | 142 | ````objective-c 143 | 144 | @property (nonatomic) SLNavigationSideItemsStyle navigationSideItemsStyle; 145 | ```` 146 | 147 | 148 | By using one of these values: 149 | 150 | 151 | ````objective-c 152 | 153 | typedef NS_ENUM(NSInteger, SLNavigationSideItemsStyle) { 154 | SLNavigationSideItemsStyleOnBounds, 155 | SLNavigationSideItemsStyleClose, 156 | SLNavigationSideItemsStyleNormal, 157 | SLNavigationSideItemsStyleFar, 158 | SLNavigationSideItemsStyleDefault, 159 | SLNavigationSideItemsStyleCloseToEachOne 160 | }; 161 | ```` 162 | 163 | ###Set navigation bar's background color 164 | 165 | You can update the background color of the navigation bar using the following method: 166 | 167 | ````objective-c 168 | 169 | setNavigationBarColor:(UIColor*) color; 170 | ```` 171 | 172 | ##Storyboard support 173 | 174 | This class can be implemented using Storyboard. 175 | You need to set all identifiers of the segues linked to your SLPagingViewController respecting this syntax: 176 | ` sl_X where X ∈ [0..N] `. 177 | 178 | X corresponding to the index of the view, start from 0 and it works in ascending order. 179 | 180 | ![segue](Demos/TinderStoryboard/segue_params.png) 181 | 182 | You can find an example "TinderStoryboard" for more informations. 183 | 184 | ###Set navigation bar's background color 185 | To set up the navigation bar's background color from the storyboard, you just need to it like all navigation bar. 186 | 187 | ![segue](Demos/TinderStoryboard/navigation_bar_color.png) 188 | 189 | ##License 190 | Available under MIT license, please read LICENSE for more informations. -------------------------------------------------------------------------------- /SLPagingView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SLPagingView' 3 | s.version = '0.0.5' 4 | s.summary = 'Navigation bar system allowing to do a Tinder like or Twitter like' 5 | s.homepage = 'https://github.com/StefanLage/SLPagingView' 6 | s.license = 'MIT' 7 | s.author = { 'StefanLage' => 'lagestfan@gmail.com' } 8 | s.source = { :git => 'https://github.com/StefanLage/SLPagingView.git', :tag => "#{s.version}" } 9 | s.source_files = 'SLPagingView/**/*.{h,m}' 10 | s.requires_arc = true 11 | s.platform = :ios, '7.0' 12 | s.ios.deployment_target = '7.0' 13 | end 14 | -------------------------------------------------------------------------------- /SLPagingView/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | */build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | xcuserdata 12 | profile 13 | *.moved-aside 14 | DerivedData 15 | .idea/ 16 | *.hmap 17 | *.xccheckout 18 | -------------------------------------------------------------------------------- /SLPagingView/Categories/UIColor+SLAddition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+SLAddition.h 3 | // TinderLike 4 | // 5 | // Created by Stefan Lage on 15/1/14. 6 | // Copyright (c) 2015年 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (SLAddition) 12 | 13 | + (UIColor *)gradient:(double)percent top:(double)topX bottom:(double)bottomX init:(UIColor*)init goal:(UIColor*)goal; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SLPagingView/Categories/UIColor+SLAddition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+SLAddition.m 3 | // TinderLike 4 | // 5 | // Created by Stefan Lage on 15/1/14. 6 | // Copyright (c) 2015年 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "UIColor+SLAddition.h" 10 | 11 | @implementation UIColor (SLAddition) 12 | 13 | + (UIColor *)gradient:(double)percent top:(double)topX bottom:(double)bottomX init:(UIColor*)init goal:(UIColor*)goal { 14 | double t = (percent - bottomX) / (topX - bottomX); 15 | 16 | t = MAX(0.0, MIN(t, 1.0)); 17 | 18 | const CGFloat *cgInit = CGColorGetComponents(init.CGColor); 19 | const CGFloat *cgGoal = CGColorGetComponents(goal.CGColor); 20 | 21 | double r = cgInit[0] + t * (cgGoal[0] - cgInit[0]); 22 | double g = cgInit[1] + t * (cgGoal[1] - cgInit[1]); 23 | double b = cgInit[2] + t * (cgGoal[2] - cgInit[2]); 24 | 25 | return [UIColor colorWithRed:r green:g blue:b alpha:1]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /SLPagingView/Categories/UIScrollView+UpdateContentSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+UpdateContentSize.h 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 23/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "ShareResources.h" 10 | 11 | @interface UIScrollView (UpdateContentSize) 12 | 13 | -(void)updateContentSize; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SLPagingView/Categories/UIScrollView+UpdateContentSize.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+UpdateContentSize.m 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 23/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "UIScrollView+UpdateContentSize.h" 10 | 11 | @implementation UIScrollView (UpdateContentSize) 12 | 13 | // Scale the content size depending on its frame 14 | -(void)updateContentSize{ 15 | float nWidth = SCREEN_SIZE.width * self.subviews.count; 16 | float nHeight = (self.subviews.count > 0) ? CGRectGetHeight([(UIView*)self.subviews[0] frame]):CGRectGetHeight(self.frame); 17 | self.contentSize = (CGSize){nWidth, nHeight}; 18 | } 19 | 20 | #pragma mark - OVERRIDE 21 | 22 | -(void)setFrame:(CGRect)frame{ 23 | [super setFrame:frame]; 24 | // Scale the content size 25 | [self updateContentSize]; 26 | } 27 | 28 | -(void)updateConstraints{ 29 | [super updateConstraints]; 30 | // Scale the content size 31 | [self updateContentSize]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /SLPagingView/SLPagingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SLPagingViewController.h 3 | // SLPagingView 4 | // 5 | // Created by Stefan Lage on 20/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "ShareResources.h" 10 | #import "UIScrollView+UpdateContentSize.h" 11 | 12 | typedef NS_ENUM(NSInteger, SLNavigationSideItemsStyle) { 13 | SLNavigationSideItemsStyleOnBounds = 20, 14 | SLNavigationSideItemsStyleClose = 70, 15 | SLNavigationSideItemsStyleNormal = 80, 16 | SLNavigationSideItemsStyleFar = 90, 17 | SLNavigationSideItemsStyleDefault = 60, 18 | SLNavigationSideItemsStyleCloseToEachOne = 100 19 | }; 20 | 21 | /* 22 | * Block delegates 23 | */ 24 | typedef void(^SLPagingViewMoving)(NSArray *subviews); 25 | typedef void(^SLPagingViewMovingRedefine)(UIScrollView * scrollView, NSArray *subviews); 26 | typedef void(^SLPagingViewDidChanged)(NSInteger currentPage); 27 | 28 | 29 | @interface SLPagingViewController : UIViewController 30 | 31 | /* 32 | * The view containing the nav bar menu selection views 33 | */ 34 | @property (nonatomic, strong) UIView *navigationBarView; 35 | 36 | /* 37 | * Delegate: Called when the user scroll horizontally 38 | * Allow to redefine all behaviors + customized the navigation items 39 | * 40 | * @param scrollView 41 | * @param subviews, all subviews contains in the navigations bar 42 | */ 43 | @property (nonatomic, copy) SLPagingViewMovingRedefine pagingViewMovingRedefine; 44 | /* 45 | * Delegate: Called when the user scroll horizontally 46 | * Allow to customized the navigation items 47 | * 48 | * @param scrollView 49 | * @param subviews, all subviews contains in the navigations bar 50 | */ 51 | @property (nonatomic, copy) SLPagingViewMoving pagingViewMoving; 52 | /* 53 | * Delegate: Inform when the page changed 54 | * 55 | * @param currentPage 56 | */ 57 | @property (nonatomic, copy) SLPagingViewDidChanged didChangedPage; 58 | /* 59 | * Contains all views displayed 60 | */ 61 | @property (nonatomic, strong) NSMutableDictionary *viewControllers; 62 | /* 63 | * Tint color of the page control 64 | */ 65 | @property (nonatomic, strong) UIColor *tintPageControlColor; 66 | /* 67 | * Color of the current page (page control) 68 | */ 69 | @property (nonatomic, strong) UIColor *currentPageControlColor; 70 | 71 | /* 72 | * Navigation Items Style 73 | * Allow to move items from the screen bounds to the center 74 | */ 75 | @property (nonatomic) SLNavigationSideItemsStyle navigationSideItemsStyle; 76 | 77 | /* 78 | * SLPagingViewController's constructor 79 | * 80 | * @param items should contain all subviews of the navigation bar 81 | * @param views all subviews corresponding to each page 82 | * 83 | * The navigation bar's background will be white 84 | * The page control is displayed by default 85 | * 86 | * @return Instance of SLPagingViewController 87 | */ 88 | -(id)initWithNavBarItems:(NSArray*)items views:(NSArray*)views; 89 | 90 | /* 91 | * SLPagingViewController's constructor 92 | * 93 | * @param items should contain all subviews of the navigation bar 94 | * @param views all subviews corresponding to each page 95 | * @param showPageControl inform if we need to display the page control in the navigation bar 96 | * 97 | * The navigation bar's background will be white 98 | * 99 | * @return Instance of SLPagingViewController 100 | */ 101 | -(id)initWithNavBarItems:(NSArray*)items views:(NSArray*)views showPageControl:(BOOL)addPageControl; 102 | 103 | /* 104 | * SLPagingViewController's constructor 105 | * 106 | * @param items should contain all subviews of the navigation bar 107 | * @param navBarBackground navigation bar's background color 108 | * @param views all subviews corresponding to each page 109 | * @param showPageControl inform if we need to display the page control in the navigation bar 110 | * 111 | * @return Instance of SLPagingViewController 112 | */ 113 | -(id)initWithNavBarItems:(NSArray*)items navBarBackground:(UIColor*)background views:(NSArray*)views showPageControl:(BOOL)addPageControl; 114 | 115 | /* 116 | * SLPagingViewController's constructor 117 | * 118 | * Use controller's title as a navigation item 119 | * 120 | * @param controllers view controllers containing sall subviews corresponding to each page 121 | * 122 | * The navigation bar's background will be white 123 | * The page control is displayed by default 124 | * 125 | * @return Instance of SLPagingViewController 126 | */ 127 | -(id)initWithNavBarControllers:(NSArray*)controllers; 128 | 129 | /* 130 | * SLPagingViewController's constructor 131 | * 132 | * Use controller's title as a navigation item 133 | * 134 | * @param controllers view controllers containing sall subviews corresponding to each page 135 | * @param showPageControl inform if we need to display the page control in the navigation bar 136 | * 137 | * The navigation bar's background will be white 138 | * 139 | * @return Instance of SLPagingViewController 140 | */ 141 | -(id)initWithNavBarControllers:(NSArray*)controllers showPageControl:(BOOL)addPageControl; 142 | 143 | /* 144 | * SLPagingViewController's constructor 145 | * 146 | * Use controller's title as a navigation item 147 | * 148 | * @param controllers view controllers containing sall subviews corresponding to each page 149 | * @param navBarBackground navigation bar's background color 150 | * @param showPageControl inform if we need to display the page control in the navigation bar 151 | * 152 | * @return Instance of SLPagingViewController 153 | */ 154 | -(id)initWithNavBarControllers:(NSArray*)controllers navBarBackground:(UIColor*)background showPageControl:(BOOL)addPageControl; 155 | 156 | /* 157 | * SLPagingViewController's constructor 158 | * 159 | * @param items should contain all subviews of the navigation bar 160 | * @param controllers view controllers containing sall subviews corresponding to each page 161 | * 162 | * The navigation bar's background will be white 163 | * The page control is displayed by default 164 | * 165 | * @return Instance of SLPagingViewController 166 | */ 167 | -(id)initWithNavBarItems:(NSArray*)items controllers:(NSArray*)controllers; 168 | 169 | /* 170 | * SLPagingViewController's constructor 171 | * 172 | * @param items should contain all subviews of the navigation bar 173 | * @param controllers view controllers containing sall subviews corresponding to each page 174 | * @param showPageControl inform if we need to display the page control in the navigation bar 175 | * 176 | * The navigation bar's background will be white 177 | * 178 | * @return Instance of SLPagingViewController 179 | */ 180 | -(id)initWithNavBarItems:(NSArray*)items controllers:(NSArray*)controllers showPageControl:(BOOL)addPageControl; 181 | 182 | /* 183 | * SLPagingViewController's constructor 184 | * 185 | * @param items should contain all subviews of the navigation bar 186 | * @param navBarBackground navigation bar's background color 187 | * @param controllers view controllers containing sall subviews corresponding to each page 188 | * @param showPageControl inform if we need to display the page control in the navigation bar 189 | * 190 | * @return Instance of SLPagingViewController 191 | */ 192 | -(id)initWithNavBarItems:(NSArray*)items navBarBackground:(UIColor*)background controllers:(NSArray*)controllers showPageControl:(BOOL)addPageControl; 193 | 194 | /* 195 | * Update the state of the UserInteraction on the navigation bar 196 | * 197 | * @param activate state you want to set to UserInteraction 198 | */ 199 | -(void)updateUserInteractionOnNavigation:(BOOL)activate; 200 | 201 | /* 202 | * Set the current index page and scroll to its position 203 | * 204 | * @param index of the wanted page 205 | * @param animated animate the moving 206 | */ 207 | -(void)setCurrentIndex:(NSInteger)index animated:(BOOL)animated; 208 | 209 | /* 210 | * Add a controller to the stack and refresh the UI if needed 211 | * 212 | * @param controller you would like to add to the stack 213 | * @param refresh the UI ? 214 | */ 215 | -(void)addViewControllers:(UIViewController *) controller needToRefresh:(BOOL) refresh; 216 | 217 | /** 218 | * Allows to update the navigationBar's background color 219 | * 220 | * @param color 221 | */ 222 | -(void)setNavigationBarColor:(UIColor*) color; 223 | 224 | @end 225 | 226 | extern NSString* const SLPagingViewPrefixIdentifier; // this is @"sl_" 227 | 228 | @interface SLPagingViewControllerSegueSetController : UIStoryboardSegue 229 | @end 230 | -------------------------------------------------------------------------------- /SLPagingView/SLPagingViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SLPagingViewController.m 3 | // SLPagingView 4 | // 5 | // Created by Stefan Lage on 20/11/14. 6 | // Copyright (c) 2014 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #import "SLPagingViewController.h" 10 | 11 | @interface SLPagingViewController () 12 | 13 | @property (nonatomic, strong) UIScrollView *scrollView; 14 | @property (nonatomic, strong) UIPageControl *pageControl; 15 | @property (nonatomic, strong) NSMutableArray *navItemsViews; 16 | @property (nonatomic) BOOL needToShowPageControl; 17 | @property (nonatomic) BOOL isUserInteraction; 18 | @property (nonatomic) NSInteger indexSelected; 19 | 20 | @end 21 | 22 | @implementation SLPagingViewController 23 | 24 | -(id)initWithCoder:(NSCoder *)aDecoder{ 25 | self = [super initWithCoder:aDecoder]; 26 | if(self){ 27 | [self initCrucialObjects:[UIColor whiteColor] 28 | showPageControl:NO]; 29 | } 30 | return self; 31 | } 32 | 33 | #pragma mark - constructors with views 34 | 35 | -(id)initWithNavBarItems:(NSArray*) items views:(NSArray*)views{ 36 | return [self initWithNavBarItems:items 37 | navBarBackground:[UIColor whiteColor] 38 | views:views 39 | showPageControl:YES]; 40 | } 41 | 42 | -(id)initWithNavBarItems:(NSArray*)items views:(NSArray*)views showPageControl:(BOOL)addPageControl{ 43 | return [self initWithNavBarItems:items 44 | navBarBackground:[UIColor whiteColor] 45 | views:views 46 | showPageControl:addPageControl]; 47 | } 48 | 49 | -(id)initWithNavBarItems:(NSArray*)items navBarBackground:(UIColor*)background views:(NSArray*)views showPageControl:(BOOL)addPageControl{ 50 | self = [super init]; 51 | if(self){ 52 | [self initCrucialObjects:background 53 | showPageControl:addPageControl]; 54 | int i = 0; 55 | for(i=0; i 0){ 64 | NSMutableArray *controllerKeys = [NSMutableArray new]; 65 | for(i=0; i < views.count; i++){ 66 | if([[views objectAtIndex:i] isKindOfClass:UIView.class]){ 67 | UIView *ctr = [views objectAtIndex:i]; 68 | // Set the tag 69 | ctr.tag = i; 70 | [controllerKeys addObject:@(i)]; 71 | } 72 | else if([[views objectAtIndex:i] isKindOfClass:UIViewController.class]){ 73 | UIViewController *ctr = [views objectAtIndex:i]; 74 | // Set the tag 75 | ctr.view.tag = i; 76 | [controllerKeys addObject:@(i)]; 77 | } 78 | } 79 | // Number of keys equals number of controllers ? 80 | if(controllerKeys.count == views.count) 81 | _viewControllers = [[NSMutableDictionary alloc] initWithObjects:views 82 | forKeys:controllerKeys]; 83 | else{ 84 | // Something went wrong -> inform the client 85 | NSException *exc = [[NSException alloc] initWithName:@"View Controllers error" 86 | reason:@"Some objects in viewControllers are not kind of UIViewController!" 87 | userInfo:nil]; 88 | @throw exc; 89 | } 90 | } 91 | } 92 | return self; 93 | } 94 | 95 | #pragma mark - constructors with controllers 96 | 97 | -(id)initWithNavBarControllers:(NSArray *)controllers{ 98 | return [self initWithNavBarControllers:controllers 99 | navBarBackground:[UIColor whiteColor] 100 | showPageControl:YES]; 101 | } 102 | 103 | -(id)initWithNavBarControllers:(NSArray *)controllers showPageControl:(BOOL)addPageControl{ 104 | return [self initWithNavBarControllers:controllers 105 | navBarBackground:[UIColor whiteColor] 106 | showPageControl:addPageControl]; 107 | } 108 | 109 | -(id)initWithNavBarControllers:(NSArray *)controllers navBarBackground:(UIColor *)background showPageControl:(BOOL)addPageControl{ 110 | NSMutableArray *views = [[NSMutableArray alloc] initWithCapacity:controllers.count]; 111 | NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:controllers.count]; 112 | for(int i =0; i self.navigationBarView.subviews.count-1){ 246 | NSException *exc = [[NSException alloc] initWithName:@"Index out of range" 247 | reason:@"The index is out of range of subviews's count!" 248 | userInfo:nil]; 249 | @throw exc; 250 | } 251 | // save current index 252 | self.indexSelected = index; 253 | // Get the right position and update it 254 | CGFloat xOffset = (index * ((int)SCREEN_SIZE.width)); 255 | [self.scrollView setContentOffset:CGPointMake(xOffset, self.scrollView.contentOffset.y) animated:animated]; 256 | } 257 | 258 | -(void)addViewControllers:(UIViewController *) controller needToRefresh:(BOOL) refresh{ 259 | int tag = (int)self.viewControllers.count; 260 | // Try to get a navigation item 261 | UIView *v = nil; 262 | if(controller.title){ 263 | UILabel *item = [UILabel new]; 264 | [item setText:controller.title]; 265 | v = item; 266 | } 267 | else if(controller.navigationItem && controller.navigationItem.titleView){ 268 | v = controller.navigationItem.titleView; 269 | } 270 | else{ 271 | UILabel *item = [UILabel new]; 272 | [item setText:NSStringFromClass(controller.class)]; 273 | v = item; 274 | } 275 | // Adds a navigation item 276 | [self addNavigationItem:v 277 | tag:tag]; 278 | // Save the controller 279 | [self.viewControllers setObject:controller.view 280 | forKey:@(tag)]; 281 | // Update controller's hierarchy 282 | [self addChildViewController:controller]; 283 | // Do we need to refresh the UI ? 284 | if(refresh) 285 | [self setupPagingProcess]; 286 | } 287 | 288 | -(void)setNavigationBarColor:(UIColor*) color{ 289 | if(color) 290 | self.navigationBarView.backgroundColor = color; 291 | } 292 | 293 | #pragma mark - Internal methods 294 | 295 | -(void) initCrucialObjects:(UIColor *)background showPageControl:(BOOL) showPageControl{ 296 | _needToShowPageControl = showPageControl; 297 | _navigationBarView = [[UIView alloc] init]; 298 | _navigationBarView.backgroundColor = background; 299 | // UserInteraction activate by default 300 | _isUserInteraction = YES; 301 | // Default value for the navigation style 302 | _navigationSideItemsStyle = SLNavigationSideItemsStyleDefault; 303 | _viewControllers = [NSMutableDictionary new]; 304 | _navItemsViews = [NSMutableArray new]; 305 | } 306 | 307 | // Load any defined controllers from the storyboard 308 | - (void)loadStoryboardControllers 309 | { 310 | if (self.storyboard) 311 | { 312 | BOOL isThereNextIdentifier = YES; 313 | int idx = 0; 314 | while (isThereNextIdentifier) { 315 | @try 316 | { 317 | [self performSegueWithIdentifier:[NSString stringWithFormat:@"%@%d", SLPagingViewPrefixIdentifier, idx] 318 | sender:nil]; 319 | idx++; 320 | } 321 | @catch(NSException *exception) { 322 | isThereNextIdentifier = NO; 323 | } 324 | } 325 | if(self.navigationController && self.navigationController.navigationBar) 326 | _navigationBarView.backgroundColor = self.navigationController.navigationBar.backgroundColor; 327 | } 328 | } 329 | 330 | // Perform a specific selector for each controllers 331 | -(void)notifyControllers:(SEL)selector object:(id)object checkIndex:(BOOL)index{ 332 | if(index && self.childViewControllers.count > self.indexSelected) { 333 | [(UIViewController*)self.childViewControllers[self.indexSelected] performSelectorOnMainThread:selector 334 | withObject:object 335 | waitUntilDone:NO]; 336 | } 337 | else{ 338 | [self.childViewControllers enumerateObjectsUsingBlock:^(UIViewController* ctr, NSUInteger idx, BOOL *stop) { 339 | [ctr performSelectorOnMainThread:selector 340 | withObject:object 341 | waitUntilDone:NO]; 342 | }]; 343 | } 344 | } 345 | 346 | // Add a view as a navigationBarItem 347 | -(void)addNavigationItem:(UIView*)v tag:(int)tag{ 348 | CGFloat distance = (SCREEN_SIZE.width/2) - self.navigationSideItemsStyle; 349 | CGSize vSize = ([v isKindOfClass:[UILabel class]])? [self getLabelSize:(UILabel*)v] : v.frame.size; 350 | CGFloat originX = (SCREEN_SIZE.width/2 - vSize.width/2) + self.navItemsViews.count*distance; 351 | v.frame = (CGRect){originX, 8, vSize.width, vSize.height}; 352 | v.tag = tag; 353 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self 354 | action:@selector(tapOnHeader:)]; 355 | [v addGestureRecognizer:tap]; 356 | [v setUserInteractionEnabled:YES]; 357 | [_navigationBarView addSubview:v]; 358 | if(!_navItemsViews) 359 | _navItemsViews = [[NSMutableArray alloc] init]; 360 | [_navItemsViews addObject:v]; 361 | } 362 | 363 | -(void)setupPagingProcess{ 364 | // Make our ScrollView 365 | CGRect frame = CGRectMake(0, 0, SCREEN_SIZE.width, self.view.bounds.size.height); 366 | self.scrollView = [[UIScrollView alloc] initWithFrame:frame]; 367 | self.scrollView.backgroundColor = [UIColor clearColor]; 368 | self.scrollView.pagingEnabled = YES; 369 | self.scrollView.showsHorizontalScrollIndicator = NO; 370 | self.scrollView.showsVerticalScrollIndicator = NO; 371 | self.scrollView.delegate = self; 372 | self.scrollView.bounces = NO; 373 | [self.scrollView setContentInset:UIEdgeInsetsMake(0, 0, -80, 0)]; 374 | [self.view addSubview:self.scrollView]; 375 | 376 | // Adds all views 377 | [self addControllers]; 378 | 379 | if(self.needToShowPageControl){ 380 | // Make the page control 381 | self.pageControl = [[UIPageControl alloc] init]; 382 | self.pageControl.frame = (CGRect){0, 35, 0, 0}; 383 | self.pageControl.numberOfPages = self.navigationBarView.subviews.count; 384 | self.pageControl.currentPage = 0; 385 | if(self.currentPageControlColor) self.pageControl.currentPageIndicatorTintColor = self.currentPageControlColor; 386 | if(self.tintPageControlColor) self.pageControl.pageIndicatorTintColor = self.tintPageControlColor; 387 | [self.navigationBarView addSubview:self.pageControl]; 388 | } 389 | } 390 | 391 | // Add all views 392 | -(void)addControllers{ 393 | if(self.viewControllers 394 | && self.viewControllers.count > 0){ 395 | float width = SCREEN_SIZE.width * self.viewControllers.count; 396 | float height = CGRectGetHeight(self.view.bounds) - CGRectGetHeight(self.navigationBarView.bounds); 397 | self.scrollView.contentSize = (CGSize){width, height}; 398 | __block int i = 0; 399 | // Sort all keys in ascending 400 | NSArray *sortedIndexes = [self.viewControllers.allKeys sortedArrayUsingComparator:^NSComparisonResult(NSNumber *key1, NSNumber *key2) { 401 | if ([key1 integerValue] > [key2 integerValue]) { 402 | return (NSComparisonResult)NSOrderedDescending; 403 | } 404 | if ([key1 integerValue] < [key2 integerValue]) { 405 | return (NSComparisonResult)NSOrderedAscending; 406 | } 407 | return (NSComparisonResult)NSOrderedSame; 408 | }]; 409 | 410 | [sortedIndexes enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 411 | UIView *v = self.viewControllers[@(idx)]; 412 | [self.scrollView addSubview:v]; 413 | if([self useAutoLayout:v]){ 414 | // Using AutoLayout 415 | v.translatesAutoresizingMaskIntoConstraints = NO; 416 | // Width constraint, half of parent view width 417 | [self.scrollView addConstraint:[NSLayoutConstraint constraintWithItem:v 418 | attribute:NSLayoutAttributeWidth 419 | relatedBy:NSLayoutRelationEqual 420 | toItem:self.scrollView 421 | attribute:NSLayoutAttributeWidth 422 | multiplier:1.0 423 | constant:0]]; 424 | // Height constraint, half of parent view height 425 | [self.scrollView addConstraint:[NSLayoutConstraint constraintWithItem:v 426 | attribute:NSLayoutAttributeHeight 427 | relatedBy:NSLayoutRelationEqual 428 | toItem:self.scrollView 429 | attribute:NSLayoutAttributeHeight 430 | multiplier:1.0 431 | constant:0]]; 432 | UIView *previous = [self.viewControllers objectForKey:[NSNumber numberWithFloat:(idx - 1)]]; 433 | if(previous) 434 | // Distance constraint: set distance between previous view and the current one 435 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[previous]-0-[v]" 436 | options:0 437 | metrics:nil 438 | views:@{@"v" : v, @"previous" : previous}]]; 439 | else 440 | // First view 441 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[v]" 442 | options:0 443 | metrics:nil 444 | views:@{@"v" : v }]]; 445 | // Oridnate constraint : set the space between the Top and the current view 446 | [self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:@"V:|-%f-[v]", CGRectGetHeight(self.navigationBarView.frame)] 447 | options:0 448 | metrics:nil 449 | views:@{@"v" : v}]]; 450 | } 451 | else{ 452 | v.frame = (CGRect){SCREEN_SIZE.width * i, 0, SCREEN_SIZE.width, CGRectGetHeight(self.view.frame)}; 453 | i++; 454 | } 455 | }]; 456 | } 457 | } 458 | 459 | // Scroll to the view tapped 460 | -(void)tapOnHeader:(UITapGestureRecognizer *)recognizer{ 461 | if(self.isUserInteraction){ 462 | // Get the wanted view 463 | UIView *view = [self.viewControllers objectForKey:@(recognizer.view.tag)]; 464 | [self.scrollView scrollRectToVisible:view.frame 465 | animated:YES]; 466 | } 467 | } 468 | 469 | -(CGSize) getLabelSize:(UILabel *)lbl{ 470 | return [[lbl text] sizeWithAttributes:@{NSFontAttributeName:[lbl font]}];; 471 | } 472 | 473 | /** 474 | * Check whether the app use Auto Layout 475 | */ 476 | -(BOOL)useAutoLayout:(UIView*)someView{ 477 | return someView.constraints.count; 478 | } 479 | 480 | #pragma mark - Internal Methods 481 | #pragma mark - Views management 482 | 483 | /* Update all nav items frame 484 | * 485 | * @param xOffset, abscissa of the scrollview's contentOffset 486 | */ 487 | -(void)updateNavItems:(CGFloat) xOffset{ 488 | __block int i = 0; 489 | [self.navItemsViews enumerateObjectsUsingBlock:^(UIView* v, NSUInteger idx, BOOL *stop) { 490 | CGFloat distance = (SCREEN_SIZE.width/2) - self.navigationSideItemsStyle; 491 | CGSize vSize = ([v isKindOfClass:[UILabel class]])? [self getLabelSize:(UILabel*)v] : v.frame.size; 492 | CGFloat originX = ((SCREEN_SIZE.width/2 - vSize.width/2) + i*distance) - xOffset/(SCREEN_SIZE.width/distance); 493 | v.frame = (CGRect){originX, 8, vSize.width, vSize.height}; 494 | i++; 495 | }]; 496 | } 497 | 498 | // Adapt all views the main screen 499 | -(void)adaptViews{ 500 | // Update the nav items + the scrollview 501 | [self updateNavItems:self.scrollView.contentOffset.x]; 502 | // Be sure to stay on the same view 503 | [self setCurrentIndex:self.indexSelected 504 | animated:NO]; 505 | [self.scrollView setNeedsUpdateConstraints]; 506 | [self.view setNeedsUpdateConstraints]; 507 | } 508 | 509 | #pragma mark - Internal Methods 510 | #pragma mark - Notifications 511 | 512 | // Call when the screen orientation is updated 513 | - (void)orientationChanged:(NSNotification *)notification{ 514 | [self adaptViews]; 515 | } 516 | 517 | #pragma mark - SLPagingViewDidChanged delegate 518 | 519 | -(void)sendNewIndex:(UIScrollView *)scrollView{ 520 | CGFloat xOffset = scrollView.contentOffset.x; 521 | NSInteger oldIndex = self.indexSelected; 522 | self.indexSelected = ((int) roundf(xOffset) % (self.navigationBarView.subviews.count * (int)SCREEN_SIZE.width)) / SCREEN_SIZE.width; 523 | if(oldIndex != self.indexSelected) 524 | [self notifyControllers:NSSelectorFromString(@"viewDidDisappear:") 525 | object:@(YES) 526 | checkIndex:YES]; 527 | if(self.pageControl){ 528 | if (self.pageControl.currentPage != self.indexSelected) 529 | { 530 | self.pageControl.currentPage = self.indexSelected; 531 | if(self.didChangedPage) 532 | self.didChangedPage(self.indexSelected); 533 | } 534 | } 535 | else{ 536 | if(self.didChangedPage) 537 | self.didChangedPage(self.indexSelected); 538 | } 539 | // Try to notify the controller concerned 540 | [self notifyControllers:NSSelectorFromString(@"viewDidAppear:") 541 | object:@(YES) 542 | checkIndex:YES]; 543 | } 544 | 545 | #pragma mark - ScrollView delegate 546 | 547 | -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ 548 | // Try to notify the controller concerned 549 | [self notifyControllers:NSSelectorFromString(@"viewWillDisappear:") 550 | object:@(YES) 551 | checkIndex:YES 552 | ]; 553 | } 554 | 555 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 556 | // Update nav items 557 | [self updateNavItems:scrollView.contentOffset.x]; 558 | if(self.pagingViewMoving) 559 | // Customize the navigation items 560 | self.pagingViewMoving(self.navItemsViews); 561 | if(self.pagingViewMovingRedefine) 562 | // Wants to redefine all behaviors 563 | self.pagingViewMovingRedefine(scrollView, self.navItemsViews); 564 | } 565 | 566 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { 567 | [self sendNewIndex:scrollView]; 568 | } 569 | -(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView{ 570 | [self sendNewIndex:scrollView]; 571 | } 572 | 573 | @end 574 | 575 | #pragma mark - SLPagingViewControllerSegueSetController segue identifier's prefix 576 | 577 | NSString * const SLPagingViewPrefixIdentifier = @"sl_"; 578 | 579 | #pragma mark - SLPagingViewControllerSegueSetController class 580 | 581 | @implementation SLPagingViewControllerSegueSetController 582 | 583 | -(void)perform{ 584 | // Get SLPagingViewController (sourceViewController) 585 | SLPagingViewController *src = self.sourceViewController; 586 | // Add it to the subviews 587 | if(self.destinationViewController) 588 | [src addViewControllers:self.destinationViewController 589 | needToRefresh:NO]; 590 | } 591 | 592 | @end 593 | -------------------------------------------------------------------------------- /SLPagingView/ShareResources.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShareResources.h 3 | // TinderStoryboard 4 | // 5 | // Created by Stefan Lage on 23/01/15. 6 | // Copyright (c) 2015 Stefan Lage. All rights reserved. 7 | // 8 | 9 | #ifdef __OBJC__ 10 | #import 11 | #import 12 | 13 | #define SCREEN_SIZE [[UIScreen mainScreen] bounds].size 14 | #endif 15 | --------------------------------------------------------------------------------