├── .gitignore ├── README.md ├── UIPageViewController Post.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── UIPageViewController Post ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── TutorialPageViewController.swift └── TutorialViewController.swift ├── UIPageViewController PostTests ├── Info.plist └── UIPageViewController_PostTests.swift └── UIPageViewController PostUITests ├── Info.plist └── UIPageViewController_PostUITests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UIPageViewController-Post 2 | The source code for my blog post, [Making a tutorial using UIPageViewController in Swift](https://spin.atomicobject.com/2015/12/23/swift-uipageviewcontroller-tutorial/). 3 | 4 | Here is a current screenshot of what the app looks like on launch: 5 | 6 | ![Current Screenshot](http://oi65.tinypic.com/2dtdap5.jpg) 7 | -------------------------------------------------------------------------------- /UIPageViewController Post.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0028BB961C1B0B980040AE31 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0028BB951C1B0B980040AE31 /* AppDelegate.swift */; }; 11 | 0028BB9F1C1B0B980040AE31 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0028BB9D1C1B0B980040AE31 /* Main.storyboard */; }; 12 | 0028BBA11C1B0B980040AE31 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0028BBA01C1B0B980040AE31 /* Assets.xcassets */; }; 13 | 0028BBA41C1B0B980040AE31 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0028BBA21C1B0B980040AE31 /* LaunchScreen.storyboard */; }; 14 | 0028BBAF1C1B0B980040AE31 /* UIPageViewController_PostTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0028BBAE1C1B0B980040AE31 /* UIPageViewController_PostTests.swift */; }; 15 | 0028BBBA1C1B0B980040AE31 /* UIPageViewController_PostUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0028BBB91C1B0B980040AE31 /* UIPageViewController_PostUITests.swift */; }; 16 | 0028BBC81C1B11A70040AE31 /* TutorialPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0028BBC71C1B11A70040AE31 /* TutorialPageViewController.swift */; }; 17 | 00D7B5231C62457A0024DAE5 /* TutorialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D7B5221C62457A0024DAE5 /* TutorialViewController.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 0028BBAB1C1B0B980040AE31 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 0028BB8A1C1B0B980040AE31 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 0028BB911C1B0B980040AE31; 26 | remoteInfo = "UIPageViewController Post"; 27 | }; 28 | 0028BBB61C1B0B980040AE31 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 0028BB8A1C1B0B980040AE31 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 0028BB911C1B0B980040AE31; 33 | remoteInfo = "UIPageViewController Post"; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 0028BB921C1B0B980040AE31 /* UIPageViewController Post.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "UIPageViewController Post.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 0028BB951C1B0B980040AE31 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 0028BB9E1C1B0B980040AE31 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 0028BBA01C1B0B980040AE31 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 0028BBA31C1B0B980040AE31 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 43 | 0028BBA51C1B0B980040AE31 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 0028BBAA1C1B0B980040AE31 /* UIPageViewController PostTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UIPageViewController PostTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 0028BBAE1C1B0B980040AE31 /* UIPageViewController_PostTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIPageViewController_PostTests.swift; sourceTree = ""; }; 46 | 0028BBB01C1B0B980040AE31 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 0028BBB51C1B0B980040AE31 /* UIPageViewController PostUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UIPageViewController PostUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 0028BBB91C1B0B980040AE31 /* UIPageViewController_PostUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIPageViewController_PostUITests.swift; sourceTree = ""; }; 49 | 0028BBBB1C1B0B980040AE31 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 0028BBC71C1B11A70040AE31 /* TutorialPageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TutorialPageViewController.swift; sourceTree = ""; }; 51 | 00D7B5221C62457A0024DAE5 /* TutorialViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TutorialViewController.swift; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 0028BB8F1C1B0B980040AE31 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | 0028BBA71C1B0B980040AE31 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | 0028BBB21C1B0B980040AE31 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 0028BB891C1B0B980040AE31 = { 80 | isa = PBXGroup; 81 | children = ( 82 | 0028BB941C1B0B980040AE31 /* UIPageViewController Post */, 83 | 0028BBAD1C1B0B980040AE31 /* UIPageViewController PostTests */, 84 | 0028BBB81C1B0B980040AE31 /* UIPageViewController PostUITests */, 85 | 0028BB931C1B0B980040AE31 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | 0028BB931C1B0B980040AE31 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 0028BB921C1B0B980040AE31 /* UIPageViewController Post.app */, 93 | 0028BBAA1C1B0B980040AE31 /* UIPageViewController PostTests.xctest */, 94 | 0028BBB51C1B0B980040AE31 /* UIPageViewController PostUITests.xctest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 0028BB941C1B0B980040AE31 /* UIPageViewController Post */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 0028BB951C1B0B980040AE31 /* AppDelegate.swift */, 103 | 0028BB9D1C1B0B980040AE31 /* Main.storyboard */, 104 | 0028BBA01C1B0B980040AE31 /* Assets.xcassets */, 105 | 0028BBA21C1B0B980040AE31 /* LaunchScreen.storyboard */, 106 | 0028BBA51C1B0B980040AE31 /* Info.plist */, 107 | 00D7B5221C62457A0024DAE5 /* TutorialViewController.swift */, 108 | 0028BBC71C1B11A70040AE31 /* TutorialPageViewController.swift */, 109 | ); 110 | path = "UIPageViewController Post"; 111 | sourceTree = ""; 112 | }; 113 | 0028BBAD1C1B0B980040AE31 /* UIPageViewController PostTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 0028BBAE1C1B0B980040AE31 /* UIPageViewController_PostTests.swift */, 117 | 0028BBB01C1B0B980040AE31 /* Info.plist */, 118 | ); 119 | path = "UIPageViewController PostTests"; 120 | sourceTree = ""; 121 | }; 122 | 0028BBB81C1B0B980040AE31 /* UIPageViewController PostUITests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 0028BBB91C1B0B980040AE31 /* UIPageViewController_PostUITests.swift */, 126 | 0028BBBB1C1B0B980040AE31 /* Info.plist */, 127 | ); 128 | path = "UIPageViewController PostUITests"; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | 0028BB911C1B0B980040AE31 /* UIPageViewController Post */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = 0028BBBE1C1B0B980040AE31 /* Build configuration list for PBXNativeTarget "UIPageViewController Post" */; 137 | buildPhases = ( 138 | 0028BB8E1C1B0B980040AE31 /* Sources */, 139 | 0028BB8F1C1B0B980040AE31 /* Frameworks */, 140 | 0028BB901C1B0B980040AE31 /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = "UIPageViewController Post"; 147 | productName = "UIPageViewController Post"; 148 | productReference = 0028BB921C1B0B980040AE31 /* UIPageViewController Post.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | 0028BBA91C1B0B980040AE31 /* UIPageViewController PostTests */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = 0028BBC11C1B0B980040AE31 /* Build configuration list for PBXNativeTarget "UIPageViewController PostTests" */; 154 | buildPhases = ( 155 | 0028BBA61C1B0B980040AE31 /* Sources */, 156 | 0028BBA71C1B0B980040AE31 /* Frameworks */, 157 | 0028BBA81C1B0B980040AE31 /* Resources */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | 0028BBAC1C1B0B980040AE31 /* PBXTargetDependency */, 163 | ); 164 | name = "UIPageViewController PostTests"; 165 | productName = "UIPageViewController PostTests"; 166 | productReference = 0028BBAA1C1B0B980040AE31 /* UIPageViewController PostTests.xctest */; 167 | productType = "com.apple.product-type.bundle.unit-test"; 168 | }; 169 | 0028BBB41C1B0B980040AE31 /* UIPageViewController PostUITests */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = 0028BBC41C1B0B980040AE31 /* Build configuration list for PBXNativeTarget "UIPageViewController PostUITests" */; 172 | buildPhases = ( 173 | 0028BBB11C1B0B980040AE31 /* Sources */, 174 | 0028BBB21C1B0B980040AE31 /* Frameworks */, 175 | 0028BBB31C1B0B980040AE31 /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | 0028BBB71C1B0B980040AE31 /* PBXTargetDependency */, 181 | ); 182 | name = "UIPageViewController PostUITests"; 183 | productName = "UIPageViewController PostUITests"; 184 | productReference = 0028BBB51C1B0B980040AE31 /* UIPageViewController PostUITests.xctest */; 185 | productType = "com.apple.product-type.bundle.ui-testing"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | 0028BB8A1C1B0B980040AE31 /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastSwiftUpdateCheck = 0720; 194 | LastUpgradeCheck = 0720; 195 | ORGANIZATIONNAME = "Seven Even"; 196 | TargetAttributes = { 197 | 0028BB911C1B0B980040AE31 = { 198 | CreatedOnToolsVersion = 7.2; 199 | DevelopmentTeam = 7UFKWHQKHW; 200 | }; 201 | 0028BBA91C1B0B980040AE31 = { 202 | CreatedOnToolsVersion = 7.2; 203 | DevelopmentTeam = 7UFKWHQKHW; 204 | TestTargetID = 0028BB911C1B0B980040AE31; 205 | }; 206 | 0028BBB41C1B0B980040AE31 = { 207 | CreatedOnToolsVersion = 7.2; 208 | DevelopmentTeam = 7UFKWHQKHW; 209 | TestTargetID = 0028BB911C1B0B980040AE31; 210 | }; 211 | }; 212 | }; 213 | buildConfigurationList = 0028BB8D1C1B0B980040AE31 /* Build configuration list for PBXProject "UIPageViewController Post" */; 214 | compatibilityVersion = "Xcode 3.2"; 215 | developmentRegion = English; 216 | hasScannedForEncodings = 0; 217 | knownRegions = ( 218 | en, 219 | Base, 220 | ); 221 | mainGroup = 0028BB891C1B0B980040AE31; 222 | productRefGroup = 0028BB931C1B0B980040AE31 /* Products */; 223 | projectDirPath = ""; 224 | projectRoot = ""; 225 | targets = ( 226 | 0028BB911C1B0B980040AE31 /* UIPageViewController Post */, 227 | 0028BBA91C1B0B980040AE31 /* UIPageViewController PostTests */, 228 | 0028BBB41C1B0B980040AE31 /* UIPageViewController PostUITests */, 229 | ); 230 | }; 231 | /* End PBXProject section */ 232 | 233 | /* Begin PBXResourcesBuildPhase section */ 234 | 0028BB901C1B0B980040AE31 /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 0028BBA41C1B0B980040AE31 /* LaunchScreen.storyboard in Resources */, 239 | 0028BBA11C1B0B980040AE31 /* Assets.xcassets in Resources */, 240 | 0028BB9F1C1B0B980040AE31 /* Main.storyboard in Resources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | 0028BBA81C1B0B980040AE31 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | 0028BBB31C1B0B980040AE31 /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | /* End PBXResourcesBuildPhase section */ 259 | 260 | /* Begin PBXSourcesBuildPhase section */ 261 | 0028BB8E1C1B0B980040AE31 /* Sources */ = { 262 | isa = PBXSourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | 0028BBC81C1B11A70040AE31 /* TutorialPageViewController.swift in Sources */, 266 | 00D7B5231C62457A0024DAE5 /* TutorialViewController.swift in Sources */, 267 | 0028BB961C1B0B980040AE31 /* AppDelegate.swift in Sources */, 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | }; 271 | 0028BBA61C1B0B980040AE31 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 0028BBAF1C1B0B980040AE31 /* UIPageViewController_PostTests.swift in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 0028BBB11C1B0B980040AE31 /* Sources */ = { 280 | isa = PBXSourcesBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 0028BBBA1C1B0B980040AE31 /* UIPageViewController_PostUITests.swift in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | /* End PBXSourcesBuildPhase section */ 288 | 289 | /* Begin PBXTargetDependency section */ 290 | 0028BBAC1C1B0B980040AE31 /* PBXTargetDependency */ = { 291 | isa = PBXTargetDependency; 292 | target = 0028BB911C1B0B980040AE31 /* UIPageViewController Post */; 293 | targetProxy = 0028BBAB1C1B0B980040AE31 /* PBXContainerItemProxy */; 294 | }; 295 | 0028BBB71C1B0B980040AE31 /* PBXTargetDependency */ = { 296 | isa = PBXTargetDependency; 297 | target = 0028BB911C1B0B980040AE31 /* UIPageViewController Post */; 298 | targetProxy = 0028BBB61C1B0B980040AE31 /* PBXContainerItemProxy */; 299 | }; 300 | /* End PBXTargetDependency section */ 301 | 302 | /* Begin PBXVariantGroup section */ 303 | 0028BB9D1C1B0B980040AE31 /* Main.storyboard */ = { 304 | isa = PBXVariantGroup; 305 | children = ( 306 | 0028BB9E1C1B0B980040AE31 /* Base */, 307 | ); 308 | name = Main.storyboard; 309 | sourceTree = ""; 310 | }; 311 | 0028BBA21C1B0B980040AE31 /* LaunchScreen.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 0028BBA31C1B0B980040AE31 /* Base */, 315 | ); 316 | name = LaunchScreen.storyboard; 317 | sourceTree = ""; 318 | }; 319 | /* End PBXVariantGroup section */ 320 | 321 | /* Begin XCBuildConfiguration section */ 322 | 0028BBBC1C1B0B980040AE31 /* Debug */ = { 323 | isa = XCBuildConfiguration; 324 | buildSettings = { 325 | ALWAYS_SEARCH_USER_PATHS = NO; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BOOL_CONVERSION = YES; 331 | CLANG_WARN_CONSTANT_CONVERSION = YES; 332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 333 | CLANG_WARN_EMPTY_BODY = YES; 334 | CLANG_WARN_ENUM_CONVERSION = YES; 335 | CLANG_WARN_INT_CONVERSION = YES; 336 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 337 | CLANG_WARN_UNREACHABLE_CODE = YES; 338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | DEBUG_INFORMATION_FORMAT = dwarf; 342 | ENABLE_STRICT_OBJC_MSGSEND = YES; 343 | ENABLE_TESTABILITY = YES; 344 | GCC_C_LANGUAGE_STANDARD = gnu99; 345 | GCC_DYNAMIC_NO_PIC = NO; 346 | GCC_NO_COMMON_BLOCKS = YES; 347 | GCC_OPTIMIZATION_LEVEL = 0; 348 | GCC_PREPROCESSOR_DEFINITIONS = ( 349 | "DEBUG=1", 350 | "$(inherited)", 351 | ); 352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 353 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 354 | GCC_WARN_UNDECLARED_SELECTOR = YES; 355 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 356 | GCC_WARN_UNUSED_FUNCTION = YES; 357 | GCC_WARN_UNUSED_VARIABLE = YES; 358 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 359 | MTL_ENABLE_DEBUG_INFO = YES; 360 | ONLY_ACTIVE_ARCH = YES; 361 | SDKROOT = iphoneos; 362 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 363 | }; 364 | name = Debug; 365 | }; 366 | 0028BBBD1C1B0B980040AE31 /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ALWAYS_SEARCH_USER_PATHS = NO; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BOOL_CONVERSION = YES; 375 | CLANG_WARN_CONSTANT_CONVERSION = YES; 376 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 377 | CLANG_WARN_EMPTY_BODY = YES; 378 | CLANG_WARN_ENUM_CONVERSION = YES; 379 | CLANG_WARN_INT_CONVERSION = YES; 380 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 381 | CLANG_WARN_UNREACHABLE_CODE = YES; 382 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 383 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 384 | COPY_PHASE_STRIP = NO; 385 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 386 | ENABLE_NS_ASSERTIONS = NO; 387 | ENABLE_STRICT_OBJC_MSGSEND = YES; 388 | GCC_C_LANGUAGE_STANDARD = gnu99; 389 | GCC_NO_COMMON_BLOCKS = YES; 390 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 391 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 392 | GCC_WARN_UNDECLARED_SELECTOR = YES; 393 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 394 | GCC_WARN_UNUSED_FUNCTION = YES; 395 | GCC_WARN_UNUSED_VARIABLE = YES; 396 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 397 | MTL_ENABLE_DEBUG_INFO = NO; 398 | SDKROOT = iphoneos; 399 | VALIDATE_PRODUCT = YES; 400 | }; 401 | name = Release; 402 | }; 403 | 0028BBBF1C1B0B980040AE31 /* Debug */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 407 | INFOPLIST_FILE = "UIPageViewController Post/Info.plist"; 408 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 409 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.UIPageViewController-Post"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | SWIFT_VERSION = 4.2; 412 | }; 413 | name = Debug; 414 | }; 415 | 0028BBC01C1B0B980040AE31 /* Release */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 419 | INFOPLIST_FILE = "UIPageViewController Post/Info.plist"; 420 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 421 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.UIPageViewController-Post"; 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | SWIFT_VERSION = 4.2; 424 | }; 425 | name = Release; 426 | }; 427 | 0028BBC21C1B0B980040AE31 /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | BUNDLE_LOADER = "$(TEST_HOST)"; 431 | INFOPLIST_FILE = "UIPageViewController PostTests/Info.plist"; 432 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 433 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.UIPageViewController-PostTests"; 434 | PRODUCT_NAME = "$(TARGET_NAME)"; 435 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIPageViewController Post.app/UIPageViewController Post"; 436 | }; 437 | name = Debug; 438 | }; 439 | 0028BBC31C1B0B980040AE31 /* Release */ = { 440 | isa = XCBuildConfiguration; 441 | buildSettings = { 442 | BUNDLE_LOADER = "$(TEST_HOST)"; 443 | INFOPLIST_FILE = "UIPageViewController PostTests/Info.plist"; 444 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 445 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.UIPageViewController-PostTests"; 446 | PRODUCT_NAME = "$(TARGET_NAME)"; 447 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIPageViewController Post.app/UIPageViewController Post"; 448 | }; 449 | name = Release; 450 | }; 451 | 0028BBC51C1B0B980040AE31 /* Debug */ = { 452 | isa = XCBuildConfiguration; 453 | buildSettings = { 454 | INFOPLIST_FILE = "UIPageViewController PostUITests/Info.plist"; 455 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 456 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.UIPageViewController-PostUITests"; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | TEST_TARGET_NAME = "UIPageViewController Post"; 459 | USES_XCTRUNNER = YES; 460 | }; 461 | name = Debug; 462 | }; 463 | 0028BBC61C1B0B980040AE31 /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | INFOPLIST_FILE = "UIPageViewController PostUITests/Info.plist"; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | PRODUCT_BUNDLE_IDENTIFIER = "com.atomicobject.UIPageViewController-PostUITests"; 469 | PRODUCT_NAME = "$(TARGET_NAME)"; 470 | TEST_TARGET_NAME = "UIPageViewController Post"; 471 | USES_XCTRUNNER = YES; 472 | }; 473 | name = Release; 474 | }; 475 | /* End XCBuildConfiguration section */ 476 | 477 | /* Begin XCConfigurationList section */ 478 | 0028BB8D1C1B0B980040AE31 /* Build configuration list for PBXProject "UIPageViewController Post" */ = { 479 | isa = XCConfigurationList; 480 | buildConfigurations = ( 481 | 0028BBBC1C1B0B980040AE31 /* Debug */, 482 | 0028BBBD1C1B0B980040AE31 /* Release */, 483 | ); 484 | defaultConfigurationIsVisible = 0; 485 | defaultConfigurationName = Release; 486 | }; 487 | 0028BBBE1C1B0B980040AE31 /* Build configuration list for PBXNativeTarget "UIPageViewController Post" */ = { 488 | isa = XCConfigurationList; 489 | buildConfigurations = ( 490 | 0028BBBF1C1B0B980040AE31 /* Debug */, 491 | 0028BBC01C1B0B980040AE31 /* Release */, 492 | ); 493 | defaultConfigurationIsVisible = 0; 494 | defaultConfigurationName = Release; 495 | }; 496 | 0028BBC11C1B0B980040AE31 /* Build configuration list for PBXNativeTarget "UIPageViewController PostTests" */ = { 497 | isa = XCConfigurationList; 498 | buildConfigurations = ( 499 | 0028BBC21C1B0B980040AE31 /* Debug */, 500 | 0028BBC31C1B0B980040AE31 /* Release */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 0028BBC41C1B0B980040AE31 /* Build configuration list for PBXNativeTarget "UIPageViewController PostUITests" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 0028BBC51C1B0B980040AE31 /* Debug */, 509 | 0028BBC61C1B0B980040AE31 /* Release */, 510 | ); 511 | defaultConfigurationIsVisible = 0; 512 | defaultConfigurationName = Release; 513 | }; 514 | /* End XCConfigurationList section */ 515 | }; 516 | rootObject = 0028BB8A1C1B0B980040AE31 /* Project object */; 517 | } 518 | -------------------------------------------------------------------------------- /UIPageViewController Post.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UIPageViewController Post/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // UIPageViewController Post 4 | // 5 | // Created by Jeffrey Burt on 12/11/15. 6 | // Copyright © 2015 Atomic Object. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /UIPageViewController Post/Assets.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 | } -------------------------------------------------------------------------------- /UIPageViewController Post/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /UIPageViewController Post/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 | 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 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /UIPageViewController Post/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /UIPageViewController Post/TutorialPageViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TutorialPageViewController.swift 3 | // UIPageViewController Post 4 | // 5 | // Created by Jeffrey Burt on 12/11/15. 6 | // Copyright © 2015 Atomic Object. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TutorialPageViewController: UIPageViewController { 12 | 13 | weak var tutorialDelegate: TutorialPageViewControllerDelegate? 14 | 15 | private(set) lazy var orderedViewControllers: [UIViewController] = { 16 | // The view controllers will be shown in this order 17 | return [self.newColoredViewController("Green"), 18 | self.newColoredViewController("Red"), 19 | self.newColoredViewController("Blue")] 20 | }() 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | 25 | dataSource = self 26 | delegate = self 27 | 28 | if let initialViewController = orderedViewControllers.first { 29 | scrollToViewController(viewController: initialViewController) 30 | } 31 | 32 | tutorialDelegate?.tutorialPageViewController(tutorialPageViewController: self, didUpdatePageCount: orderedViewControllers.count) 33 | } 34 | 35 | /** 36 | Scrolls to the next view controller. 37 | */ 38 | func scrollToNextViewController() { 39 | if let visibleViewController = viewControllers?.first, 40 | let nextViewController = pageViewController(self, viewControllerAfter: visibleViewController) { 41 | scrollToViewController(viewController: nextViewController) 42 | } 43 | } 44 | 45 | /** 46 | Scrolls to the view controller at the given index. Automatically calculates 47 | the direction. 48 | 49 | - parameter newIndex: the new index to scroll to 50 | */ 51 | func scrollToViewController(index newIndex: Int) { 52 | if let firstViewController = viewControllers?.first, 53 | let currentIndex = orderedViewControllers.firstIndex(of: firstViewController) { 54 | let direction: UIPageViewController.NavigationDirection = newIndex >= currentIndex ? .forward : .reverse 55 | let nextViewController = orderedViewControllers[newIndex] 56 | scrollToViewController(viewController: nextViewController, direction: direction) 57 | } 58 | } 59 | 60 | func newColoredViewController(_ color: String) -> UIViewController { 61 | return UIStoryboard(name: "Main", bundle: nil) . 62 | instantiateViewController(withIdentifier: "\(color)ViewController") 63 | } 64 | 65 | /** 66 | Scrolls to the given 'viewController' page. 67 | 68 | - parameter viewController: the view controller to show. 69 | */ 70 | private func scrollToViewController(viewController: UIViewController, 71 | direction: UIPageViewController.NavigationDirection = .forward) { 72 | setViewControllers([viewController], 73 | direction: direction, 74 | animated: true, 75 | completion: { (finished) -> Void in 76 | // Setting the view controller programmatically does not fire 77 | // any delegate methods, so we have to manually notify the 78 | // 'tutorialDelegate' of the new index. 79 | self.notifyTutorialDelegateOfNewIndex() 80 | }) 81 | } 82 | 83 | /** 84 | Notifies '_tutorialDelegate' that the current page index was updated. 85 | */ 86 | private func notifyTutorialDelegateOfNewIndex() { 87 | if let firstViewController = viewControllers?.first, 88 | let index = orderedViewControllers.firstIndex(of: firstViewController) { 89 | tutorialDelegate?.tutorialPageViewController(tutorialPageViewController: self, didUpdatePageIndex: index) 90 | } 91 | } 92 | 93 | } 94 | 95 | // MARK: UIPageViewControllerDataSource 96 | 97 | extension TutorialPageViewController: UIPageViewControllerDataSource { 98 | 99 | func pageViewController(_ pageViewController: UIPageViewController, 100 | viewControllerBefore viewController: UIViewController) -> UIViewController? { 101 | guard let viewControllerIndex = orderedViewControllers.firstIndex(of: viewController) else { 102 | return nil 103 | } 104 | 105 | let previousIndex = viewControllerIndex - 1 106 | 107 | // User is on the first view controller and swiped left to loop to 108 | // the last view controller. 109 | guard previousIndex >= 0 else { 110 | return orderedViewControllers.last 111 | } 112 | 113 | guard orderedViewControllers.count > previousIndex else { 114 | return nil 115 | } 116 | 117 | return orderedViewControllers[previousIndex] 118 | } 119 | 120 | func pageViewController(_ pageViewController: UIPageViewController, 121 | viewControllerAfter viewController: UIViewController) -> UIViewController? { 122 | guard let viewControllerIndex = orderedViewControllers.firstIndex(of: viewController) else { 123 | return nil 124 | } 125 | 126 | let nextIndex = viewControllerIndex + 1 127 | let orderedViewControllersCount = orderedViewControllers.count 128 | 129 | // User is on the last view controller and swiped right to loop to 130 | // the first view controller. 131 | guard orderedViewControllersCount != nextIndex else { 132 | return orderedViewControllers.first 133 | } 134 | 135 | guard orderedViewControllersCount > nextIndex else { 136 | return nil 137 | } 138 | 139 | return orderedViewControllers[nextIndex] 140 | } 141 | 142 | } 143 | 144 | extension TutorialPageViewController: UIPageViewControllerDelegate { 145 | 146 | func pageViewController(pageViewController: UIPageViewController, 147 | didFinishAnimating finished: Bool, 148 | previousViewControllers: [UIViewController], 149 | transitionCompleted completed: Bool) { 150 | notifyTutorialDelegateOfNewIndex() 151 | } 152 | 153 | } 154 | 155 | protocol TutorialPageViewControllerDelegate: class { 156 | 157 | /** 158 | Called when the number of pages is updated. 159 | 160 | - parameter tutorialPageViewController: the TutorialPageViewController instance 161 | - parameter count: the total number of pages. 162 | */ 163 | func tutorialPageViewController(tutorialPageViewController: TutorialPageViewController, 164 | didUpdatePageCount count: Int) 165 | 166 | /** 167 | Called when the current index is updated. 168 | 169 | - parameter tutorialPageViewController: the TutorialPageViewController instance 170 | - parameter index: the index of the currently visible page. 171 | */ 172 | func tutorialPageViewController(tutorialPageViewController: TutorialPageViewController, 173 | didUpdatePageIndex index: Int) 174 | 175 | } 176 | -------------------------------------------------------------------------------- /UIPageViewController Post/TutorialViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TutorialViewController.swift 3 | // UIPageViewController Post 4 | // 5 | // Created by Jeffrey Burt on 2/3/16. 6 | // Copyright © 2016 Seven Even. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TutorialViewController: UIViewController { 12 | 13 | @IBOutlet weak var pageControl: UIPageControl! 14 | @IBOutlet weak var containerView: UIView! 15 | 16 | var tutorialPageViewController: TutorialPageViewController? { 17 | didSet { 18 | tutorialPageViewController?.tutorialDelegate = self 19 | } 20 | } 21 | 22 | override func viewDidLoad() { 23 | super.viewDidLoad() 24 | pageControl.addTarget(self, action: Selector("didChangePageControlValue"), for: .valueChanged) 25 | } 26 | 27 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 28 | if let tutorialPageViewController = segue.destination as? TutorialPageViewController { 29 | self.tutorialPageViewController = tutorialPageViewController 30 | } 31 | } 32 | 33 | @IBAction func didTapNextButton(_ sender: Any) { 34 | tutorialPageViewController?.scrollToNextViewController() 35 | } 36 | 37 | /** 38 | Fired when the user taps on the pageControl to change its current page. 39 | */ 40 | func didChangePageControlValue() { 41 | tutorialPageViewController?.scrollToViewController(index: pageControl.currentPage) 42 | } 43 | } 44 | 45 | extension TutorialViewController: TutorialPageViewControllerDelegate { 46 | 47 | func tutorialPageViewController(tutorialPageViewController: TutorialPageViewController, 48 | didUpdatePageCount count: Int) { 49 | pageControl.numberOfPages = count 50 | } 51 | 52 | func tutorialPageViewController(tutorialPageViewController: TutorialPageViewController, 53 | didUpdatePageIndex index: Int) { 54 | pageControl.currentPage = index 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /UIPageViewController PostTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /UIPageViewController PostTests/UIPageViewController_PostTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIPageViewController_PostTests.swift 3 | // UIPageViewController PostTests 4 | // 5 | // Created by Jeffrey Burt on 12/11/15. 6 | // Copyright © 2015 Atomic Object. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import UIPageViewController_Post 11 | 12 | class UIPageViewController_PostTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /UIPageViewController PostUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /UIPageViewController PostUITests/UIPageViewController_PostUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIPageViewController_PostUITests.swift 3 | // UIPageViewController PostUITests 4 | // 5 | // Created by Jeffrey Burt on 12/11/15. 6 | // Copyright © 2015 Atomic Object. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class UIPageViewController_PostUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | --------------------------------------------------------------------------------