diff --git a/Pager.xcodeproj/project.pbxproj b/Pager.xcodeproj/project.pbxproj index 6fc1c64..345add7 100755 --- a/Pager.xcodeproj/project.pbxproj +++ b/Pager.xcodeproj/project.pbxproj @@ -147,7 +147,7 @@ attributes = { LastSwiftMigration = 0720; LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0920; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = Cheesecake; TargetAttributes = { C8B7D1371AB25F9300E9347C = { @@ -254,12 +254,14 @@ 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_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; @@ -306,12 +308,14 @@ 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_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; @@ -352,7 +356,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -369,7 +373,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Pager/AppDelegate.swift b/Pager/AppDelegate.swift index 24d6c25..ce80589 100755 --- a/Pager/AppDelegate.swift +++ b/Pager/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var navController: UINavigationController! - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { self.window = UIWindow(frame: UIScreen.main.bounds) let viewController = ViewController() @@ -31,7 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { self.window?.makeKeyAndVisible() //NavigationBar customization - UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] + UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] UINavigationBar.appearance().shadowImage = UIImage() UINavigationBar.appearance().barTintColor = UIColor(rgb: 0x00AA00) UINavigationBar.appearance().tintColor = UIColor.white diff --git a/Pager/library/PagerController.swift b/Pager/library/PagerController.swift index 6ecd172..cd34fc7 100755 --- a/Pager/library/PagerController.swift +++ b/Pager/library/PagerController.swift @@ -46,7 +46,7 @@ open class PagerController: UIViewController, UIPageViewControllerDataSource, UI open var tabsViewBackgroundColor: UIColor = UIColor.gray open var tabsTextColor: UIColor = UIColor.white open var selectedTabTextColor = UIColor.white - open var tabsImageViewContentMode = UIViewContentMode.scaleAspectFit + open var tabsImageViewContentMode = UIView.ContentMode.scaleAspectFit open weak var dataSource: PagerDataSource? open weak var delegate: PagerDelegate? open var tabHeight: CGFloat = 44.0 @@ -492,7 +492,7 @@ open class PagerController: UIViewController, UIPageViewControllerDataSource, UI viewController = self.tabControllers[index] } self.contents[index] = viewController - self.pageViewController.addChildViewController(viewController) + self.pageViewController.addChild(viewController) } return self.contents[index] } @@ -550,7 +550,7 @@ open class PagerController: UIViewController, UIPageViewControllerDataSource, UI }) } else if !(activeContentIndex + 1 == self.activeContentIndex || activeContentIndex - 1 == self.activeContentIndex) { - let direction: UIPageViewControllerNavigationDirection = (activeContentIndex < self.activeContentIndex) ? .reverse : .forward + let direction: UIPageViewController.NavigationDirection = (activeContentIndex < self.activeContentIndex) ? .reverse : .forward DispatchQueue.main.async(execute: { self.pageViewController.setViewControllers([viewController!], direction: direction, animated: true, completion: { completed in wSelf?.animatingToTab = false @@ -564,7 +564,7 @@ open class PagerController: UIViewController, UIPageViewControllerDataSource, UI }) }) } else { - let direction: UIPageViewControllerNavigationDirection = (activeContentIndex < self.activeContentIndex) ? .reverse : .forward + let direction: UIPageViewController.NavigationDirection = (activeContentIndex < self.activeContentIndex) ? .reverse : .forward DispatchQueue.main.async(execute: { self.pageViewController.setViewControllers([viewController!], direction: direction, animated: true, completion: { _ -> Void in wSelf!.animatingToTab = true