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
16 changes: 10 additions & 6 deletions Demo/FillableLoaders-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@
TargetAttributes = {
C17B58FC1B9790A800717546 = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0800;
LastSwiftMigration = 1010;
};
C1C748921B978FA5001948ED = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0800;
LastSwiftMigration = 1010;
};
};
};
Expand Down Expand Up @@ -333,7 +333,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -353,7 +354,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -449,7 +451,8 @@
INFOPLIST_FILE = "FillableLoaders-Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -460,7 +463,8 @@
INFOPLIST_FILE = "FillableLoaders-Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
12 changes: 6 additions & 6 deletions Demo/FillableLoaders-Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ class ViewController: UIViewController {
button.center = CGPoint(x: view.frame.width/2, y: view.frame.height - 2*margin - 35)
button.backgroundColor = UIColor.white
button.layer.cornerRadius = 5.0
button.setTitle("Change Logo", for: UIControlState())
button.setTitleColor(UIColor.black, for: UIControlState())
button.setTitle("Change Logo", for: UIControl.State())
button.setTitleColor(UIColor.black, for: UIControl.State())
button.titleLabel?.font = UIFont.systemFont(ofSize: 14)
button.addTarget(self, action: #selector(changeLogo), for: .touchUpInside)
window!.addSubview(button)
}

func segmentedControlTouch(_ sender: UISegmentedControl) {
@objc func segmentedControlTouch(_ sender: UISegmentedControl) {
presentFillableLoader(at: sender.selectedSegmentIndex)
}

func changeLogo() {
@objc func changeLogo() {
firstLogo = !firstLogo
presentFillableLoader(at: segmentedControl.selectedSegmentIndex)
}
Expand All @@ -78,8 +78,8 @@ class ViewController: UIViewController {
loader = WavesLoader.showLoader(with: path())
}
let window = UIApplication.shared.delegate?.window!
window!.bringSubview(toFront: segmentedControl)
window!.bringSubview(toFront: button)
window!.bringSubviewToFront(segmentedControl)
window!.bringSubviewToFront(button)
}

func path() -> CGPath{
Expand Down
6 changes: 3 additions & 3 deletions Source/FillableLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ open class FillableLoader: UIView, CAAnimationDelegate {
moveAnimation.values = up ? [loaderView.frame.height/2 + rectSize/2, loaderView.frame.height/2 - rectSize/2 - extraHeight] : [loaderView.frame.height/2 - rectSize/2 - extraHeight, loaderView.frame.height/2 + rectSize/2]
moveAnimation.duration = duration
moveAnimation.isRemovedOnCompletion = false
moveAnimation.fillMode = kCAFillModeForwards
moveAnimation.fillMode = CAMediaTimingFillMode.forwards
moveAnimation.delegate = self
moveAnimation.setValue(key, forKey: "animation")
shapeLayer.add(moveAnimation, forKey: key)
Expand All @@ -332,7 +332,7 @@ open class FillableLoader: UIView, CAAnimationDelegate {
progressAnimation.values = [oldYPoint, yPoint]
progressAnimation.duration = 0.2
progressAnimation.isRemovedOnCompletion = false
progressAnimation.fillMode = kCAFillModeForwards
progressAnimation.fillMode = CAMediaTimingFillMode.forwards
shapeLayer.add(progressAnimation, forKey: "progress")
oldYPoint = yPoint
}
Expand All @@ -342,7 +342,7 @@ open class FillableLoader: UIView, CAAnimationDelegate {
swingAnimation.values = [0, randomAngle(), -randomAngle(), randomAngle(), -randomAngle(), randomAngle(), 0]
swingAnimation.duration = 12.0
swingAnimation.isRemovedOnCompletion = false
swingAnimation.fillMode = kCAFillModeForwards
swingAnimation.fillMode = CAMediaTimingFillMode.forwards
swingAnimation.delegate = self
swingAnimation.setValue("rotation", forKey: "animation")
shapeLayer.add(swingAnimation, forKey: "rotation")
Expand Down
2 changes: 1 addition & 1 deletion Source/WavesLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ open class WavesLoader: FillableLoader {
waveAnimation.values = shapesArray(7)
waveAnimation.duration = 2.0
waveAnimation.isRemovedOnCompletion = false
waveAnimation.fillMode = kCAFillModeForwards
waveAnimation.fillMode = CAMediaTimingFillMode.forwards
waveAnimation.delegate = self
waveAnimation.setValue("shape", forKey: "animation")
shapeLayer.add(waveAnimation, forKey: "shape")
Expand Down