Skip to content
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
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -246,18 +246,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = Athlee;
TargetAttributes = {
048680621D8E204C004B011E = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = RG4N372RZE;
DevelopmentTeam = 89D52653SY;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
};
048680761D8E204D004B011E = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = RG4N372RZE;
DevelopmentTeam = 89D52653SY;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
TestTargetID = 048680621D8E204C004B011E;
Expand All @@ -269,6 +269,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -363,20 +364,30 @@
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++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
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_DOCUMENTATION_COMMENTS = YES;
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;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -413,20 +424,30 @@
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++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
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_DOCUMENTATION_COMMENTS = YES;
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;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -457,12 +478,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = RG4N372RZE;
DEVELOPMENT_TEAM = 89D52653SY;
INFOPLIST_FILE = "OnboardingKit Swift3/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.athlee.OnboardingKit-Swift3";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -471,12 +492,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = RG4N372RZE;
DEVELOPMENT_TEAM = 89D52653SY;
INFOPLIST_FILE = "OnboardingKit Swift3/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.athlee.OnboardingKit-Swift3";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -485,7 +506,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = RG4N372RZE;
DEVELOPMENT_TEAM = 89D52653SY;
INFOPLIST_FILE = "OnboardingKit Swift3Tests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.athlee.OnboardingKit-Swift3Tests";
Expand All @@ -500,7 +521,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = RG4N372RZE;
DEVELOPMENT_TEAM = 89D52653SY;
INFOPLIST_FILE = "OnboardingKit Swift3Tests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.athlee.OnboardingKit-Swift3Tests";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
4 changes: 2 additions & 2 deletions Source/Anchor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public struct Anchors {
open class LayoutAnchor {

internal var item:View
internal var attribute:NSLayoutAttribute
internal var attribute:NSLayoutConstraint.Attribute

internal init(item:View, attribute:NSLayoutAttribute) {
internal init(item:View, attribute:NSLayoutConstraint.Attribute) {
self.item = item
self.attribute = attribute
}
Expand Down
2 changes: 1 addition & 1 deletion Source/CompletionObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal protocol Completion {
}

internal final class CompletionObject: Completion {
internal var completion: ((Void) -> Void)?
internal var completion: (() -> Void)?

internal static let sharedInstance = CompletionObject()

Expand Down
12 changes: 6 additions & 6 deletions Source/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ public final class OnboardingView: UIView, CAAnimationDelegate {
addGestureRecognizer(rightSwipeRecognizer)
}

internal func didRecognizeSwipe(_ recognizer: UISwipeGestureRecognizer) {
@objc internal func didRecognizeSwipe(_ recognizer: UISwipeGestureRecognizer) {
switch recognizer.direction {
case UISwipeGestureRecognizerDirection.left:
case UISwipeGestureRecognizer.Direction.left:
guard pageControlView.currentPage + 1 < pageControlView.pages else {
return
}
Expand All @@ -192,7 +192,7 @@ public final class OnboardingView: UIView, CAAnimationDelegate {
animateSubviews(current)
animatePageView(previous, forState: .fadeIn)

case UISwipeGestureRecognizerDirection.right:
case UISwipeGestureRecognizer.Direction.right:
guard pageControlView.currentPage - 1 >= 0 else {
return
}
Expand Down Expand Up @@ -290,15 +290,15 @@ public final class OnboardingView: UIView, CAAnimationDelegate {
pageView.layer.mask = shape
}

func animatePageView(_ pageView: PageView, forState state: State, completion: ((Void) -> Void)? = nil) {
func animatePageView(_ pageView: PageView, forState state: State, completion: (() -> Void)? = nil) {
if state == .expanded || state == .folded {
if let shapeLayer = pageView.layer.mask as? CAShapeLayer {
let animation = CABasicAnimation(keyPath: "path")
animation.toValue = pathForState(state).cgPath
animation.duration = 0.7
animation.isRemovedOnCompletion = false
animation.fillMode = kCAFillModeBoth
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
animation.fillMode = CAMediaTimingFillMode.both
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn)

if let completion = completion {
animation.delegate = self
Expand Down
4 changes: 2 additions & 2 deletions Source/PageItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public final class PageItemView: UIView {
UIView.animate(
withDuration: 0.5,
delay: 0,
options: UIViewAnimationOptions(),
options: UIView.AnimationOptions(),
animations: animations,
completion: nil
)
Expand All @@ -97,7 +97,7 @@ public final class PageItemView: UIView {
UIView.animate(
withDuration: 0.5,
delay: 0,
options: UIViewAnimationOptions(),
options: UIView.AnimationOptions(),
animations: animations,
completion: nil
)
Expand Down
4 changes: 2 additions & 2 deletions Source/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ public final class PageView: UIView {
//titleLabel.backgroundColor = .redColor()

// This way the StackView knows how to size & align subviews.
imageView.setContentHuggingPriority(250, for: .vertical)
titleLabel.setContentHuggingPriority(252, for: .vertical)
imageView.setContentHuggingPriority(UILayoutPriority(rawValue: 250), for: .vertical)
titleLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 252), for: .vertical)
}

fileprivate func setupBottomStackView() {
Expand Down
16 changes: 8 additions & 8 deletions Source/TZStackView/TZStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open class TZStackView: UIView {
}
}

open var axis: UILayoutConstraintAxis = .horizontal {
open var axis: NSLayoutConstraint.Axis = .horizontal {
didSet {
setNeedsUpdateConstraints()
}
Expand Down Expand Up @@ -131,7 +131,7 @@ open class TZStackView: UIView {
addHiddenListener(arrangedSubview)
}

func hiddenAnimationStopped() {
@objc func hiddenAnimationStopped() {
var queueEntriesToRemove = [TZAnimationDidStopQueueEntry]()
for entry in animationDidStopQueueEntries {
let view = entry.view
Expand Down Expand Up @@ -348,10 +348,10 @@ open class TZStackView: UIView {
}

var topPriority: Float = 1000
var topRelation: NSLayoutRelation = .lessThanOrEqual
var topRelation:NSLayoutConstraint.Relation = .lessThanOrEqual

var bottomPriority: Float = 1000
var bottomRelation: NSLayoutRelation = .greaterThanOrEqual
var bottomRelation:NSLayoutConstraint.Relation = .greaterThanOrEqual

if alignment == .top || alignment == .leading {
topPriority = 999.5
Expand Down Expand Up @@ -437,7 +437,7 @@ open class TZStackView: UIView {
}

// Chains together the given views using Leading/Trailing or Top/Bottom
fileprivate func createFillConstraints(_ views: [UIView], priority: Float = 1000, relatedBy relation: NSLayoutRelation = .equal, constant: CGFloat) -> [NSLayoutConstraint] {
fileprivate func createFillConstraints(_ views: [UIView], priority: Float = 1000, relatedBy relation:NSLayoutConstraint.Relation = .equal, constant: CGFloat) -> [NSLayoutConstraint] {
var constraints = [NSLayoutConstraint]()

var previousView: UIView?
Expand Down Expand Up @@ -567,7 +567,7 @@ open class TZStackView: UIView {
return constraints
}

fileprivate func equalAttributes(_ views: [UIView], attribute: NSLayoutAttribute, priority: Float = 1000) -> [NSLayoutConstraint] {
fileprivate func equalAttributes(_ views: [UIView], attribute:NSLayoutConstraint.Attribute, priority: Float = 1000) -> [NSLayoutConstraint] {
var currentPriority = priority
var constraints = [NSLayoutConstraint]()
if views.count > 0 {
Expand All @@ -590,12 +590,12 @@ open class TZStackView: UIView {
}

// Convenience method to help make NSLayoutConstraint in a less verbose way
fileprivate func constraint(item view1: AnyObject, attribute attr1: NSLayoutAttribute, relatedBy relation: NSLayoutRelation = .equal, toItem view2: AnyObject?, attribute attr2: NSLayoutAttribute? = nil, multiplier: CGFloat = 1, constant c: CGFloat = 0, priority: Float = 1000) -> NSLayoutConstraint {
fileprivate func constraint(item view1: AnyObject, attribute attr1:NSLayoutConstraint.Attribute, relatedBy relation: NSLayoutConstraint.Relation = .equal, toItem view2: AnyObject?, attribute attr2: NSLayoutConstraint.Attribute? = nil, multiplier: CGFloat = 1, constant c: CGFloat = 0, priority: Float = 1000) -> NSLayoutConstraint {

let attribute2 = attr2 != nil ? attr2! : attr1

let constraint = NSLayoutConstraint(item: view1, attribute: attr1, relatedBy: relation, toItem: view2, attribute: attribute2, multiplier: multiplier, constant: c)
constraint.priority = priority
constraint.priority = UILayoutPriority(rawValue: priority)
return constraint
}

Expand Down