From 9c455f5cb374bf6f0246306fe1610bd56c6e1725 Mon Sep 17 00:00:00 2001 From: JohnC Date: Wed, 8 Feb 2017 19:55:21 +0200 Subject: [PATCH] Updated in Swift 3 --- .../Paging_Swift.xcodeproj/project.pbxproj | 6 ++ .../contents.xcworkspacedata | 7 ++ .../UserInterfaceState.xcuserstate | Bin 0 -> 10620 bytes .../xcschemes/Paging_Swift.xcscheme | 91 ++++++++++++++++++ .../xcschemes/xcschememanagement.plist | 22 +++++ Paging_Swift/Paging_Swift/AppDelegate.swift | 12 +-- .../Paging_Swift/ViewController.swift | 56 ++++++++--- 7 files changed, 172 insertions(+), 22 deletions(-) create mode 100644 Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/xcuserdata/jek.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/Paging_Swift.xcscheme create mode 100644 Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/Paging_Swift/Paging_Swift.xcodeproj/project.pbxproj b/Paging_Swift/Paging_Swift.xcodeproj/project.pbxproj index 4d5659d..c80cf0e 100644 --- a/Paging_Swift/Paging_Swift.xcodeproj/project.pbxproj +++ b/Paging_Swift/Paging_Swift.xcodeproj/project.pbxproj @@ -107,6 +107,8 @@ TargetAttributes = { B2A6778219FD197300B3F6DB = { CreatedOnToolsVersion = 6.1; + DevelopmentTeam = 6P8Q9Q6J62; + LastSwiftMigration = 0820; }; }; }; @@ -255,9 +257,11 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 6P8Q9Q6J62; INFOPLIST_FILE = Paging_Swift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -265,9 +269,11 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 6P8Q9Q6J62; INFOPLIST_FILE = Paging_Swift/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/xcuserdata/jek.xcuserdatad/UserInterfaceState.xcuserstate b/Paging_Swift/Paging_Swift.xcodeproj/project.xcworkspace/xcuserdata/jek.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..0ba91a2527de4143b55f8556e2342e98bef30d37 GIT binary patch literal 10620 zcmch7d3;kv_x{Y>G<&n}O(da7L7+vRE4Th4Vr*zQ5~9y>d_=L z8BIYR#G>gah(aig+R;qZfjZF*Xd${8El0Pb6{rhsMqALmXe-)=?n4iuhtcC`H+ll? zLC>KV(0=p^dK0~i-b2UHC+G`w8l6Eup$q6QjIbC>uoT;|1NX(rI0dKTG<-Skhx_9! zoQ?Bw0WQI%cmyuPSL2De9#6uP@f7UBQ?VO2U_TDvHar6d@oYQ~FT{)RO?Vkzj&H|z z;=Az%d=K7+@59^i{dfo7i66ty;k|f2egz-GZ{RoaQT#6c0Dp)-!k^)j_-p(PzJPzm zzu;f-Z$w1IL_(xQMifLx^u$1{#6kL#0VIbECI#e5QcA8NqsVAdMXE^+nL?%!KM9hV z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4oJOosYldn{G(Js-=26Y_nuD5Sns+qsY2Md- zruj;9Msq>)tLAsjpIW`PuXdm|Lz|@?q#djssvV{+)|P6^wB_1y+B&UAJ6C&)c7=AO zc9nLucCB`^_FnBa?RM=B?StA^wWoA4U5YM4m#NFvU8yV9mFh<7uF_TLChJ@}pDv)A zp$qF~>SpUYb&GU2>u%NErdy-ipxdbH(rwdi*X__fsN1dEuREwaqcx7gUaL3hEqbf|GW|e(wmwInt1r@Dp}$f;TwkFduXpJ^ z`X>D}eXBm8pP>)w7wVVl@6kV|e?$M3{u}*i{dfBB4N`;FU@@c_Dh$2MmuJUNF39c*$_kaKiAJ;S0l;hOZ3g z3_lt!7=AGlW4dvWvEJx0-fCQCeBAhg@v!lz@onR~#^c5hj2{_4F`hA=HJ&q`H~wV& z+4!6BPZKg3O}VBLQ>|&S>2A{=(*e^#(;?IArZ-K8O&^<1m_9R|G@UYiZMtCk#q^u$ z53|=i(>&kYX*fN6g2}@0i~+pD>>> z|6u;ne8K#?`A-Y75R1{0V!7PX-;!?0v}9X`Sw>lEEnZ8DrPUI!%&>$k?Uq@V4$G~U z+bl~h%PlJ`D=n)mt1W9S>n&R?k5~>_PFQ|Qk|iZ44Na;@T9~vrX+_fdr0q#NlXfLN zmb5$R*`&Qm`;zu29Z34wskMni z+HT!oea-r_4co*vy{)gUzipr`!sw-wrk*oNAM*{-rx*v8o=*&1!Et=ZS%DZID(E@ zj$0i|9IG5_9P1o+JGMG@I39HDbnJ5Mb?kHOcf8cMsPCx0m3?b?l0*pq%G?moo%+`P EA1O0W5C8xG literal 0 HcmV?d00001 diff --git a/Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/Paging_Swift.xcscheme b/Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/Paging_Swift.xcscheme new file mode 100644 index 0000000..0f6fd8c --- /dev/null +++ b/Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/Paging_Swift.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/xcschememanagement.plist b/Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..186a25c --- /dev/null +++ b/Paging_Swift/Paging_Swift.xcodeproj/xcuserdata/jek.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + Paging_Swift.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + B2A6778219FD197300B3F6DB + + primary + + + + + diff --git a/Paging_Swift/Paging_Swift/AppDelegate.swift b/Paging_Swift/Paging_Swift/AppDelegate.swift index e10855e..c588bf9 100644 --- a/Paging_Swift/Paging_Swift/AppDelegate.swift +++ b/Paging_Swift/Paging_Swift/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + 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 throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - func applicationDidEnterBackground(application: UIApplication) { + 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) { + func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - func applicationDidBecomeActive(application: UIApplication) { + 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) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Paging_Swift/Paging_Swift/ViewController.swift b/Paging_Swift/Paging_Swift/ViewController.swift index 216bc18..5340a5c 100644 --- a/Paging_Swift/Paging_Swift/ViewController.swift +++ b/Paging_Swift/Paging_Swift/ViewController.swift @@ -7,14 +7,38 @@ // import UIKit +// FIXME: comparison operators with optionals were removed from the Swift Standard Libary. +// Consider refactoring the code to use the non-optional operators. +fileprivate func < (lhs: T?, rhs: T?) -> Bool { + switch (lhs, rhs) { + case let (l?, r?): + return l < r + case (nil, _?): + return true + default: + return false + } +} + +// FIXME: comparison operators with optionals were removed from the Swift Standard Libary. +// Consider refactoring the code to use the non-optional operators. +fileprivate func > (lhs: T?, rhs: T?) -> Bool { + switch (lhs, rhs) { + case let (l?, r?): + return l > r + default: + return rhs < lhs + } +} + class ViewController: UIViewController, UIPageViewControllerDataSource { // MARK: - Variables - private var pageViewController: UIPageViewController? + fileprivate var pageViewController: UIPageViewController? // Initialize it right away here - private let contentImages = ["nature_pic_1", + fileprivate let contentImages = ["nature_pic_1", "nature_pic_2", "nature_pic_3", "nature_pic_4"] @@ -26,33 +50,33 @@ class ViewController: UIViewController, UIPageViewControllerDataSource { setupPageControl() } - private func createPageViewController() { + fileprivate func createPageViewController() { - let pageController = self.storyboard!.instantiateViewControllerWithIdentifier("PageController") as! UIPageViewController + let pageController = self.storyboard!.instantiateViewController(withIdentifier: "PageController") as! UIPageViewController pageController.dataSource = self if contentImages.count > 0 { let firstController = getItemController(0)! let startingViewControllers = [firstController] - pageController.setViewControllers(startingViewControllers, direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil) + pageController.setViewControllers(startingViewControllers, direction: UIPageViewControllerNavigationDirection.forward, animated: false, completion: nil) } pageViewController = pageController addChildViewController(pageViewController!) self.view.addSubview(pageViewController!.view) - pageViewController!.didMoveToParentViewController(self) + pageViewController!.didMove(toParentViewController: self) } - private func setupPageControl() { + fileprivate func setupPageControl() { let appearance = UIPageControl.appearance() - appearance.pageIndicatorTintColor = UIColor.grayColor() - appearance.currentPageIndicatorTintColor = UIColor.whiteColor() - appearance.backgroundColor = UIColor.darkGrayColor() + appearance.pageIndicatorTintColor = UIColor.gray + appearance.currentPageIndicatorTintColor = UIColor.white + appearance.backgroundColor = UIColor.darkGray } // MARK: - UIPageViewControllerDataSource - func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? { + func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { let itemController = viewController as! PageItemController @@ -63,7 +87,7 @@ class ViewController: UIViewController, UIPageViewControllerDataSource { return nil } - func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? { + func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { let itemController = viewController as! PageItemController @@ -74,10 +98,10 @@ class ViewController: UIViewController, UIPageViewControllerDataSource { return nil } - private func getItemController(itemIndex: Int) -> PageItemController? { + fileprivate func getItemController(_ itemIndex: Int) -> PageItemController? { if itemIndex < contentImages.count { - let pageItemController = self.storyboard!.instantiateViewControllerWithIdentifier("ItemController") as! PageItemController + let pageItemController = self.storyboard!.instantiateViewController(withIdentifier: "ItemController") as! PageItemController pageItemController.itemIndex = itemIndex pageItemController.imageName = contentImages[itemIndex] return pageItemController @@ -88,11 +112,11 @@ class ViewController: UIViewController, UIPageViewControllerDataSource { // MARK: - Page Indicator - func presentationCountForPageViewController(pageViewController: UIPageViewController) -> Int { + func presentationCount(for pageViewController: UIPageViewController) -> Int { return contentImages.count } - func presentationIndexForPageViewController(pageViewController: UIPageViewController) -> Int { + func presentationIndex(for pageViewController: UIPageViewController) -> Int { return 0 }