Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
d1303d730c | |
![]() |
3df101c0d2 | |
![]() |
29ca20064d |
|
@ -24,7 +24,7 @@ public class Animation: NSObject {
|
||||||
/// An object which provides facility to use dynamics for animation.
|
/// An object which provides facility to use dynamics for animation.
|
||||||
public let dynamics: AnimationDynamics?
|
public let dynamics: AnimationDynamics?
|
||||||
/// Animation's options.
|
/// Animation's options.
|
||||||
public let options: UIViewAnimationOptions
|
public let options: UIView.AnimationOptions
|
||||||
/// Closure where changes will be performed using an animation.
|
/// Closure where changes will be performed using an animation.
|
||||||
public private (set) var animation: AnimationClosure?
|
public private (set) var animation: AnimationClosure?
|
||||||
/// Closure which specifies the end of animation.
|
/// 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.
|
/// - animation: closure where changes will be performed using an animation.
|
||||||
/// - completion: closure which specifies the end of animation.
|
/// - completion: closure which specifies the end of animation.
|
||||||
public init(duration: TimeInterval, delay: TimeInterval = 0.0, dynamics: AnimationDynamics? = nil,
|
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) {
|
completion: CompletionClosure? = nil) {
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
self.delay = delay
|
self.delay = delay
|
||||||
|
|
|
@ -38,9 +38,9 @@ class ContainerLoaderController {
|
||||||
viewControllerFor: index)
|
viewControllerFor: index)
|
||||||
else { return }
|
else { return }
|
||||||
|
|
||||||
childViewController.willMove(toParentViewController: menuController)
|
childViewController.willMove(toParent: menuController)
|
||||||
menuController.screenScrollView.insertSubview(childViewController.view, at: 0)
|
menuController.screenScrollView.insertSubview(childViewController.view, at: 0)
|
||||||
menuController.addChildViewController(childViewController)
|
menuController.addChild(childViewController)
|
||||||
menuController.screens[index] = childViewController
|
menuController.screens[index] = childViewController
|
||||||
|
|
||||||
menuController.containerLifeCycleController.prepareMachine(for: index)
|
menuController.containerLifeCycleController.prepareMachine(for: index)
|
||||||
|
@ -81,9 +81,9 @@ class ContainerLoaderController {
|
||||||
guard menuController.isValid(index: index),
|
guard menuController.isValid(index: index),
|
||||||
let childViewController = menuController.screens[index] else { return }
|
let childViewController = menuController.screens[index] else { return }
|
||||||
|
|
||||||
childViewController.willMove(toParentViewController: nil)
|
childViewController.willMove(toParent: nil)
|
||||||
childViewController.view.removeFromSuperview()
|
childViewController.view.removeFromSuperview()
|
||||||
childViewController.removeFromParentViewController()
|
childViewController.removeFromParent()
|
||||||
menuController.screens[index] = nil
|
menuController.screens[index] = nil
|
||||||
|
|
||||||
menuController.containerLifeCycleController.removeMachine(for: index)
|
menuController.containerLifeCycleController.removeMachine(for: index)
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class HorizontalMenuViewController: UIViewController, MenuDataSource, Pag
|
||||||
return dataSource?.horizontalMenuViewControllerNumberOfElements(horizontalMenuViewController: self) ?? 0
|
return dataSource?.horizontalMenuViewControllerNumberOfElements(horizontalMenuViewController: self) ?? 0
|
||||||
}
|
}
|
||||||
|
|
||||||
internal (set) var selectionOperation: Operation?
|
var selectionOperation: Operation?
|
||||||
|
|
||||||
private (set) var layoutController: LayoutController!
|
private (set) var layoutController: LayoutController!
|
||||||
private (set) var paginationController: PaginationController!
|
private (set) var paginationController: PaginationController!
|
||||||
|
|
|
@ -15,7 +15,7 @@ open class ItemGeometry: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The size of item. Default value is (width: 44.0, height: 44.0).
|
/// 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.
|
/// Alignment of menu itme. Default value is center.
|
||||||
public let verticalAlignment: VerticalAlignment
|
public let verticalAlignment: VerticalAlignment
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ open class MenuItem: NSObject {
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - textStates: a dictionary which contains attributed string for each state (normal, highlighted, selected)
|
/// - textStates: a dictionary which contains attributed string for each state (normal, highlighted, selected)
|
||||||
/// - indicatorColor: background color for indicator view.
|
/// - indicatorColor: background color for indicator view.
|
||||||
public convenience init(textStates: [UIControlState : NSAttributedString],
|
public convenience init(textStates: [UIControl.State : NSAttributedString],
|
||||||
indicatorColor: FinalColor? = nil) {
|
indicatorColor: FinalColor? = nil) {
|
||||||
let button = UIButton()
|
let button = UIButton()
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ class SelectionController {
|
||||||
|
|
||||||
private func index(for view: UIView?) -> Int? {
|
private func index(for view: UIView?) -> Int? {
|
||||||
guard let view = view else { return nil }
|
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() {
|
private func clearTargets() {
|
||||||
|
|
|
@ -8,9 +8,8 @@
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
extension UIControlState: Hashable {
|
extension UIControl.State: Hashable {
|
||||||
/// Compute hash value.
|
public func hash(into hasher: inout Hasher) {
|
||||||
public var hashValue: Int {
|
hasher.combine(rawValue)
|
||||||
return Int(rawValue) * 1024
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ class ViewControllerState: GKState {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func isValidNextState(_ stateClass: AnyClass) -> Bool {
|
override func isValidNextState(_ stateClass: AnyClass) -> Bool {
|
||||||
return validNextStates.index(where: { $0 == stateClass }) != nil
|
return validNextStates.firstIndex(where: { $0 == stateClass }) != nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,27 +339,28 @@
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastSwiftUpdateCheck = 0820;
|
LastSwiftUpdateCheck = 0820;
|
||||||
LastUpgradeCheck = 0930;
|
LastUpgradeCheck = 1030;
|
||||||
ORGANIZATIONNAME = "3Pillar Global";
|
ORGANIZATIONNAME = "3Pillar Global";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
FFBF6C921E681D7D008B7F73 = {
|
FFBF6C921E681D7D008B7F73 = {
|
||||||
CreatedOnToolsVersion = 8.2.1;
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
LastSwiftMigration = 0910;
|
LastSwiftMigration = 1030;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
};
|
};
|
||||||
FFBF6C9B1E681D7D008B7F73 = {
|
FFBF6C9B1E681D7D008B7F73 = {
|
||||||
CreatedOnToolsVersion = 8.2.1;
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
LastSwiftMigration = 0910;
|
LastSwiftMigration = 1030;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = FFBF6C8D1E681D7D008B7F73 /* Build configuration list for PBXProject "TPGHorizontalMenu" */;
|
buildConfigurationList = FFBF6C8D1E681D7D008B7F73 /* Build configuration list for PBXProject "TPGHorizontalMenu" */;
|
||||||
compatibilityVersion = "Xcode 3.2";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
developmentRegion = English;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
en,
|
en,
|
||||||
|
Base,
|
||||||
);
|
);
|
||||||
mainGroup = FFBF6C891E681D7D008B7F73;
|
mainGroup = FFBF6C891E681D7D008B7F73;
|
||||||
productRefGroup = FFBF6C941E681D7D008B7F73 /* Products */;
|
productRefGroup = FFBF6C941E681D7D008B7F73 /* Products */;
|
||||||
|
@ -462,6 +463,7 @@
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
@ -523,6 +525,7 @@
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
@ -594,8 +597,7 @@
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
SWIFT_VERSION = 5.0;
|
||||||
SWIFT_VERSION = 4.0;
|
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -619,8 +621,7 @@
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
SWIFT_VERSION = 5.0;
|
||||||
SWIFT_VERSION = 4.0;
|
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
@ -632,8 +633,7 @@
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "-PG.TPGHorizontalMenuTests";
|
PRODUCT_BUNDLE_IDENTIFIER = "-PG.TPGHorizontalMenuTests";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
SWIFT_VERSION = 5.0;
|
||||||
SWIFT_VERSION = 4.0;
|
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
|
@ -645,8 +645,7 @@
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "-PG.TPGHorizontalMenuTests";
|
PRODUCT_BUNDLE_IDENTIFIER = "-PG.TPGHorizontalMenuTests";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
SWIFT_VERSION = 5.0;
|
||||||
SWIFT_VERSION = 4.0;
|
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "0930"
|
LastUpgradeVersion = "1030"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
|
Loading…
Reference in New Issue