Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

update for Swift 4.2 #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Pager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
attributes = {
LastSwiftMigration = 0720;
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0920;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = Cheesecake;
TargetAttributes = {
C8B7D1371AB25F9300E9347C = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions Pager/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Pager/library/PagerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down