Compare commits

...

3 Commits

Author SHA1 Message Date
David Livadaru d1303d730c Update project to Xcode '10.3'. 2019-07-26 13:52:01 +03:00
David Livadaru 3df101c0d2 Remove user data from git repository. 2019-07-26 13:50:56 +03:00
David Livadaru 29ca20064d Update project to Swift 5. 2019-07-26 13:50:07 +03:00
11 changed files with 26 additions and 28 deletions

View File

@ -24,7 +24,7 @@ public class Animation: NSObject {
/// An object which provides facility to use dynamics for animation.
public let dynamics: AnimationDynamics?
/// Animation's options.
public let options: UIViewAnimationOptions
public let options: UIView.AnimationOptions
/// Closure where changes will be performed using an animation.
public private (set) var animation: AnimationClosure?
/// Closure which specifies the end of animation.
@ -43,7 +43,7 @@ public class Animation: NSObject {
/// - animation: closure where changes will be performed using an animation.
/// - completion: closure which specifies the end of animation.
public init(duration: TimeInterval, delay: TimeInterval = 0.0, dynamics: AnimationDynamics? = nil,
options: UIViewAnimationOptions = [], animation: AnimationClosure? = nil,
options: UIView.AnimationOptions = [], animation: AnimationClosure? = nil,
completion: CompletionClosure? = nil) {
self.duration = duration
self.delay = delay

View File

@ -38,9 +38,9 @@ class ContainerLoaderController {
viewControllerFor: index)
else { return }
childViewController.willMove(toParentViewController: menuController)
childViewController.willMove(toParent: menuController)
menuController.screenScrollView.insertSubview(childViewController.view, at: 0)
menuController.addChildViewController(childViewController)
menuController.addChild(childViewController)
menuController.screens[index] = childViewController
menuController.containerLifeCycleController.prepareMachine(for: index)
@ -81,9 +81,9 @@ class ContainerLoaderController {
guard menuController.isValid(index: index),
let childViewController = menuController.screens[index] else { return }
childViewController.willMove(toParentViewController: nil)
childViewController.willMove(toParent: nil)
childViewController.view.removeFromSuperview()
childViewController.removeFromParentViewController()
childViewController.removeFromParent()
menuController.screens[index] = nil
menuController.containerLifeCycleController.removeMachine(for: index)

View File

@ -124,7 +124,7 @@ public class HorizontalMenuViewController: UIViewController, MenuDataSource, Pag
return dataSource?.horizontalMenuViewControllerNumberOfElements(horizontalMenuViewController: self) ?? 0
}
internal (set) var selectionOperation: Operation?
var selectionOperation: Operation?
private (set) var layoutController: LayoutController!
private (set) var paginationController: PaginationController!

View File

@ -15,7 +15,7 @@ open class ItemGeometry: NSObject {
}
/// The size of item. Default value is (width: 44.0, height: 44.0).
open let size: CGSize
public let size: CGSize
/// Alignment of menu itme. Default value is center.
public let verticalAlignment: VerticalAlignment

View File

@ -48,7 +48,7 @@ open class MenuItem: NSObject {
/// - Parameters:
/// - textStates: a dictionary which contains attributed string for each state (normal, highlighted, selected)
/// - indicatorColor: background color for indicator view.
public convenience init(textStates: [UIControlState : NSAttributedString],
public convenience init(textStates: [UIControl.State : NSAttributedString],
indicatorColor: FinalColor? = nil) {
let button = UIButton()

View File

@ -100,7 +100,7 @@ class SelectionController {
private func index(for view: UIView?) -> Int? {
guard let view = view else { return nil }
return menuDataSource.items.index(where: { $0.view == view })
return menuDataSource.items.firstIndex(where: { $0.view == view })
}
private func clearTargets() {

View File

@ -8,9 +8,8 @@
import Foundation
extension UIControlState: Hashable {
/// Compute hash value.
public var hashValue: Int {
return Int(rawValue) * 1024
extension UIControl.State: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(rawValue)
}
}

View File

@ -25,6 +25,6 @@ class ViewControllerState: GKState {
}
override func isValidNextState(_ stateClass: AnyClass) -> Bool {
return validNextStates.index(where: { $0 == stateClass }) != nil
return validNextStates.firstIndex(where: { $0 == stateClass }) != nil
}
}

View File

@ -339,27 +339,28 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1030;
ORGANIZATIONNAME = "3Pillar Global";
TargetAttributes = {
FFBF6C921E681D7D008B7F73 = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0910;
LastSwiftMigration = 1030;
ProvisioningStyle = Automatic;
};
FFBF6C9B1E681D7D008B7F73 = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0910;
LastSwiftMigration = 1030;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = FFBF6C8D1E681D7D008B7F73 /* Build configuration list for PBXProject "TPGHorizontalMenu" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = FFBF6C891E681D7D008B7F73;
productRefGroup = FFBF6C941E681D7D008B7F73 /* Products */;
@ -462,6 +463,7 @@
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++";
@ -523,6 +525,7 @@
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++";
@ -594,8 +597,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@ -619,8 +621,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@ -632,8 +633,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "-PG.TPGHorizontalMenuTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@ -645,8 +645,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "-PG.TPGHorizontalMenuTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1030"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"