From e24383ff0dee2b10dad015bc48f0442d89037e09 Mon Sep 17 00:00:00 2001 From: Merrick Sapsford Date: Sat, 10 Oct 2020 14:50:25 +0200 Subject: [PATCH] Simplify Example Project (#250) * Remove BLTNBoard * Add configuration * Rename Examples project * Add new example target * Add bar buttons * Update assets * Add custom navigation bar * Add status bar style * Add status view * Remove legacy project --- .../Pageboy-Example.xcodeproj/project.pbxproj | 592 ------------------ Example/Pageboy-Example/ActionButton.swift | 36 -- Example/Pageboy-Example/AppDelegate.swift | 46 -- .../Assets.xcassets/Contents.json | 6 - .../Base.lproj/LaunchScreen.storyboard | 86 --- .../Base.lproj/Pageboy.storyboard | 143 ----- .../Pageboy-Example/ChildViewController.swift | 38 -- Example/Pageboy-Example/GradientView.swift | 115 ---- .../GradientViewController.swift | 77 --- Example/Pageboy-Example/Gradients.swift | 30 - Example/Pageboy-Example/Launch.storyboard | 79 --- .../PageModificationBulletinPage.swift | 122 ---- Example/Pageboy-Example/PageStatusView.swift | 45 -- Example/Pageboy-Example/PageStepper.swift | 147 ----- .../PageViewController+BarButtons.swift | 37 -- .../PageViewController+Bulletins.swift | 61 -- .../PageViewController+Settings.swift | 19 - .../Pageboy-Example/PageViewController.swift | 149 ----- .../SettingsBulletinDataSource.swift | 46 -- .../SettingsBulletinPage.swift | 168 ----- .../SettingsOptionButton.swift | 77 --- .../UIColor+Interpolation.swift | 43 -- .../UINavigationController+Utilities.swift | 20 - Pageboy.xcconfig | 4 + Pageboy.xcworkspace/contents.xcworkspacedata | 5 +- Sources/Examples.xcodeproj/project.pbxproj | 494 +++++++++++++++ .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 Sources/Pageboy.xcodeproj/project.pbxproj | 28 +- Sources/Shared/PageboyStatusView.swift | 127 ++++ Sources/iOS/AppDelegate.swift | 56 ++ .../AccentColor.colorset/Contents.json | 20 + .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/Icon.png | Bin .../AppIcon.appiconset/Icon@2x.png | Bin .../AppIcon.appiconset/Icon@3x.png | Bin .../AppIcon.appiconset/IconPad.png | Bin .../AppIcon.appiconset/IconPad@2x.png | Bin .../AppIcon.appiconset/IconPadPro.png | Bin Sources/iOS/Assets.xcassets/Contents.json | 6 + .../bg_logo_launch.imageset/Contents.json | 0 .../bg_logo_launch.png | Bin .../bg_logo_launch@2x.png | Bin .../bg_logo_launch@3x.png | Bin .../ic_minus.imageset/Contents.json | 0 .../ic_minus.imageset/ic_minus.pdf | Bin .../ic_plus.imageset/Contents.json | 0 .../ic_plus.imageset/ic_plus.pdf | Bin .../ic_welcome_icon.imageset/Contents.json | 0 .../ic_welcome_icon.png | Bin .../ic_welcome_icon@2x.png | Bin .../ic_welcome_icon@3x.png | Bin .../iOS/Base.lproj/LaunchScreen.storyboard | 53 ++ Sources/iOS/ChildViewController.swift | 48 ++ .../GradientBackgroundViewController.swift | 139 ++++ Sources/iOS/Extras/NavigationController.swift | 24 + .../Extras}/TransparentNavigationBar.swift | 27 +- Sources/iOS/Extras/UIColor+Pageboy.swift | 19 + .../iOS}/Info.plist | 16 +- Sources/iOS/PageViewController.swift | 61 ++ 60 files changed, 1099 insertions(+), 2210 deletions(-) delete mode 100644 Example/Pageboy-Example.xcodeproj/project.pbxproj delete mode 100644 Example/Pageboy-Example/ActionButton.swift delete mode 100644 Example/Pageboy-Example/AppDelegate.swift delete mode 100644 Example/Pageboy-Example/Assets.xcassets/Contents.json delete mode 100644 Example/Pageboy-Example/Base.lproj/LaunchScreen.storyboard delete mode 100644 Example/Pageboy-Example/Base.lproj/Pageboy.storyboard delete mode 100644 Example/Pageboy-Example/ChildViewController.swift delete mode 100644 Example/Pageboy-Example/GradientView.swift delete mode 100644 Example/Pageboy-Example/GradientViewController.swift delete mode 100644 Example/Pageboy-Example/Gradients.swift delete mode 100644 Example/Pageboy-Example/Launch.storyboard delete mode 100644 Example/Pageboy-Example/PageModificationBulletinPage.swift delete mode 100644 Example/Pageboy-Example/PageStatusView.swift delete mode 100644 Example/Pageboy-Example/PageStepper.swift delete mode 100644 Example/Pageboy-Example/PageViewController+BarButtons.swift delete mode 100644 Example/Pageboy-Example/PageViewController+Bulletins.swift delete mode 100644 Example/Pageboy-Example/PageViewController+Settings.swift delete mode 100644 Example/Pageboy-Example/PageViewController.swift delete mode 100644 Example/Pageboy-Example/SettingsBulletinDataSource.swift delete mode 100644 Example/Pageboy-Example/SettingsBulletinPage.swift delete mode 100644 Example/Pageboy-Example/SettingsOptionButton.swift delete mode 100644 Example/Pageboy-Example/UIColor+Interpolation.swift delete mode 100644 Example/Pageboy-Example/UINavigationController+Utilities.swift create mode 100644 Pageboy.xcconfig create mode 100644 Sources/Examples.xcodeproj/project.pbxproj rename {Example/Pageboy-Example.xcodeproj => Sources/Examples.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename {Example/Pageboy-Example.xcodeproj => Sources/Examples.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) create mode 100644 Sources/Shared/PageboyStatusView.swift create mode 100644 Sources/iOS/AppDelegate.swift create mode 100644 Sources/iOS/Assets.xcassets/AccentColor.colorset/Contents.json rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/Icon.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/Icon@2x.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/Icon@3x.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/IconPad.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/IconPad@2x.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/AppIcon.appiconset/IconPadPro.png (100%) create mode 100644 Sources/iOS/Assets.xcassets/Contents.json rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/bg_logo_launch.imageset/Contents.json (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@2x.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@3x.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_minus.imageset/Contents.json (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_minus.imageset/ic_minus.pdf (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_plus.imageset/Contents.json (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_plus.imageset/ic_plus.pdf (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_welcome_icon.imageset/Contents.json (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@2x.png (100%) rename {Example/Pageboy-Example => Sources/iOS}/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@3x.png (100%) create mode 100644 Sources/iOS/Base.lproj/LaunchScreen.storyboard create mode 100644 Sources/iOS/ChildViewController.swift create mode 100644 Sources/iOS/Extras/GradientBackgroundViewController.swift create mode 100644 Sources/iOS/Extras/NavigationController.swift rename {Example/Pageboy-Example => Sources/iOS/Extras}/TransparentNavigationBar.swift (80%) create mode 100644 Sources/iOS/Extras/UIColor+Pageboy.swift rename {Example/Pageboy-Example => Sources/iOS}/Info.plist (84%) create mode 100644 Sources/iOS/PageViewController.swift diff --git a/Example/Pageboy-Example.xcodeproj/project.pbxproj b/Example/Pageboy-Example.xcodeproj/project.pbxproj deleted file mode 100644 index addaef2c..00000000 --- a/Example/Pageboy-Example.xcodeproj/project.pbxproj +++ /dev/null @@ -1,592 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4603D7722103701E00FA0F23 /* PageViewController+Bulletins.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4603D7712103701E00FA0F23 /* PageViewController+Bulletins.swift */; }; - 4603D77A21060C8600FA0F23 /* SettingsBulletinPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4603D77921060C8600FA0F23 /* SettingsBulletinPage.swift */; }; - 4603D77E2106148A00FA0F23 /* SettingsOptionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4603D77D2106148A00FA0F23 /* SettingsOptionButton.swift */; }; - 4603D78021061DA200FA0F23 /* PageModificationBulletinPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4603D77F21061DA200FA0F23 /* PageModificationBulletinPage.swift */; }; - 4604839420FFC8770053AD8E /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4604839320FFC8770053AD8E /* Launch.storyboard */; }; - 4604839820FFCEF00053AD8E /* PageStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4604839720FFCEF00053AD8E /* PageStatusView.swift */; }; - 465DC36221075BC600E08287 /* PageStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465DC36121075BC600E08287 /* PageStepper.swift */; }; - 466E8D552100FCE700471998 /* ActionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 466E8D542100FCE700471998 /* ActionButton.swift */; }; - 466E8D592101001F00471998 /* PageViewController+Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 466E8D582101001F00471998 /* PageViewController+Settings.swift */; }; - 46A32DBA20FF7ADC003AEAFC /* Gradients.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46A32DB920FF7ADC003AEAFC /* Gradients.swift */; }; - 46A32DC120FF7BBC003AEAFC /* UIColor+Interpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46A32DC020FF7BBC003AEAFC /* UIColor+Interpolation.swift */; }; - 46A32DC320FF7DA8003AEAFC /* GradientViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46A32DC220FF7DA8003AEAFC /* GradientViewController.swift */; }; - 46B7BD79217905500041EFFC /* BLTNBoard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46B7BD74217905500041EFFC /* BLTNBoard.framework */; }; - 46EDC8F7210368B400675EC3 /* SettingsBulletinDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46EDC8F6210368B400675EC3 /* SettingsBulletinDataSource.swift */; }; - D623B1E21E1D32D700527F3D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D623B1E11E1D32D700527F3D /* AppDelegate.swift */; }; - D623B1E41E1D32D700527F3D /* PageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D623B1E31E1D32D700527F3D /* PageViewController.swift */; }; - D623B1E71E1D32D700527F3D /* Pageboy.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D623B1E51E1D32D700527F3D /* Pageboy.storyboard */; }; - D623B1E91E1D32D700527F3D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D623B1E81E1D32D700527F3D /* Assets.xcassets */; }; - D623B1EC1E1D32D700527F3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D623B1EA1E1D32D700527F3D /* LaunchScreen.storyboard */; }; - D681E3331E546A90007C08F5 /* Pageboy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D681E3241E546A7D007C08F5 /* Pageboy.framework */; }; - D681E3341E546A90007C08F5 /* Pageboy.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D681E3241E546A7D007C08F5 /* Pageboy.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D681E3511E54959B007C08F5 /* GradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D681E3501E54959B007C08F5 /* GradientView.swift */; }; - D681E3541E549F7E007C08F5 /* PageViewController+BarButtons.swift in Sources */ = {isa = PBXBuildFile; fileRef = D681E3531E549F7E007C08F5 /* PageViewController+BarButtons.swift */; }; - D681E3561E54ABE8007C08F5 /* TransparentNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = D681E3551E54ABE8007C08F5 /* TransparentNavigationBar.swift */; }; - D6ECCEC61E51B6FB00E9D5B3 /* ChildViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6ECCEC51E51B6FB00E9D5B3 /* ChildViewController.swift */; }; - E8F663AB1E9C387D00F601AC /* UINavigationController+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8F663AA1E9C387D00F601AC /* UINavigationController+Utilities.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 466A76D31FB4EFC9000B5C1C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D63A21501F2758D700FEA92D; - remoteInfo = "Pageboy tvOS"; - }; - D681E3231E546A7D007C08F5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D623B1B71E1D0C6A00527F3D; - remoteInfo = Pageboy; - }; - D681E3251E546A7D007C08F5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D623B1C01E1D0C6B00527F3D; - remoteInfo = PageboyTests; - }; - D681E3351E546A90007C08F5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D623B1B61E1D0C6A00527F3D; - remoteInfo = Pageboy; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - D6E73A701E51F7C400A8D5A5 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - D681E3341E546A90007C08F5 /* Pageboy.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 4603D7712103701E00FA0F23 /* PageViewController+Bulletins.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PageViewController+Bulletins.swift"; sourceTree = ""; }; - 4603D77921060C8600FA0F23 /* SettingsBulletinPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsBulletinPage.swift; sourceTree = ""; }; - 4603D77D2106148A00FA0F23 /* SettingsOptionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsOptionButton.swift; sourceTree = ""; }; - 4603D77F21061DA200FA0F23 /* PageModificationBulletinPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageModificationBulletinPage.swift; sourceTree = ""; }; - 4604839320FFC8770053AD8E /* Launch.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Launch.storyboard; sourceTree = ""; }; - 4604839720FFCEF00053AD8E /* PageStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageStatusView.swift; sourceTree = ""; }; - 465DC36121075BC600E08287 /* PageStepper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageStepper.swift; sourceTree = ""; }; - 466E8D542100FCE700471998 /* ActionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionButton.swift; sourceTree = ""; }; - 466E8D582101001F00471998 /* PageViewController+Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PageViewController+Settings.swift"; sourceTree = ""; }; - 46A32DB920FF7ADC003AEAFC /* Gradients.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gradients.swift; sourceTree = ""; }; - 46A32DC020FF7BBC003AEAFC /* UIColor+Interpolation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Interpolation.swift"; sourceTree = ""; }; - 46A32DC220FF7DA8003AEAFC /* GradientViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientViewController.swift; sourceTree = ""; }; - 46B7BD74217905500041EFFC /* BLTNBoard.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BLTNBoard.framework; path = ../Carthage/Build/iOS/BLTNBoard.framework; sourceTree = ""; }; - 46EDC8F6210368B400675EC3 /* SettingsBulletinDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsBulletinDataSource.swift; sourceTree = ""; }; - D623B1DE1E1D32D700527F3D /* Pageboy-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Pageboy-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - D623B1E11E1D32D700527F3D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - D623B1E31E1D32D700527F3D /* PageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageViewController.swift; sourceTree = ""; }; - D623B1E61E1D32D700527F3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Pageboy.storyboard; sourceTree = ""; }; - D623B1E81E1D32D700527F3D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - D623B1EB1E1D32D700527F3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - D623B1ED1E1D32D700527F3D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pageboy.xcodeproj; path = ../Sources/Pageboy.xcodeproj; sourceTree = ""; }; - D681E3501E54959B007C08F5 /* GradientView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GradientView.swift; sourceTree = ""; }; - D681E3531E549F7E007C08F5 /* PageViewController+BarButtons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PageViewController+BarButtons.swift"; sourceTree = ""; }; - D681E3551E54ABE8007C08F5 /* TransparentNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransparentNavigationBar.swift; sourceTree = ""; }; - D6ECCEC51E51B6FB00E9D5B3 /* ChildViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChildViewController.swift; sourceTree = ""; }; - E8F663AA1E9C387D00F601AC /* UINavigationController+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Utilities.swift"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D623B1DB1E1D32D700527F3D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D681E3331E546A90007C08F5 /* Pageboy.framework in Frameworks */, - 46B7BD79217905500041EFFC /* BLTNBoard.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 46A32DBD20FF7B95003AEAFC /* Utilities */ = { - isa = PBXGroup; - children = ( - E8F663AA1E9C387D00F601AC /* UINavigationController+Utilities.swift */, - 46A32DC020FF7BBC003AEAFC /* UIColor+Interpolation.swift */, - ); - name = Utilities; - sourceTree = ""; - }; - 46A32DBE20FF7B9D003AEAFC /* Components */ = { - isa = PBXGroup; - children = ( - D681E3501E54959B007C08F5 /* GradientView.swift */, - D681E3551E54ABE8007C08F5 /* TransparentNavigationBar.swift */, - 46A32DC220FF7DA8003AEAFC /* GradientViewController.swift */, - 4604839720FFCEF00053AD8E /* PageStatusView.swift */, - 466E8D542100FCE700471998 /* ActionButton.swift */, - 4603D77D2106148A00FA0F23 /* SettingsOptionButton.swift */, - 465DC36121075BC600E08287 /* PageStepper.swift */, - ); - name = Components; - sourceTree = ""; - }; - 46A32DBF20FF7BA5003AEAFC /* Styling */ = { - isa = PBXGroup; - children = ( - 46A32DB920FF7ADC003AEAFC /* Gradients.swift */, - ); - name = Styling; - sourceTree = ""; - }; - 46EDC8F5210368A400675EC3 /* Settings */ = { - isa = PBXGroup; - children = ( - 46EDC8F6210368B400675EC3 /* SettingsBulletinDataSource.swift */, - 4603D77921060C8600FA0F23 /* SettingsBulletinPage.swift */, - 4603D77F21061DA200FA0F23 /* PageModificationBulletinPage.swift */, - ); - name = Settings; - sourceTree = ""; - }; - D623B1D51E1D32D700527F3D = { - isa = PBXGroup; - children = ( - D623B1E01E1D32D700527F3D /* Pageboy-Example */, - D6CC55831ECCCCB700A7FBB4 /* Frameworks */, - D623B1DF1E1D32D700527F3D /* Products */, - ); - sourceTree = ""; - }; - D623B1DF1E1D32D700527F3D /* Products */ = { - isa = PBXGroup; - children = ( - D623B1DE1E1D32D700527F3D /* Pageboy-Example.app */, - ); - name = Products; - sourceTree = ""; - }; - D623B1E01E1D32D700527F3D /* Pageboy-Example */ = { - isa = PBXGroup; - children = ( - D623B1E11E1D32D700527F3D /* AppDelegate.swift */, - D623B1E31E1D32D700527F3D /* PageViewController.swift */, - D6ECCEC51E51B6FB00E9D5B3 /* ChildViewController.swift */, - D623B1E51E1D32D700527F3D /* Pageboy.storyboard */, - D681E3521E54959F007C08F5 /* Extras */, - D681E34F1E549508007C08F5 /* Resources */, - ); - path = "Pageboy-Example"; - sourceTree = ""; - }; - D681E31F1E546A7D007C08F5 /* Products */ = { - isa = PBXGroup; - children = ( - D681E3241E546A7D007C08F5 /* Pageboy.framework */, - 466A76D41FB4EFC9000B5C1C /* Pageboy.framework */, - D681E3261E546A7D007C08F5 /* PageboyTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - D681E34F1E549508007C08F5 /* Resources */ = { - isa = PBXGroup; - children = ( - D623B1E81E1D32D700527F3D /* Assets.xcassets */, - D623B1EA1E1D32D700527F3D /* LaunchScreen.storyboard */, - D623B1ED1E1D32D700527F3D /* Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - D681E3521E54959F007C08F5 /* Extras */ = { - isa = PBXGroup; - children = ( - 4604839320FFC8770053AD8E /* Launch.storyboard */, - D681E3531E549F7E007C08F5 /* PageViewController+BarButtons.swift */, - 4603D7712103701E00FA0F23 /* PageViewController+Bulletins.swift */, - 466E8D582101001F00471998 /* PageViewController+Settings.swift */, - 46EDC8F5210368A400675EC3 /* Settings */, - 46A32DBF20FF7BA5003AEAFC /* Styling */, - 46A32DBE20FF7B9D003AEAFC /* Components */, - 46A32DBD20FF7B95003AEAFC /* Utilities */, - ); - name = Extras; - sourceTree = ""; - }; - D6CC55831ECCCCB700A7FBB4 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 46B7BD74217905500041EFFC /* BLTNBoard.framework */, - D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - D623B1DD1E1D32D700527F3D /* Pageboy-Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = D623B1F01E1D32D700527F3D /* Build configuration list for PBXNativeTarget "Pageboy-Example" */; - buildPhases = ( - D623B1DA1E1D32D700527F3D /* Sources */, - D623B1DB1E1D32D700527F3D /* Frameworks */, - D623B1DC1E1D32D700527F3D /* Resources */, - D6E73A701E51F7C400A8D5A5 /* Embed Frameworks */, - 46B7BD7A217905650041EFFC /* Copy Carthage Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - D681E3361E546A90007C08F5 /* PBXTargetDependency */, - ); - name = "Pageboy-Example"; - productName = "Pageboy-Example"; - productReference = D623B1DE1E1D32D700527F3D /* Pageboy-Example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D623B1D61E1D32D700527F3D /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 1100; - ORGANIZATIONNAME = "UI At Six"; - TargetAttributes = { - D623B1DD1E1D32D700527F3D = { - CreatedOnToolsVersion = 8.2; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = D623B1D91E1D32D700527F3D /* Build configuration list for PBXProject "Pageboy-Example" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = D623B1D51E1D32D700527F3D; - productRefGroup = D623B1DF1E1D32D700527F3D /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = D681E31F1E546A7D007C08F5 /* Products */; - ProjectRef = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - D623B1DD1E1D32D700527F3D /* Pageboy-Example */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 466A76D41FB4EFC9000B5C1C /* Pageboy.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Pageboy.framework; - remoteRef = 466A76D31FB4EFC9000B5C1C /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - D681E3241E546A7D007C08F5 /* Pageboy.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Pageboy.framework; - remoteRef = D681E3231E546A7D007C08F5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - D681E3261E546A7D007C08F5 /* PageboyTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = PageboyTests.xctest; - remoteRef = D681E3251E546A7D007C08F5 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - D623B1DC1E1D32D700527F3D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D623B1EC1E1D32D700527F3D /* LaunchScreen.storyboard in Resources */, - D623B1E91E1D32D700527F3D /* Assets.xcassets in Resources */, - D623B1E71E1D32D700527F3D /* Pageboy.storyboard in Resources */, - 4604839420FFC8770053AD8E /* Launch.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 46B7BD7A217905650041EFFC /* Copy Carthage Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "$(SRCROOT)/../Carthage/Build/iOS/BLTNBoard.framework", - ); - name = "Copy Carthage Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/BLTNBoard.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/local/bin/carthage copy-frameworks\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - D623B1DA1E1D32D700527F3D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D623B1E41E1D32D700527F3D /* PageViewController.swift in Sources */, - D623B1E21E1D32D700527F3D /* AppDelegate.swift in Sources */, - 4603D77E2106148A00FA0F23 /* SettingsOptionButton.swift in Sources */, - 4603D77A21060C8600FA0F23 /* SettingsBulletinPage.swift in Sources */, - 4603D7722103701E00FA0F23 /* PageViewController+Bulletins.swift in Sources */, - 46A32DC320FF7DA8003AEAFC /* GradientViewController.swift in Sources */, - 46A32DBA20FF7ADC003AEAFC /* Gradients.swift in Sources */, - 466E8D592101001F00471998 /* PageViewController+Settings.swift in Sources */, - 46A32DC120FF7BBC003AEAFC /* UIColor+Interpolation.swift in Sources */, - 46EDC8F7210368B400675EC3 /* SettingsBulletinDataSource.swift in Sources */, - 4603D78021061DA200FA0F23 /* PageModificationBulletinPage.swift in Sources */, - 4604839820FFCEF00053AD8E /* PageStatusView.swift in Sources */, - 465DC36221075BC600E08287 /* PageStepper.swift in Sources */, - D681E3561E54ABE8007C08F5 /* TransparentNavigationBar.swift in Sources */, - D681E3541E549F7E007C08F5 /* PageViewController+BarButtons.swift in Sources */, - D681E3511E54959B007C08F5 /* GradientView.swift in Sources */, - D6ECCEC61E51B6FB00E9D5B3 /* ChildViewController.swift in Sources */, - E8F663AB1E9C387D00F601AC /* UINavigationController+Utilities.swift in Sources */, - 466E8D552100FCE700471998 /* ActionButton.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - D681E3361E546A90007C08F5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Pageboy; - targetProxy = D681E3351E546A90007C08F5 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - D623B1E51E1D32D700527F3D /* Pageboy.storyboard */ = { - isa = PBXVariantGroup; - children = ( - D623B1E61E1D32D700527F3D /* Base */, - ); - name = Pageboy.storyboard; - sourceTree = ""; - }; - D623B1EA1E1D32D700527F3D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - D623B1EB1E1D32D700527F3D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - D623B1EE1E1D32D700527F3D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - D623B1EF1E1D32D700527F3D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - D623B1F11E1D32D700527F3D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../Carthage/Build/iOS"; - INFOPLIST_FILE = "Pageboy-Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.uias.Pageboy-Example"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - D623B1F21E1D32D700527F3D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../Carthage/Build/iOS"; - INFOPLIST_FILE = "Pageboy-Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.uias.Pageboy-Example"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - D623B1D91E1D32D700527F3D /* Build configuration list for PBXProject "Pageboy-Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D623B1EE1E1D32D700527F3D /* Debug */, - D623B1EF1E1D32D700527F3D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D623B1F01E1D32D700527F3D /* Build configuration list for PBXNativeTarget "Pageboy-Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D623B1F11E1D32D700527F3D /* Debug */, - D623B1F21E1D32D700527F3D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D623B1D61E1D32D700527F3D /* Project object */; -} diff --git a/Example/Pageboy-Example/ActionButton.swift b/Example/Pageboy-Example/ActionButton.swift deleted file mode 100644 index 576712fc..00000000 --- a/Example/Pageboy-Example/ActionButton.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ActionButton.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 19/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -@IBDesignable class ActionButton: UIButton { - - // MARK: Defaults - - private struct Defaults { - static let backgroundColor = UIColor.white.withAlphaComponent(0.2) - static let highlightedBackgroundColor = UIColor.white.withAlphaComponent(0.5) - } - - override var isHighlighted: Bool { - didSet { - UIView.animate(withDuration: 0.2) { - self.backgroundColor = self.isHighlighted ? Defaults.highlightedBackgroundColor : Defaults.backgroundColor - } - } - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - - layer.borderColor = UIColor.white.cgColor - layer.borderWidth = 1.0 - layer.cornerRadius = 16.0 - backgroundColor = Defaults.backgroundColor - } -} diff --git a/Example/Pageboy-Example/AppDelegate.swift b/Example/Pageboy-Example/AppDelegate.swift deleted file mode 100644 index cd3aed56..00000000 --- a/Example/Pageboy-Example/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 04/01/2017. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // 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. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // 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. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // 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. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/Example/Pageboy-Example/Assets.xcassets/Contents.json b/Example/Pageboy-Example/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c..00000000 --- a/Example/Pageboy-Example/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Example/Pageboy-Example/Base.lproj/LaunchScreen.storyboard b/Example/Pageboy-Example/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f744dfef..00000000 --- a/Example/Pageboy-Example/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Pageboy-Example/Base.lproj/Pageboy.storyboard b/Example/Pageboy-Example/Base.lproj/Pageboy.storyboard deleted file mode 100644 index 7dcf7489..00000000 --- a/Example/Pageboy-Example/Base.lproj/Pageboy.storyboard +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Pageboy-Example/ChildViewController.swift b/Example/Pageboy-Example/ChildViewController.swift deleted file mode 100644 index 2485ad22..00000000 --- a/Example/Pageboy-Example/ChildViewController.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// ChildViewController.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 13/02/2017. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -class ChildViewController: UIViewController { - - @IBOutlet private weak var label: UILabel! - @IBOutlet private weak var promptLabel: UILabel! - - override var preferredStatusBarStyle: UIStatusBarStyle { - return .lightContent - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - updateIndexLabel() - } - - private func updateIndexLabel() { - if let index = (pageboyParent as? PageViewController)?.viewControllers.firstIndex(of: self) { - label.text = "Page " + String(index + 1) - - let isFirstPage = index == 0 - - var prompt = "(Index \(index))" - if isFirstPage { - prompt.append("\n\nswipe me >") - } - promptLabel.text = prompt - } - } -} diff --git a/Example/Pageboy-Example/GradientView.swift b/Example/Pageboy-Example/GradientView.swift deleted file mode 100644 index 42bc0af6..00000000 --- a/Example/Pageboy-Example/GradientView.swift +++ /dev/null @@ -1,115 +0,0 @@ -// -// GradientView.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 15/02/2017. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -@IBDesignable class GradientView: UIView { - - enum Direction { - case topToBottom - case leftToRight - case rightToLeft - case bottomToTop - } - - // MARK: Properties - - var gradientLayer: CAGradientLayer? { - get { - if let gradientLayer = self.layer as? CAGradientLayer { - return gradientLayer - } - return nil - } - } - - var colors: [UIColor]? = nil { - didSet { - self.updateGradient() - } - } - - var locations: [Double]? = nil { - didSet { - self.updateGradient() - } - } - - var direction: Direction = .topToBottom { - didSet { - self.updateGradient() - } - } - - // MARK: Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - self.updateGradient() - } - - override class var layerClass: AnyClass { - return CAGradientLayer.self - } - - func setColors(_ colors: [UIColor], animated: Bool, duration: Double = 0.3) { - let fromColors = self.colors - self.colors = colors - if animated { - let animation = CABasicAnimation(keyPath: "colors") - animation.fromValue = fromColors - animation.toValue = colors - animation.duration = duration - animation.isRemovedOnCompletion = true - animation.fillMode = .forwards - animation.timingFunction = CAMediaTimingFunction(name: .linear) - gradientLayer?.add(animation, forKey: "colors") - } - } - - // MARK: Gradient - - func updateGradient() { - guard let colors = self.colors else { - gradientLayer?.colors = [] - return - } - - var colorRefs = [CGColor]() - for color in colors { - colorRefs.append(color.cgColor) - } - gradientLayer?.colors = colorRefs - - if let locations = self.locations { - var locationNumbers = [NSNumber]() - for location in locations { - locationNumbers.append(NSNumber(value: location)) - } - gradientLayer?.locations = locationNumbers - } - - switch direction { - case .topToBottom: - gradientLayer?.startPoint = CGPoint(x: 0.5, y: 0.0) - gradientLayer?.endPoint = CGPoint(x: 0.5, y: 1.0) - - case .leftToRight: - gradientLayer?.startPoint = CGPoint(x: 0.0, y: 0.5) - gradientLayer?.endPoint = CGPoint(x: 1.0, y: 0.5) - - case .rightToLeft: - gradientLayer?.startPoint = CGPoint(x: 1.0, y: 0.5) - gradientLayer?.endPoint = CGPoint(x: 0.0, y: 0.5) - - case .bottomToTop: - gradientLayer?.startPoint = CGPoint(x: 0.5, y: 1.0) - gradientLayer?.endPoint = CGPoint(x: 0.5, y: 0.0) - } - } -} diff --git a/Example/Pageboy-Example/GradientViewController.swift b/Example/Pageboy-Example/GradientViewController.swift deleted file mode 100644 index ef8fbe2a..00000000 --- a/Example/Pageboy-Example/GradientViewController.swift +++ /dev/null @@ -1,77 +0,0 @@ -// -// GradientViewController.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 18/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -class GradientViewController: UIViewController { - - // MARK: Properties - - @IBOutlet private var gradientView: GradientView! - - var gradients: [Gradient]? { - didSet { - update(for: gradientOffset) - } - } - - var gradientOffset: CGFloat = 0.0 { - didSet { - update(for: gradientOffset) - } - } - - var activeColors: [UIColor]? { - return gradientView.colors - } - - override var childForStatusBarStyle: UIViewController? { - return children.first - } - override var childForStatusBarHidden: UIViewController? { - return children.first - } - - // MARK: Lifecycle - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - setNeedsStatusBarAppearanceUpdate() - } - - // MARK: Updating - - private func update(for offset: CGFloat) { - var sanitizedOffset = offset - if sanitizedOffset < 0.0 { - sanitizedOffset = 1.0 + sanitizedOffset - } - - var integral: Double = 0.0 - let percentage = CGFloat(modf(Double(sanitizedOffset), &integral)) - let lowerIndex = Int(floor(offset)) - let upperIndex = Int(ceil(offset)) - - let lowerGradient = gradient(for: lowerIndex) - let upperGradient = gradient(for: upperIndex) - - if let top = lowerGradient.top.interpolate(between: upperGradient.top, percent: percentage), - let bottom = lowerGradient.bottom.interpolate(between: upperGradient.bottom, percent: percentage) { - gradientView.colors = [top, bottom] - } - } - - private func gradient(for index: Int) -> Gradient { - guard let gradients = self.gradients, index >= 0 && index < gradients.count else { - return .defaultGradient - } - - return gradients[index] - } -} diff --git a/Example/Pageboy-Example/Gradients.swift b/Example/Pageboy-Example/Gradients.swift deleted file mode 100644 index 44ef8901..00000000 --- a/Example/Pageboy-Example/Gradients.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// Gradients.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 18/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -class Gradients { - - static var all: [Gradient] { - return [Gradient(top: UIColor(red:0.01, green:0.00, blue:0.18, alpha:1.0), bottom: UIColor(red:0.00, green:0.53, blue:0.80, alpha:1.0)), - Gradient(top: UIColor(red:0.20, green:0.08, blue:0.00, alpha:1.0), bottom: UIColor(red:0.69, green:0.36, blue:0.00, alpha:1.0)), - Gradient(top: UIColor(red:0.00, green:0.13, blue:0.05, alpha:1.0), bottom: UIColor(red:0.00, green:0.65, blue:0.33, alpha:1.0)), - Gradient(top: UIColor(red:0.18, green:0.00, blue:0.20, alpha:1.0), bottom: UIColor(red:0.64, green:0.00, blue:0.66, alpha:1.0)), - Gradient(top: UIColor(red:0.20, green:0.00, blue:0.00, alpha:1.0), bottom: UIColor(red:0.69, green:0.00, blue:0.00, alpha:1.0))] - } -} - -struct Gradient { - - let top: UIColor - let bottom: UIColor - - static var defaultGradient: Gradient { - return Gradient(top: .black, bottom: .black) - } -} diff --git a/Example/Pageboy-Example/Launch.storyboard b/Example/Pageboy-Example/Launch.storyboard deleted file mode 100644 index 678f8121..00000000 --- a/Example/Pageboy-Example/Launch.storyboard +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Pageboy-Example/PageModificationBulletinPage.swift b/Example/Pageboy-Example/PageModificationBulletinPage.swift deleted file mode 100644 index ba6569a6..00000000 --- a/Example/Pageboy-Example/PageModificationBulletinPage.swift +++ /dev/null @@ -1,122 +0,0 @@ -// -// PageModificationBulletinPage.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 23/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit -import BLTNBoard -import Pageboy - -class PageModificationBulletinPage: BLTNPageItem { - - // MARK: Types - - enum ModificationOption: String, CaseIterable { - case insertion = "Insert" - case removal = "Remove" - } - - // MARK: Properties - - private var pageStepper: PageStepper! - private var optionSegmentedControl: UISegmentedControl! - - private weak var pageViewController: PageboyViewController! - - var modificationOption: ModificationOption { - return ModificationOption.allCases[optionSegmentedControl.selectedSegmentIndex] - } - var pageIndex: Int { - return pageStepper.currentPage - } - - // MARK: Init - - init(title: String, pageViewController: PageboyViewController) { - self.pageViewController = pageViewController - super.init(title: title) - - self.actionButtonTitle = "Confirm" - self.requiresCloseButton = false - } - - // MARK: Lifecycle - - override func makeViewsUnderTitle(with interfaceBuilder: BLTNInterfaceBuilder) -> [UIView]? { - let stack = interfaceBuilder.makeGroupStack(spacing: 16.0) - - let intentPrompt = makePromptLabel() - intentPrompt.text = "I want to" - stack.addArrangedSubview(intentPrompt) - - let optionSegmentedControl = makeOptionSegmentedControl(for: ModificationOption.allCases) - optionSegmentedControl.addTarget(self, action: #selector(modificationOptionUpdated(_:)), for: .valueChanged) - stack.addArrangedSubview(optionSegmentedControl) - self.optionSegmentedControl = optionSegmentedControl - - let indexPrompt = makePromptLabel() - indexPrompt.text = "at page index" - stack.addArrangedSubview(indexPrompt) - - let stepper = makePageStepper() - stack.addArrangedSubview(stepper) - self.pageStepper = stepper - updateNumberOfPages(for: .insertion) - - return [stack] - } - - // MARK: Actions - - @objc private func modificationOptionUpdated(_ sender: UISegmentedControl) { - let option = ModificationOption.allCases[sender.selectedSegmentIndex] - updateNumberOfPages(for: option) - } - - private func updateNumberOfPages(for option: ModificationOption) { - guard let pageCount = pageViewController.pageCount else { - pageStepper.numberOfPages = 0 - return - } - - switch option { - case .insertion: - pageStepper.numberOfPages = pageCount + 1 - case .removal: - pageStepper.numberOfPages = pageCount - } - } -} - -extension PageModificationBulletinPage { - - private func makePromptLabel() -> UILabel { - let label = UILabel() - label.font = UIFont.systemFont(ofSize: 18.0) - label.textColor = .gray - label.numberOfLines = 0 - label.textAlignment = .center - return label - } - - private func makePageStepper() -> PageStepper { - let stepper = PageStepper() - stepper.tintColor = appearance.actionButtonColor - return stepper - } - - private func makeOptionSegmentedControl(for options: [ModificationOption]) -> UISegmentedControl { - let segmentedControl = UISegmentedControl(items: options.map({ $0.rawValue })) - - segmentedControl.tintColor = appearance.actionButtonColor - segmentedControl.selectedSegmentIndex = 0 - - let constraint = segmentedControl.heightAnchor.constraint(equalToConstant: 40.0) - constraint.isActive = true - - return segmentedControl - } -} diff --git a/Example/Pageboy-Example/PageStatusView.swift b/Example/Pageboy-Example/PageStatusView.swift deleted file mode 100644 index c88014b8..00000000 --- a/Example/Pageboy-Example/PageStatusView.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// PageStatusView.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 18/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -class PageStatusView: UIView { - - // MARK: Properties - - @IBOutlet private weak var countLabel: UILabel! - @IBOutlet private weak var positionLabel: UILabel! - @IBOutlet private weak var indexLabel: UILabel! - - var numberOfPages: Int = 0 { - didSet { - countLabel.text = "Page Count: \(numberOfPages)" - } - } - var currentPosition: CGFloat = 0.0 { - didSet { - positionLabel.text = "Current Position: \(String(format: "%.3f", currentPosition))" - } - } - var currentIndex: Int = 0 { - didSet { - currentPosition = CGFloat(currentIndex) - indexLabel.text = "Current Page: \(currentIndex)" - } - } - - // MARK: Init - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - - numberOfPages = 0 - currentPosition = 0.0 - currentIndex = 0 - } -} diff --git a/Example/Pageboy-Example/PageStepper.swift b/Example/Pageboy-Example/PageStepper.swift deleted file mode 100644 index c5930bf3..00000000 --- a/Example/Pageboy-Example/PageStepper.swift +++ /dev/null @@ -1,147 +0,0 @@ -// -// PageStepper.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 24/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -class PageStepper: UIControl { - - private enum ButtonType { - case negative - case positive - } - - // MARK: Properties - - private var negativeButton: UIButton! - private var positiveButton: UIButton! - private var statusLabel: UILabel! - - var numberOfPages: Int = 0 { - didSet { - currentPage = 0 - } - } - private(set) var currentPage: Int = 0 { - didSet { - update(for: currentPage) - } - } - - override var tintColor: UIColor! { - didSet { - negativeButton.tintColor = tintColor - positiveButton.tintColor = tintColor - } - } - - // MARK: Init - - convenience init() { - self.init(frame: .zero) - } - - override init(frame: CGRect) { - super.init(frame: frame) - initialize() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - initialize() - } - - private func initialize() { - - let negativeButton = makeStepperButton(for: .negative) - negativeButton.addTarget(self, action: #selector(negativeButtonPressed(_:)), for: .touchUpInside) - addSubview(negativeButton) - negativeButton.translatesAutoresizingMaskIntoConstraints = false - NSLayoutConstraint.activate([ - negativeButton.leadingAnchor.constraint(equalTo: leadingAnchor), - negativeButton.topAnchor.constraint(equalTo: topAnchor), - negativeButton.bottomAnchor.constraint(equalTo: bottomAnchor) - ]) - self.negativeButton = negativeButton - - let positiveButton = makeStepperButton(for: .positive) - positiveButton.addTarget(self, action: #selector(positiveButtonPressed(_:)), for: .touchUpInside) - addSubview(positiveButton) - positiveButton.translatesAutoresizingMaskIntoConstraints = false - NSLayoutConstraint.activate([ - positiveButton.trailingAnchor.constraint(equalTo: trailingAnchor), - positiveButton.topAnchor.constraint(equalTo: topAnchor), - positiveButton.bottomAnchor.constraint(equalTo: bottomAnchor) - ]) - self.positiveButton = positiveButton - - let statusLabel = makeStatusLabel() - addSubview(statusLabel) - statusLabel.translatesAutoresizingMaskIntoConstraints = false - NSLayoutConstraint.activate([ - statusLabel.leadingAnchor.constraint(equalTo: negativeButton.trailingAnchor), - statusLabel.topAnchor.constraint(equalTo: topAnchor), - statusLabel.bottomAnchor.constraint(equalTo: bottomAnchor), - statusLabel.trailingAnchor.constraint(equalTo: positiveButton.leadingAnchor) - ]) - self.statusLabel = statusLabel - - update(for: currentPage) - } - - // MARK: Actions - - @objc private func positiveButtonPressed(_ sender: UIButton) { - let candidate = currentPage + 1 - guard candidate < numberOfPages else { - return - } - currentPage = candidate - } - - @objc private func negativeButtonPressed(_ sender: UIButton) { - let candidate = currentPage - 1 - guard candidate >= 0 else { - return - } - currentPage = candidate - } - - // MARK: Updates - - private func update(for currentPage: Int) { - statusLabel.text = "\(currentPage)" - } -} - -extension PageStepper { - - private func makeStepperButton(for type: ButtonType) -> UIButton { - let button = SettingsOptionButton() - - switch type { - case .positive: - button.setImage(#imageLiteral(resourceName: "ic_plus"), for: .normal) - case .negative: - button.setImage(#imageLiteral(resourceName: "ic_minus"), for: .normal) - } - button.imageView?.contentMode = .scaleAspectFit - button.imageEdgeInsets = UIEdgeInsets(top: 10.0, left: 28.0, bottom: 10.0, right: 28.0) - - button.translatesAutoresizingMaskIntoConstraints = false - button.widthAnchor.constraint(equalToConstant: 80.0).isActive = true - - return button - } - - private func makeStatusLabel() -> UILabel { - let label = UILabel() - label.textAlignment = .center - label.font = .systemFont(ofSize: 24, weight: .medium) - return label - } -} diff --git a/Example/Pageboy-Example/PageViewController+BarButtons.swift b/Example/Pageboy-Example/PageViewController+BarButtons.swift deleted file mode 100644 index d0eb62dc..00000000 --- a/Example/Pageboy-Example/PageViewController+BarButtons.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// PageViewControllerAppearance.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 15/02/2017. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -extension PageViewController { - - // MARK: Bar buttons - - func addBarButtonsIfNeeded() { - guard let navigationItem = parent?.navigationItem, self.previousBarButton == nil else { - return - } - - let previousBarButton = UIBarButtonItem(title: "Previous", style: .plain, target: self, action: #selector(previousPage(_:))) - let nextBarButton = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(nextPage(_:))) - navigationItem.setLeftBarButton(previousBarButton, animated: false) - navigationItem.setRightBarButton(nextBarButton, animated: false) - self.previousBarButton = previousBarButton - self.nextBarButton = nextBarButton - - updateBarButtonsForCurrentIndex() - } - - func updateBarButtonsForCurrentIndex() { - guard let index = self.currentIndex else { - return - } - self.previousBarButton?.isEnabled = index != 0 - self.nextBarButton?.isEnabled = index != (pageCount ?? 0) - 1 - } -} diff --git a/Example/Pageboy-Example/PageViewController+Bulletins.swift b/Example/Pageboy-Example/PageViewController+Bulletins.swift deleted file mode 100644 index c8bc34c7..00000000 --- a/Example/Pageboy-Example/PageViewController+Bulletins.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// PageViewController+Bulletins.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 21/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit -import BLTNBoard -import Pageboy - -extension PageViewController { - - // MARK: Keys - - private struct Keys { - static let hasShownIntroBulletin = "hasShownIntroBulletin" - } - - // MARK: Managers - - func makeIntroBulletinManager() -> BLTNItemManager? { - let hasShownIntro = UserDefaults.standard.bool(forKey: Keys.hasShownIntroBulletin) - guard !hasShownIntro else { - return nil - } - - UserDefaults.standard.set(true, forKey: Keys.hasShownIntroBulletin) - - let root = SettingsBulletinDataSource.makeIntroPage() - - let tintColor = gradient?.activeColors?.last - root.appearance = SettingsBulletinDataSource.makePageboyAppearance(tintColor: tintColor) - - return BLTNItemManager(rootItem: root) - } - - func makeSettingsBulletinManager() -> BLTNItemManager { - let root = SettingsBulletinDataSource.makeSettingsPage(for: self) - root.delegate = self - - let tintColor = gradient?.activeColors?.last - root.appearance = SettingsBulletinDataSource.makePageboyAppearance(tintColor: tintColor) - - return BLTNItemManager(rootItem: root) - } -} - -extension PageViewController: SettingsBulletinPageDelegate { - - func settingsBulletin(_ bulletin: SettingsBulletinPage, requiresPageInsertionAt index: PageIndex) { - viewControllers.insert(makeChildViewController(at: index), at: index) - insertPage(at: index) - } - - func settingsBulletin(_ bulletin: SettingsBulletinPage, requiresPageDeletionAt index: PageIndex) { - viewControllers.remove(at: index) - deletePage(at: index) - } -} diff --git a/Example/Pageboy-Example/PageViewController+Settings.swift b/Example/Pageboy-Example/PageViewController+Settings.swift deleted file mode 100644 index 2ccddac3..00000000 --- a/Example/Pageboy-Example/PageViewController+Settings.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// PageViewController+Settings.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 19/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit -import BLTNBoard - -extension PageViewController { - - // MARK: Actions - - @IBAction private func settingsButtonPressed(_ sender: UIButton) { - showBulletin(makeSettingsBulletinManager()) - } -} diff --git a/Example/Pageboy-Example/PageViewController.swift b/Example/Pageboy-Example/PageViewController.swift deleted file mode 100644 index d68350da..00000000 --- a/Example/Pageboy-Example/PageViewController.swift +++ /dev/null @@ -1,149 +0,0 @@ -// -// PageViewController.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 04/01/2017. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit -import Pageboy -import BLTNBoard - -class PageViewController: PageboyViewController { - - // MARK: Properties - - @IBOutlet private weak var statusView: PageStatusView! - var gradient: GradientViewController? { - return parent as? GradientViewController - } - var previousBarButton: UIBarButtonItem? - var nextBarButton: UIBarButtonItem? - - private var activeBulletinManager: BLTNItemManager? - - lazy var viewControllers: [UIViewController] = { - var viewControllers = [UIViewController]() - for i in 0 ..< 5 { - viewControllers.append(makeChildViewController(at: i)) - } - return viewControllers - }() - - // MARK: Lifecycle - - override func viewDidLoad() { - super.viewDidLoad() - - dataSource = self - delegate = self - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - gradient?.gradients = Gradients.all - addBarButtonsIfNeeded() - } - - override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - - showBulletin(makeIntroBulletinManager()) - } - - // MARK: Actions - - @objc func nextPage(_ sender: UIBarButtonItem) { - scrollToPage(.next, animated: true) - } - - @objc func previousPage(_ sender: UIBarButtonItem) { - scrollToPage(.previous, animated: true) - } - - // MARK: Bulletins - - func showBulletin(_ manager: BLTNItemManager?) { - if let manager = manager { - self.activeBulletinManager = manager - manager.showBulletin(above: self) - } - } - - // MARK: View Controllers - - func makeChildViewController(at index: Int?) -> ChildViewController { - let storyboard = UIStoryboard(name: "Pageboy", bundle: .main) - return storyboard.instantiateViewController(withIdentifier: "ChildViewController") as! ChildViewController - } -} - -// MARK: PageboyViewControllerDataSource -extension PageViewController: PageboyViewControllerDataSource { - - func numberOfViewControllers(in pageboyViewController: PageboyViewController) -> Int { - let count = viewControllers.count - statusView.numberOfPages = count - return count - } - - func viewController(for pageboyViewController: PageboyViewController, - at index: PageboyViewController.PageIndex) -> UIViewController? { - guard viewControllers.isEmpty == false else { - return nil - } - return viewControllers[index] - } - - func defaultPage(for pageboyViewController: PageboyViewController) -> PageboyViewController.Page? { - return nil - } -} - -// MARK: PageboyViewControllerDelegate -extension PageViewController: PageboyViewControllerDelegate { - func pageboyViewController(_ pageboyViewController: PageboyViewController, - willScrollToPageAt index: PageboyViewController.PageIndex, - direction: PageboyViewController.NavigationDirection, - animated: Bool) { -// print("willScrollToPageAtIndex: \(index)") - } - - func pageboyViewController(_ pageboyViewController: PageboyViewController, - didCancelScrollToPageAt index: PageboyViewController.PageIndex, - returnToPageAt previousIndex: PageboyViewController.PageIndex) { -// print("didCancelScrollToPageAt: \(index), returnToPageAt: \(previousIndex)") - } - - func pageboyViewController(_ pageboyViewController: PageboyViewController, - didScrollTo position: CGPoint, - direction: PageboyViewController.NavigationDirection, - animated: Bool) { -// print("didScrollToPosition: \(position)") - - let relativePosition = navigationOrientation == .vertical ? position.y : position.x - gradient?.gradientOffset = relativePosition - statusView.currentPosition = relativePosition - - updateBarButtonsForCurrentIndex() - } - - func pageboyViewController(_ pageboyViewController: PageboyViewController, - didScrollToPageAt index: PageboyViewController.PageIndex, - direction: PageboyViewController.NavigationDirection, - animated: Bool) { -// print("didScrollToPageAtIndex: \(index)") - - gradient?.gradientOffset = CGFloat(index) - statusView.currentIndex = index - updateBarButtonsForCurrentIndex() - } - - func pageboyViewController(_ pageboyViewController: PageboyViewController, - didReloadWith currentViewController: UIViewController, - currentPageIndex: PageIndex) { - } -} - diff --git a/Example/Pageboy-Example/SettingsBulletinDataSource.swift b/Example/Pageboy-Example/SettingsBulletinDataSource.swift deleted file mode 100644 index 0a53ac13..00000000 --- a/Example/Pageboy-Example/SettingsBulletinDataSource.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// SettingsBulletinDataSource.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 21/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit -import BLTNBoard -import Pageboy - -enum SettingsBulletinDataSource { - - // MARK: Pages - - static func makeIntroPage() -> BLTNPageItem { - let page = BLTNPageItem(title: "Pageboy") - page.descriptionText = "A simple, highly informative page view controller." - page.image = #imageLiteral(resourceName: "ic_welcome_icon") - page.actionButtonTitle = "Continue" - page.isDismissable = false - page.actionHandler = { item in - item.manager?.dismissBulletin() - } - page.requiresCloseButton = false - return page - } - - static func makeSettingsPage(for pageViewController: PageboyViewController) -> SettingsBulletinPage { - let page = SettingsBulletinPage(title: "Settings", pageViewController: pageViewController) - page.requiresCloseButton = false - return page - } -} - -extension SettingsBulletinDataSource { - - static func makePageboyAppearance(tintColor: UIColor?) -> BLTNItemAppearance { - let appearance = BLTNItemAppearance() - if let tintColor = tintColor { - appearance.actionButtonColor = tintColor - } - return appearance - } -} diff --git a/Example/Pageboy-Example/SettingsBulletinPage.swift b/Example/Pageboy-Example/SettingsBulletinPage.swift deleted file mode 100644 index a5d691d4..00000000 --- a/Example/Pageboy-Example/SettingsBulletinPage.swift +++ /dev/null @@ -1,168 +0,0 @@ -// -// SettingsBulletinPage.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 23/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit -import BLTNBoard -import Pageboy - -protocol SettingsBulletinPageDelegate: class { - - func settingsBulletin(_ bulletin: SettingsBulletinPage, requiresPageInsertionAt index: PageboyViewController.PageIndex) - - func settingsBulletin(_ bulletin: SettingsBulletinPage, requiresPageDeletionAt index: PageboyViewController.PageIndex) -} - -class SettingsBulletinPage: BLTNPageItem { - - // MARK: Options - - private enum Option { - case modification - case infiniteScrolling - case autoScrolling - case scrollEnabled - - var displayTitle: String { - switch self { - case .modification: - return "⚒ Modify Pages" - case .infiniteScrolling: - return "🎡 Infinite Scrolling" - case .autoScrolling: - return "🏎 Auto Scrolling" - case .scrollEnabled: - return "👇 Scroll Enabled" - } - } - } - - // MARK: Properties - - private weak var pageViewController: PageboyViewController! - - private var modificationOption: UIButton! - private var infiniteScrollOption: UIButton! - private var autoScrollOption: UIButton! - private var scrollEnabledOption: UIButton! - - weak var delegate: SettingsBulletinPageDelegate? - - // MARK: Init - - init(title: String, pageViewController: PageboyViewController) { - self.pageViewController = pageViewController - super.init(title: title) - } - - // MARK: Lifecycle - - override func tearDown() { - modificationOption.removeTarget(self, action: nil, for: .touchUpInside) - infiniteScrollOption.removeTarget(self, action: nil, for: .touchUpInside) - autoScrollOption.removeTarget(self, action: nil, for: .touchUpInside) - scrollEnabledOption.removeTarget(self, action: nil, for: .touchUpInside) - } - - override func makeViewsUnderTitle(with interfaceBuilder: BLTNInterfaceBuilder) -> [UIView]? { - let stack = interfaceBuilder.makeGroupStack(spacing: 16.0) - - let modificationDetail = makeDetailLabel() - modificationDetail.text = "🚀 NEW: In Pageboy 3, you can insert and remove pages dynamically from the page view controller." - stack.addArrangedSubview(modificationDetail) - - let modificationOption = makeOptionButton(for: .modification) - modificationOption.addTarget(self, action: #selector(modificationOptionPressed(_:)), for: .touchUpInside) - stack.addArrangedSubview(modificationOption) - self.modificationOption = modificationOption - - let otherDetail = makeDetailLabel() - otherDetail.text = "More..." - stack.addArrangedSubview(otherDetail) - - let infiniteScrollOption = makeOptionToggleButton(for: .infiniteScrolling) - infiniteScrollOption.addTarget(self, action: #selector(infiniteScrollToggled(_:)), for: .touchUpInside) - infiniteScrollOption.isSelected = pageViewController.isInfiniteScrollEnabled - stack.addArrangedSubview(infiniteScrollOption) - self.infiniteScrollOption = infiniteScrollOption - - let autoScrollOption = makeOptionToggleButton(for: .autoScrolling) - autoScrollOption.addTarget(self, action: #selector(autoScrollToggled(_:)), for: .touchUpInside) - autoScrollOption.isSelected = pageViewController.autoScroller.isEnabled - stack.addArrangedSubview(autoScrollOption) - self.autoScrollOption = autoScrollOption - - let scrollOption = makeOptionToggleButton(for: .scrollEnabled) - scrollOption.addTarget(self, action: #selector(scrollEnabledToggled(_:)), for: .touchUpInside) - scrollOption.isSelected = pageViewController.isScrollEnabled - stack.addArrangedSubview(scrollOption) - self.scrollEnabledOption = scrollOption - - return [stack] - } - - // MARK: Actions - - @objc private func modificationOptionPressed(_ sender: UIButton) { - let modificationPage = PageModificationBulletinPage(title: Option.modification.displayTitle, - pageViewController: pageViewController) - modificationPage.actionHandler = { [unowned self] item in - item.manager?.dismissBulletin() - switch modificationPage.modificationOption { - case .insertion: - self.delegate?.settingsBulletin(self, requiresPageInsertionAt: modificationPage.pageIndex) - case .removal: - self.delegate?.settingsBulletin(self, requiresPageDeletionAt: modificationPage.pageIndex) - } - } - modificationPage.appearance = appearance - next = modificationPage - manager?.displayNextItem() - } - - @objc private func infiniteScrollToggled(_ sender: UIButton) { - pageViewController.isInfiniteScrollEnabled = sender.isSelected - } - - @objc private func autoScrollToggled(_ sender: UIButton) { - if sender.isSelected { - pageViewController.autoScroller.enable() - } else { - pageViewController.autoScroller.disable() - } - } - - @objc private func scrollEnabledToggled(_ sender: UIButton) { - pageViewController.isScrollEnabled = sender.isSelected - } -} - -extension SettingsBulletinPage { - - private func makeOptionButton(for option: Option) -> SettingsOptionButton { - - let button = SettingsOptionButton() - button.setTitle(option.displayTitle, for: .normal) - button.tintColor = appearance.actionButtonColor - - return button - } - - private func makeOptionToggleButton(for option: Option) -> SettingsOptionButton { - let button = makeOptionButton(for: option) - button.isToggled = true - return button - } - - private func makeDetailLabel() -> UILabel { - let label = UILabel() - label.font = UIFont.systemFont(ofSize: 15.0) - label.textColor = .gray - label.numberOfLines = 0 - return label - } -} diff --git a/Example/Pageboy-Example/SettingsOptionButton.swift b/Example/Pageboy-Example/SettingsOptionButton.swift deleted file mode 100644 index 8cf62caa..00000000 --- a/Example/Pageboy-Example/SettingsOptionButton.swift +++ /dev/null @@ -1,77 +0,0 @@ -// -// SettingsOptionButton.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 23/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -class SettingsOptionButton: UIButton { - - // MARK: Properties - - override var isHighlighted: Bool { - didSet { - UIView.animate(withDuration: 0.2) { - self.alpha = self.isHighlighted ? 0.5 : 1.0 - } - } - } - override var isSelected: Bool { - didSet { - self.backgroundColor = isSelected ? tintColor : .clear - } - } - - override var tintColor: UIColor! { - didSet { - layer.borderColor = tintColor.cgColor - setTitleColor(tintColor, for: .normal) - } - } - - var isToggled: Bool = false - - // MARK: Init - - init() { - super.init(frame: .zero) - configure() - } - - required init?(coder aDecoder: NSCoder) { - fatalError("Use init()") - } - - // MARK: Configuration - - private func configure() { - - layer.cornerRadius = 12.0 - layer.borderWidth = 2.0 - - contentHorizontalAlignment = .center - - let heightConstraint = heightAnchor.constraint(equalToConstant: 54.0) - heightConstraint.priority = .defaultHigh - heightConstraint.isActive = true - - layer.borderColor = tintColor.cgColor - setTitleColor(tintColor, for: .normal) - setTitleColor(.white, for: .selected) - - addTarget(self, action: #selector(updateToggleState(_:)), for: .touchUpInside) - } - - // MARK: Actions - - @objc private func updateToggleState(_ sender: SettingsOptionButton) { - guard isToggled else { - return - } - - self.isSelected = !isSelected - } -} diff --git a/Example/Pageboy-Example/UIColor+Interpolation.swift b/Example/Pageboy-Example/UIColor+Interpolation.swift deleted file mode 100644 index dceaefd2..00000000 --- a/Example/Pageboy-Example/UIColor+Interpolation.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// UIColor+Interpolation.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 18/07/2018. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -extension UIColor { - - func interpolate(between other: UIColor, percent: CGFloat) -> UIColor? { - return UIColor.interpolate(between: self, and: other, percent: percent) - } - - static func interpolate(between color: UIColor, - and other: UIColor, - percent: CGFloat) -> UIColor? { - var redA: CGFloat = 0.0 - var greenA: CGFloat = 0.0 - var blueA: CGFloat = 0.0 - var alphaA: CGFloat = 0.0 - guard color.getRed(&redA, green: &greenA, blue: &blueA, alpha: &alphaA) else { - return nil - } - - var redB: CGFloat = 0.0 - var greenB: CGFloat = 0.0 - var blueB: CGFloat = 0.0 - var alphaB: CGFloat = 0.0 - guard other.getRed(&redB, green: &greenB, blue: &blueB, alpha: &alphaB) else { - return nil - } - - let iRed = CGFloat(redA + percent * (redB - redA)) - let iBlue = CGFloat(blueA + percent * (blueB - blueA)) - let iGreen = CGFloat(greenA + percent * (greenB - greenA)) - let iAlpha = CGFloat(alphaA + percent * (alphaB - alphaA)) - - return UIColor(red: iRed, green: iGreen, blue: iBlue, alpha: iAlpha) - } -} diff --git a/Example/Pageboy-Example/UINavigationController+Utilities.swift b/Example/Pageboy-Example/UINavigationController+Utilities.swift deleted file mode 100644 index 7149fa17..00000000 --- a/Example/Pageboy-Example/UINavigationController+Utilities.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// NavigationControllerUtils.swift -// Pageboy-Example -// -// Created by Merrick Sapsford on 10/04/2017. -// Copyright © 2018 UI At Six. All rights reserved. -// - -import UIKit - -extension UINavigationController { - - open override var childForStatusBarStyle: UIViewController? { - return topViewController - } - - open override var childForStatusBarHidden: UIViewController? { - return topViewController - } -} diff --git a/Pageboy.xcconfig b/Pageboy.xcconfig new file mode 100644 index 00000000..7f4167b7 --- /dev/null +++ b/Pageboy.xcconfig @@ -0,0 +1,4 @@ +PB_VERSION=3.6.1 + +PB_IOS_DEPLOYMENT_TARGET=9.0 +PB_TVOS_DEPLOYMENT_TARGET=10.0 diff --git a/Pageboy.xcworkspace/contents.xcworkspacedata b/Pageboy.xcworkspace/contents.xcworkspacedata index 962593e9..6342da4b 100644 --- a/Pageboy.xcworkspace/contents.xcworkspacedata +++ b/Pageboy.xcworkspace/contents.xcworkspacedata @@ -5,7 +5,10 @@ location = "group:Package.swift"> + location = "group:Pageboy.xcconfig"> + + diff --git a/Sources/Examples.xcodeproj/project.pbxproj b/Sources/Examples.xcodeproj/project.pbxproj new file mode 100644 index 00000000..8e0ca5ad --- /dev/null +++ b/Sources/Examples.xcodeproj/project.pbxproj @@ -0,0 +1,494 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 461498812531E6D000AE1B1B /* Pageboy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D681E3241E546A7D007C08F5 /* Pageboy.framework */; }; + 461498822531E6D000AE1B1B /* Pageboy.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D681E3241E546A7D007C08F5 /* Pageboy.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 465CAFA42529DFCB0081D2A3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465CAFA32529DFCB0081D2A3 /* AppDelegate.swift */; }; + 465CAFA82529DFCB0081D2A3 /* PageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465CAFA72529DFCB0081D2A3 /* PageViewController.swift */; }; + 465CAFAD2529DFCB0081D2A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 465CAFAC2529DFCB0081D2A3 /* Assets.xcassets */; }; + 465CAFB02529DFCB0081D2A3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 465CAFAE2529DFCB0081D2A3 /* LaunchScreen.storyboard */; }; + 465CAFC52529E08A0081D2A3 /* GradientBackgroundViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465CAFC32529E08A0081D2A3 /* GradientBackgroundViewController.swift */; }; + 465CAFC62529E08A0081D2A3 /* UIColor+Pageboy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465CAFC42529E08A0081D2A3 /* UIColor+Pageboy.swift */; }; + 465CAFCA2529E1430081D2A3 /* ChildViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465CAFC92529E1430081D2A3 /* ChildViewController.swift */; }; + 4680A0732531DB9E00152EC9 /* PageboyStatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4680A0722531DB9E00152EC9 /* PageboyStatusView.swift */; }; + 46CA20D62531D3C70003FCCB /* TransparentNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CA20D52531D3C70003FCCB /* TransparentNavigationBar.swift */; }; + 46CA20ED2531D8C50003FCCB /* NavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CA20EC2531D8C50003FCCB /* NavigationController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 466A76D31FB4EFC9000B5C1C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D63A21501F2758D700FEA92D; + remoteInfo = "Pageboy tvOS"; + }; + D681E3231E546A7D007C08F5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D623B1B71E1D0C6A00527F3D; + remoteInfo = Pageboy; + }; + D681E3251E546A7D007C08F5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D623B1C01E1D0C6B00527F3D; + remoteInfo = PageboyTests; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 461498832531E6D000AE1B1B /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 461498822531E6D000AE1B1B /* Pageboy.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 465CAF832529DD5B0081D2A3 /* Pageboy.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Pageboy.xcconfig; path = ../Pageboy.xcconfig; sourceTree = ""; }; + 465CAFA12529DFCB0081D2A3 /* Example iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 465CAFA32529DFCB0081D2A3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 465CAFA72529DFCB0081D2A3 /* PageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageViewController.swift; sourceTree = ""; }; + 465CAFAC2529DFCB0081D2A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 465CAFAF2529DFCB0081D2A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 465CAFB12529DFCB0081D2A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 465CAFC32529E08A0081D2A3 /* GradientBackgroundViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GradientBackgroundViewController.swift; sourceTree = ""; }; + 465CAFC42529E08A0081D2A3 /* UIColor+Pageboy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+Pageboy.swift"; sourceTree = ""; }; + 465CAFC92529E1430081D2A3 /* ChildViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChildViewController.swift; sourceTree = ""; }; + 4680A0722531DB9E00152EC9 /* PageboyStatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageboyStatusView.swift; sourceTree = ""; }; + 46B7BD74217905500041EFFC /* BLTNBoard.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BLTNBoard.framework; path = ../Carthage/Build/iOS/BLTNBoard.framework; sourceTree = ""; }; + 46CA20D52531D3C70003FCCB /* TransparentNavigationBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransparentNavigationBar.swift; sourceTree = ""; }; + 46CA20EC2531D8C50003FCCB /* NavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationController.swift; sourceTree = ""; }; + D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pageboy.xcodeproj; path = ../Sources/Pageboy.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 465CAF9E2529DFCB0081D2A3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 461498812531E6D000AE1B1B /* Pageboy.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 465CAF802529DD520081D2A3 /* Config */ = { + isa = PBXGroup; + children = ( + 465CAF832529DD5B0081D2A3 /* Pageboy.xcconfig */, + ); + name = Config; + sourceTree = ""; + }; + 465CAFA22529DFCB0081D2A3 /* iOS */ = { + isa = PBXGroup; + children = ( + 465CAFA32529DFCB0081D2A3 /* AppDelegate.swift */, + 465CAFA72529DFCB0081D2A3 /* PageViewController.swift */, + 465CAFC92529E1430081D2A3 /* ChildViewController.swift */, + 465CAFC22529E02D0081D2A3 /* Extras */, + 465CAFBD2529E0010081D2A3 /* Resources */, + ); + path = iOS; + sourceTree = ""; + }; + 465CAFBD2529E0010081D2A3 /* Resources */ = { + isa = PBXGroup; + children = ( + 465CAFAC2529DFCB0081D2A3 /* Assets.xcassets */, + 465CAFAE2529DFCB0081D2A3 /* LaunchScreen.storyboard */, + 465CAFB12529DFCB0081D2A3 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 465CAFC22529E02D0081D2A3 /* Extras */ = { + isa = PBXGroup; + children = ( + 465CAFC32529E08A0081D2A3 /* GradientBackgroundViewController.swift */, + 465CAFC42529E08A0081D2A3 /* UIColor+Pageboy.swift */, + 46CA20D52531D3C70003FCCB /* TransparentNavigationBar.swift */, + 46CA20EC2531D8C50003FCCB /* NavigationController.swift */, + ); + path = Extras; + sourceTree = ""; + }; + 4680A06F2531DB1900152EC9 /* Shared */ = { + isa = PBXGroup; + children = ( + 4680A0722531DB9E00152EC9 /* PageboyStatusView.swift */, + ); + path = Shared; + sourceTree = ""; + }; + D623B1D51E1D32D700527F3D = { + isa = PBXGroup; + children = ( + 465CAFA22529DFCB0081D2A3 /* iOS */, + 4680A06F2531DB1900152EC9 /* Shared */, + 465CAF802529DD520081D2A3 /* Config */, + D6CC55831ECCCCB700A7FBB4 /* Frameworks */, + D623B1DF1E1D32D700527F3D /* Products */, + ); + sourceTree = ""; + }; + D623B1DF1E1D32D700527F3D /* Products */ = { + isa = PBXGroup; + children = ( + 465CAFA12529DFCB0081D2A3 /* Example iOS.app */, + ); + name = Products; + sourceTree = ""; + }; + D681E31F1E546A7D007C08F5 /* Products */ = { + isa = PBXGroup; + children = ( + D681E3241E546A7D007C08F5 /* Pageboy.framework */, + 466A76D41FB4EFC9000B5C1C /* Pageboy.framework */, + D681E3261E546A7D007C08F5 /* PageboyTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + D6CC55831ECCCCB700A7FBB4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 46B7BD74217905500041EFFC /* BLTNBoard.framework */, + D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 465CAFA02529DFCB0081D2A3 /* Example iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 465CAFB62529DFCB0081D2A3 /* Build configuration list for PBXNativeTarget "Example iOS" */; + buildPhases = ( + 465CAF9D2529DFCB0081D2A3 /* Sources */, + 465CAF9E2529DFCB0081D2A3 /* Frameworks */, + 465CAF9F2529DFCB0081D2A3 /* Resources */, + 461498832531E6D000AE1B1B /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example iOS"; + productName = iOS; + productReference = 465CAFA12529DFCB0081D2A3 /* Example iOS.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D623B1D61E1D32D700527F3D /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1200; + LastUpgradeCheck = 1100; + ORGANIZATIONNAME = "UI At Six"; + TargetAttributes = { + 465CAFA02529DFCB0081D2A3 = { + CreatedOnToolsVersion = 12.0; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = D623B1D91E1D32D700527F3D /* Build configuration list for PBXProject "Examples" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D623B1D51E1D32D700527F3D; + productRefGroup = D623B1DF1E1D32D700527F3D /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = D681E31F1E546A7D007C08F5 /* Products */; + ProjectRef = D681E31E1E546A7D007C08F5 /* Pageboy.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 465CAFA02529DFCB0081D2A3 /* Example iOS */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 466A76D41FB4EFC9000B5C1C /* Pageboy.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Pageboy.framework; + remoteRef = 466A76D31FB4EFC9000B5C1C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + D681E3241E546A7D007C08F5 /* Pageboy.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Pageboy.framework; + remoteRef = D681E3231E546A7D007C08F5 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + D681E3261E546A7D007C08F5 /* PageboyTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = PageboyTests.xctest; + remoteRef = D681E3251E546A7D007C08F5 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 465CAF9F2529DFCB0081D2A3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 465CAFB02529DFCB0081D2A3 /* LaunchScreen.storyboard in Resources */, + 465CAFAD2529DFCB0081D2A3 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 465CAF9D2529DFCB0081D2A3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4680A0732531DB9E00152EC9 /* PageboyStatusView.swift in Sources */, + 465CAFA82529DFCB0081D2A3 /* PageViewController.swift in Sources */, + 465CAFCA2529E1430081D2A3 /* ChildViewController.swift in Sources */, + 46CA20D62531D3C70003FCCB /* TransparentNavigationBar.swift in Sources */, + 465CAFC52529E08A0081D2A3 /* GradientBackgroundViewController.swift in Sources */, + 465CAFC62529E08A0081D2A3 /* UIColor+Pageboy.swift in Sources */, + 465CAFA42529DFCB0081D2A3 /* AppDelegate.swift in Sources */, + 46CA20ED2531D8C50003FCCB /* NavigationController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 465CAFAE2529DFCB0081D2A3 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 465CAFAF2529DFCB0081D2A3 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 465CAFB22529DFCB0081D2A3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MARKETING_VERSION = "$(PB_VERSION)"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.uias.Pageboy.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 465CAFB32529DFCB0081D2A3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = iOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MARKETING_VERSION = "$(PB_VERSION)"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.uias.Pageboy.iOS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + D623B1EE1E1D32D700527F3D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 465CAF832529DD5B0081D2A3 /* Pageboy.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = "$(PB_IOS_DEPLOYMENT_TARGET)"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 5.0; + TVOS_DEPLOYMENT_TARGET = "$(PB_TVOS_DEPLOYMENT_TARGET)"; + }; + name = Debug; + }; + D623B1EF1E1D32D700527F3D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 465CAF832529DD5B0081D2A3 /* Pageboy.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = "$(PB_IOS_DEPLOYMENT_TARGET)"; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 5.0; + TVOS_DEPLOYMENT_TARGET = "$(PB_TVOS_DEPLOYMENT_TARGET)"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 465CAFB62529DFCB0081D2A3 /* Build configuration list for PBXNativeTarget "Example iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 465CAFB22529DFCB0081D2A3 /* Debug */, + 465CAFB32529DFCB0081D2A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D623B1D91E1D32D700527F3D /* Build configuration list for PBXProject "Examples" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D623B1EE1E1D32D700527F3D /* Debug */, + D623B1EF1E1D32D700527F3D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D623B1D61E1D32D700527F3D /* Project object */; +} diff --git a/Example/Pageboy-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sources/Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Example/Pageboy-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Sources/Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Example/Pageboy-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sources/Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Example/Pageboy-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Sources/Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Sources/Pageboy.xcodeproj/project.pbxproj b/Sources/Pageboy.xcodeproj/project.pbxproj index 5daf5571..3558f401 100755 --- a/Sources/Pageboy.xcodeproj/project.pbxproj +++ b/Sources/Pageboy.xcodeproj/project.pbxproj @@ -96,6 +96,7 @@ 464ADF5820975E3D00929AFB /* PageboyViewControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageboyViewControllerDelegate.swift; sourceTree = ""; }; 464ADF5920975E3D00929AFB /* PageboyViewControllerDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageboyViewControllerDataSource.swift; sourceTree = ""; }; 464ADF5E20975E5000929AFB /* UIViewController+Pageboy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Pageboy.swift"; sourceTree = ""; }; + 465CAF852529DD720081D2A3 /* Pageboy.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Pageboy.xcconfig; path = ../Pageboy.xcconfig; sourceTree = ""; }; 46ADAAB4208F7E1500974529 /* PageboyAutoScroller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageboyAutoScroller.swift; sourceTree = ""; }; 46ADAAB5208F7E1500974529 /* PageboyViewController+AutoScrolling.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PageboyViewController+AutoScrolling.swift"; sourceTree = ""; }; 46ADAABB208F7E8500974529 /* PageboyViewController+Transitioning.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PageboyViewController+Transitioning.swift"; sourceTree = ""; }; @@ -185,6 +186,14 @@ path = Protocols; sourceTree = ""; }; + 465CAF842529DD680081D2A3 /* Config */ = { + isa = PBXGroup; + children = ( + 465CAF852529DD720081D2A3 /* Pageboy.xcconfig */, + ); + name = Config; + sourceTree = ""; + }; 46ADAAB3208F7E1500974529 /* AutoScrolling */ = { isa = PBXGroup; children = ( @@ -209,6 +218,7 @@ children = ( D623B1B91E1D0C6A00527F3D /* Pageboy */, D623B1C41E1D0C6B00527F3D /* PageboyTests */, + 465CAF842529DD680081D2A3 /* Config */, D623B1B81E1D0C6A00527F3D /* Products */, ); sourceTree = ""; @@ -578,6 +588,7 @@ /* Begin XCBuildConfiguration section */ D623B1C91E1D0C6B00527F3D /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 465CAF852529DD720081D2A3 /* Pageboy.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLICATION_EXTENSION_API_ONLY = YES; @@ -627,7 +638,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = "$(PB_IOS_DEPLOYMENT_TARGET)"; MARKETING_VERSION = 3.3.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -636,6 +647,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = "$(PB_TVOS_DEPLOYMENT_TARGET)"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -643,6 +655,7 @@ }; D623B1CA1E1D0C6B00527F3D /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 465CAF852529DD720081D2A3 /* Pageboy.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLICATION_EXTENSION_API_ONLY = YES; @@ -686,13 +699,14 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = "$(PB_IOS_DEPLOYMENT_TARGET)"; MARKETING_VERSION = 3.3.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = "$(PB_TVOS_DEPLOYMENT_TARGET)"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -710,7 +724,7 @@ INFOPLIST_FILE = Pageboy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = "$(PB_VERSION)"; PRODUCT_BUNDLE_IDENTIFIER = com.uias.Pageboy; PRODUCT_NAME = Pageboy; SKIP_INSTALL = YES; @@ -729,7 +743,7 @@ INFOPLIST_FILE = Pageboy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = "$(PB_VERSION)"; PRODUCT_BUNDLE_IDENTIFIER = com.uias.Pageboy; PRODUCT_NAME = Pageboy; SKIP_INSTALL = YES; @@ -771,13 +785,12 @@ INFOPLIST_FILE = Pageboy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = "$(PB_VERSION)"; PRODUCT_BUNDLE_IDENTIFIER = com.uias.Pageboy; PRODUCT_NAME = Pageboy; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -792,13 +805,12 @@ INFOPLIST_FILE = Pageboy/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = "$(PB_VERSION)"; PRODUCT_BUNDLE_IDENTIFIER = com.uias.Pageboy; PRODUCT_NAME = Pageboy; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; }; diff --git a/Sources/Shared/PageboyStatusView.swift b/Sources/Shared/PageboyStatusView.swift new file mode 100644 index 00000000..1f3b492c --- /dev/null +++ b/Sources/Shared/PageboyStatusView.swift @@ -0,0 +1,127 @@ +// +// PageboyStatusView.swift +// Examples +// +// Created by Merrick Sapsford on 10/10/2020. +// Copyright © 2020 UI At Six. All rights reserved. +// + +import UIKit +import Pageboy + +class PageboyStatusView: UIView { + + // MARK: Properties + + private let divider = UIView() + private let countLabel = UILabel() + private let positionLabel = UILabel() + private let pageLabel = UILabel() + + override var tintColor: UIColor! { + didSet { + updateForTintColor() + } + } + + // MARK: Init + + override init(frame: CGRect) { + super.init(frame: frame) + commonInit() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + commonInit() + } + + private func commonInit() { + + let stackView = UIStackView() + stackView.axis = .vertical + + addSubview(divider) + addSubview(stackView) + divider.translatesAutoresizingMaskIntoConstraints = false + stackView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + divider.leadingAnchor.constraint(equalTo: leadingAnchor), + divider.topAnchor.constraint(equalTo: topAnchor), + divider.widthAnchor.constraint(equalToConstant: 1.0), + bottomAnchor.constraint(equalTo: divider.bottomAnchor), + stackView.leadingAnchor.constraint(equalTo: divider.trailingAnchor, constant: 8.0), + stackView.topAnchor.constraint(equalTo: topAnchor), + trailingAnchor.constraint(equalTo: stackView.trailingAnchor), + bottomAnchor.constraint(equalTo: stackView.bottomAnchor) + ]) + + stackView.addArrangedSubview(countLabel) + stackView.addArrangedSubview(positionLabel) + stackView.addArrangedSubview(pageLabel) + + updateCount(nil) + updatePosition(nil) + updatePage(nil) + + tintColor = UIColor.white.withAlphaComponent(0.75) + countLabel.font = .systemFont(ofSize: 14) + positionLabel.font = .systemFont(ofSize: 14) + pageLabel.font = .systemFont(ofSize: 14) + + updateForTintColor() + } + + // MARK: Styling + + private func updateForTintColor() { + divider.backgroundColor = tintColor + countLabel.textColor = tintColor + positionLabel.textColor = tintColor + pageLabel.textColor = tintColor + } + + // MARK: Data + + private func updateCount(_ count: Int?) { + countLabel.text = "Page Count: \(count ?? 0)" + } + + private func updatePosition(_ position: CGFloat?) { + positionLabel.text = "Current Position: \(String(format: "%.3f", position ?? 0.0))" + } + + private func updatePage(_ page: Int?) { + pageLabel.text = "Current Page: \(page ?? 0)" + } +} + +extension PageboyStatusView: PageboyViewControllerDelegate { + + func pageboyViewController(_ pageboyViewController: PageboyViewController, didScrollTo position: CGPoint, direction: PageboyViewController.NavigationDirection, animated: Bool) { + switch pageboyViewController.navigationOrientation { + case .horizontal: + updatePosition(position.x) + case .vertical: + updatePosition(position.y) + @unknown default: + break + } + } + + func pageboyViewController(_ pageboyViewController: PageboyViewController, willScrollToPageAt index: PageboyViewController.PageIndex, direction: PageboyViewController.NavigationDirection, animated: Bool) { + + } + + func pageboyViewController(_ pageboyViewController: PageboyViewController, didScrollToPageAt index: PageboyViewController.PageIndex, direction: PageboyViewController.NavigationDirection, animated: Bool) { + updatePage(index) + } + + func pageboyViewController(_ pageboyViewController: PageboyViewController, didCancelScrollToPageAt index: PageboyViewController.PageIndex, returnToPageAt previousIndex: PageboyViewController.PageIndex) { + + } + + func pageboyViewController(_ pageboyViewController: PageboyViewController, didReloadWith currentViewController: UIViewController, currentPageIndex: PageboyViewController.PageIndex) { + updateCount(pageboyViewController.pageCount) + } +} diff --git a/Sources/iOS/AppDelegate.swift b/Sources/iOS/AppDelegate.swift new file mode 100644 index 00000000..d957ca61 --- /dev/null +++ b/Sources/iOS/AppDelegate.swift @@ -0,0 +1,56 @@ +// +// AppDelegate.swift +// iOS +// +// Created by Merrick Sapsford on 04/10/2020. +// Copyright © 2020 UI At Six. All rights reserved. +// + +import UIKit +import Pageboy + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + let gradientColors: [UIColor] = [.pageboyPrimary, .pageboySecondary] + + let pageViewController = PageViewController() + addStatusView(to: pageViewController) + let navigationController = NavigationController(navigationBarClass: TransparentNavigationBar.self, toolbarClass: nil) + navigationController.viewControllers = [pageViewController] + + window = UIWindow(frame: UIScreen.main.bounds) + window?.rootViewController = GradientBackgroundViewController(embedding: navigationController, colors: gradientColors) + window?.makeKeyAndVisible() + + return true + } +} + +extension AppDelegate { + + private func addStatusView(to viewController: PageboyViewController) { + + let statusView = PageboyStatusView() + viewController.delegate = statusView + + viewController.view.addSubview(statusView) + statusView.translatesAutoresizingMaskIntoConstraints = false + + if #available(iOS 11, *) { + NSLayoutConstraint.activate([ + statusView.leadingAnchor.constraint(equalTo: viewController.view.leadingAnchor, constant: 16.0), + viewController.view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: statusView.bottomAnchor, constant: 8.0) + ]) + } else { + NSLayoutConstraint.activate([ + statusView.leadingAnchor.constraint(equalTo: viewController.view.leadingAnchor, constant: 16.0), + viewController.view.bottomAnchor.constraint(equalTo: statusView.bottomAnchor, constant: 8.0) + ]) + } + } +} diff --git a/Sources/iOS/Assets.xcassets/AccentColor.colorset/Contents.json b/Sources/iOS/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..fefd4743 --- /dev/null +++ b/Sources/iOS/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.424", + "green" : "0.090", + "red" : "0.059" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Icon.png b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/Icon.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Icon.png rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/Icon.png diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Icon@2x.png b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/Icon@2x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Icon@2x.png rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/Icon@2x.png diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Icon@3x.png b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/Icon@3x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/Icon@3x.png rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/Icon@3x.png diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/IconPad.png b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/IconPad.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/IconPad.png rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/IconPad.png diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/IconPad@2x.png b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/IconPad@2x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/IconPad@2x.png rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/IconPad@2x.png diff --git a/Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/IconPadPro.png b/Sources/iOS/Assets.xcassets/AppIcon.appiconset/IconPadPro.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/AppIcon.appiconset/IconPadPro.png rename to Sources/iOS/Assets.xcassets/AppIcon.appiconset/IconPadPro.png diff --git a/Sources/iOS/Assets.xcassets/Contents.json b/Sources/iOS/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Sources/iOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/Contents.json b/Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/Contents.json similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/Contents.json rename to Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/Contents.json diff --git a/Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch.png b/Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch.png rename to Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch.png diff --git a/Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@2x.png b/Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@2x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@2x.png rename to Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@2x.png diff --git a/Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@3x.png b/Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@3x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@3x.png rename to Sources/iOS/Assets.xcassets/bg_logo_launch.imageset/bg_logo_launch@3x.png diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_minus.imageset/Contents.json b/Sources/iOS/Assets.xcassets/ic_minus.imageset/Contents.json similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_minus.imageset/Contents.json rename to Sources/iOS/Assets.xcassets/ic_minus.imageset/Contents.json diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_minus.imageset/ic_minus.pdf b/Sources/iOS/Assets.xcassets/ic_minus.imageset/ic_minus.pdf similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_minus.imageset/ic_minus.pdf rename to Sources/iOS/Assets.xcassets/ic_minus.imageset/ic_minus.pdf diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_plus.imageset/Contents.json b/Sources/iOS/Assets.xcassets/ic_plus.imageset/Contents.json similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_plus.imageset/Contents.json rename to Sources/iOS/Assets.xcassets/ic_plus.imageset/Contents.json diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_plus.imageset/ic_plus.pdf b/Sources/iOS/Assets.xcassets/ic_plus.imageset/ic_plus.pdf similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_plus.imageset/ic_plus.pdf rename to Sources/iOS/Assets.xcassets/ic_plus.imageset/ic_plus.pdf diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/Contents.json b/Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/Contents.json similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/Contents.json rename to Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/Contents.json diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon.png b/Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon.png rename to Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon.png diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@2x.png b/Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@2x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@2x.png rename to Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@2x.png diff --git a/Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@3x.png b/Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@3x.png similarity index 100% rename from Example/Pageboy-Example/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@3x.png rename to Sources/iOS/Assets.xcassets/ic_welcome_icon.imageset/ic_welcome_icon@3x.png diff --git a/Sources/iOS/Base.lproj/LaunchScreen.storyboard b/Sources/iOS/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..6c1779ce --- /dev/null +++ b/Sources/iOS/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/iOS/ChildViewController.swift b/Sources/iOS/ChildViewController.swift new file mode 100644 index 00000000..4b458b95 --- /dev/null +++ b/Sources/iOS/ChildViewController.swift @@ -0,0 +1,48 @@ +// +// ChildViewController.swift +// Example +// +// Created by Merrick Sapsford on 04/10/2020. +// + +import UIKit + +class ChildViewController: UIViewController { + + // MARK: Properties + + let page: Int + + override var preferredStatusBarStyle: UIStatusBarStyle { + .lightContent + } + + // MARK: Init + + init(page: Int) { + self.page = page + super.init(nibName: nil, bundle: nil) + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("Not supported") + } + + // MARK: Lifecycle + + override func viewDidLoad() { + super.viewDidLoad() + + let label = UILabel() + view.addSubview(label) + label.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + label.centerXAnchor.constraint(equalTo: view.centerXAnchor), + label.centerYAnchor.constraint(equalTo: view.centerYAnchor) + ]) + label.text = "Page \(page)" + label.font = .systemFont(ofSize: 20.0, weight: .medium) + label.textColor = .lightText + } +} diff --git a/Sources/iOS/Extras/GradientBackgroundViewController.swift b/Sources/iOS/Extras/GradientBackgroundViewController.swift new file mode 100644 index 00000000..be901945 --- /dev/null +++ b/Sources/iOS/Extras/GradientBackgroundViewController.swift @@ -0,0 +1,139 @@ +// +// GradientBackgroundViewController.swift +// Example +// +// Created by Merrick Sapsford on 04/10/2020. +// + +import UIKit + +final class GradientBackgroundViewController: UIViewController { + + // MARK: Properties + + private lazy var gradientView = GradientView(colors: colors) + private let child: UIViewController + + private let colors: [UIColor] + + override var childForStatusBarStyle: UIViewController? { + child + } + + override var childForStatusBarHidden: UIViewController? { + child + } + + override var childForHomeIndicatorAutoHidden: UIViewController? { + child + } + + // MARK: Init + + init(embedding child: UIViewController, colors: [UIColor]) { + self.child = child + self.colors = colors + super.init(nibName: nil, bundle: nil) + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("Not Supported") + } + + // MARK: Lifecycle + + override func viewDidLoad() { + super.viewDidLoad() + + view.addSubview(gradientView) + gradientView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + gradientView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + gradientView.topAnchor.constraint(equalTo: view.topAnchor), + view.trailingAnchor.constraint(equalTo: gradientView.trailingAnchor), + view.bottomAnchor.constraint(equalTo: gradientView.bottomAnchor) + ]) + + addChild(child) + view.addSubview(child.view) + child.view.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + child.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + child.view.topAnchor.constraint(equalTo: view.topAnchor), + view.trailingAnchor.constraint(equalTo: child.view.trailingAnchor), + view.bottomAnchor.constraint(equalTo: child.view.bottomAnchor) + ]) + } +} + +private final class GradientView: UIView { + + // MARK: Properties + + private var gradientLayer: CAGradientLayer? { + if let gradientLayer = self.layer as? CAGradientLayer { + return gradientLayer + } + return nil + } + + var colors: [UIColor]? = nil { + didSet { + var colorRefs = [CGColor]() + for color in colors ?? [] { + colorRefs.append(color.cgColor) + } + gradientLayer?.colors = colorRefs + } + } + + var locations: [Double]? = nil { + didSet { + var locationNumbers = [NSNumber]() + for location in locations ?? [] { + locationNumbers.append(NSNumber(value: location)) + } + gradientLayer?.locations = locationNumbers + } + } + + var startPoint: CGPoint = CGPoint(x: 0.5, y: 0.0) { + didSet { + gradientLayer?.startPoint = startPoint + } + } + + var endPoint: CGPoint = CGPoint(x: 0.5, y: 1.0) { + didSet { + gradientLayer?.endPoint = endPoint + } + } + + override class var layerClass: AnyClass { + return CAGradientLayer.self + } + + // MARK: Init + + init(colors: [UIColor]) { + super.init(frame: .zero) + commonInit(colors: colors) + } + + override init(frame: CGRect) { + super.init(frame: frame) + commonInit() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + commonInit() + } + + private func commonInit(colors: [UIColor] = [UIColor.white, UIColor.black]) { + self.colors = colors + gradientLayer?.startPoint = self.startPoint + gradientLayer?.endPoint = self.endPoint + } +} diff --git a/Sources/iOS/Extras/NavigationController.swift b/Sources/iOS/Extras/NavigationController.swift new file mode 100644 index 00000000..9c8f975b --- /dev/null +++ b/Sources/iOS/Extras/NavigationController.swift @@ -0,0 +1,24 @@ +// +// NavigationController.swift +// Example iOS +// +// Created by Merrick Sapsford on 10/10/2020. +// Copyright © 2020 UI At Six. All rights reserved. +// + +import UIKit + +class NavigationController: UINavigationController { + + open override var childForStatusBarStyle: UIViewController? { + topViewController + } + + open override var childForStatusBarHidden: UIViewController? { + topViewController + } + + open override var childForHomeIndicatorAutoHidden: UIViewController? { + topViewController + } +} diff --git a/Example/Pageboy-Example/TransparentNavigationBar.swift b/Sources/iOS/Extras/TransparentNavigationBar.swift similarity index 80% rename from Example/Pageboy-Example/TransparentNavigationBar.swift rename to Sources/iOS/Extras/TransparentNavigationBar.swift index 735c3220..19525089 100644 --- a/Example/Pageboy-Example/TransparentNavigationBar.swift +++ b/Sources/iOS/Extras/TransparentNavigationBar.swift @@ -1,6 +1,6 @@ // // TransparentNavigationBar.swift -// Pageboy-Example +// Example iOS // // Created by Merrick Sapsford on 15/02/2017. // Copyright © 2018 UI At Six. All rights reserved. @@ -10,12 +10,21 @@ import UIKit class TransparentNavigationBar: UINavigationBar { - private var separatorView: UIView! + private let separatorView = UIView() - override func awakeFromNib() { - super.awakeFromNib() - - + // MARK: Init + + override init(frame: CGRect) { + super.init(frame: frame) + commonInit() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + commonInit() + } + + private func commonInit() { var titleTextAttributes: [NSAttributedString.Key : Any] = [.foregroundColor : UIColor.white] if #available(iOS 8.2, *) { titleTextAttributes[.font] = UIFont.systemFont(ofSize: 18.0, weight: UIFont.Weight.semibold) @@ -27,15 +36,14 @@ class TransparentNavigationBar: UINavigationBar { self.shadowImage = UIImage() self.isTranslucent = true - let separatorView = UIView() separatorView.backgroundColor = UIColor.white.withAlphaComponent(0.5) self.addSubview(separatorView) separatorView.frame = CGRect(x: 0.0, y: self.bounds.size.height - 1.0, width: self.bounds.size.width, height: 0.5) - self.separatorView = separatorView - } + + // MARK: Lifecycle override func layoutSubviews() { super.layoutSubviews() @@ -44,5 +52,4 @@ class TransparentNavigationBar: UINavigationBar { y: self.bounds.size.height - 1.0, width: self.bounds.size.width, height: 0.5) } - } diff --git a/Sources/iOS/Extras/UIColor+Pageboy.swift b/Sources/iOS/Extras/UIColor+Pageboy.swift new file mode 100644 index 00000000..15b869d5 --- /dev/null +++ b/Sources/iOS/Extras/UIColor+Pageboy.swift @@ -0,0 +1,19 @@ +// +// UIColor+Pageboy.swift +// Example +// +// Created by Merrick Sapsford on 04/10/2020. +// + +import UIKit + +extension UIColor { + + class var pageboyPrimary: UIColor { + UIColor(red: 0.01, green: 0.00, blue: 0.18, alpha: 1.0) + } + + class var pageboySecondary: UIColor { + UIColor(red: 0.00, green: 0.53, blue: 0.80, alpha: 1.0) + } +} diff --git a/Example/Pageboy-Example/Info.plist b/Sources/iOS/Info.plist similarity index 84% rename from Example/Pageboy-Example/Info.plist rename to Sources/iOS/Info.plist index 6a527b5e..8c3f0ae4 100644 --- a/Example/Pageboy-Example/Info.plist +++ b/Sources/iOS/Info.plist @@ -2,8 +2,10 @@ + UIViewControllerBasedStatusBarAppearance + CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName Pageboy CFBundleExecutable @@ -15,25 +17,21 @@ CFBundleName $(PRODUCT_NAME) CFBundlePackageType - APPL + $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0.0 + $(MARKETING_VERSION) CFBundleVersion 1 LSRequiresIPhoneOS + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen - UIMainStoryboardFile - Launch UIRequiredDeviceCapabilities armv7 - UIRequiresFullScreen - - UIStatusBarStyle - UIStatusBarStyleDefault UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/Sources/iOS/PageViewController.swift b/Sources/iOS/PageViewController.swift new file mode 100644 index 00000000..872615e6 --- /dev/null +++ b/Sources/iOS/PageViewController.swift @@ -0,0 +1,61 @@ +// +// PageViewController.swift +// Example +// +// Created by Merrick Sapsford on 04/10/2020. +// Copyright © 2020 UI At Six. All rights reserved. +// + +import UIKit +import Pageboy + +class PageViewController: PageboyViewController, PageboyViewControllerDataSource { + + // MARK: Properties + + /// View controllers that will be displayed in page view controller. + private lazy var viewControllers: [UIViewController] = [ + ChildViewController(page: 1), + ChildViewController(page: 2), + ChildViewController(page: 3), + ChildViewController(page: 4), + ChildViewController(page: 5) + ] + + // MARK: Lifecycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Set PageboyViewControllerDataSource dataSource to configure page view controller. + dataSource = self + + navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(nextPage(_:))) + navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Previous", style: .plain, target: self, action: #selector(previousPage(_:))) + } + + // MARK: PageboyViewControllerDataSource + + func numberOfViewControllers(in pageboyViewController: PageboyViewController) -> Int { + viewControllers.count // How many view controllers to display in the page view controller. + } + + func viewController(for pageboyViewController: PageboyViewController, at index: PageboyViewController.PageIndex) -> UIViewController? { + viewControllers[index] // View controller to display at a specific index for the page view controller. + } + + func defaultPage(for pageboyViewController: PageboyViewController) -> PageboyViewController.Page? { + nil // Default page to display in the page view controller (nil equals default/first index). + } + + // MARK: Actions + + @objc private func nextPage(_ sender: UIBarButtonItem) { + scrollToPage(.next, animated: true) + } + + @objc private func previousPage(_ sender: UIBarButtonItem) { + scrollToPage(.previous, animated: true) + } +} +