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
27 changes: 24 additions & 3 deletions KVSpinnerView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,13 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Vladislav;
TargetAttributes = {
8616679F1E40EE910050BD06 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = M375QZ42BY;
LastSwiftMigration = 0940;
ProvisioningStyle = Automatic;
};
8687F2121E41769E00C1392C = {
Expand Down Expand Up @@ -357,15 +358,23 @@
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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -395,6 +404,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -410,15 +420,23 @@
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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -440,6 +458,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -464,7 +483,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.kuznetsov.KVSpinnerView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -485,7 +505,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.kuznetsov.KVSpinnerView;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
20 changes: 10 additions & 10 deletions KVSpinnerView/AnimationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AnimationManager: NSObject {
animation.fromValue = 0
animation.toValue = 1
animation.duration = KVSpinnerView.settings.animationDuration - 0.5
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)

let group = CAAnimationGroup()
group.duration = KVSpinnerView.settings.animationDuration
Expand All @@ -41,7 +41,7 @@ class AnimationManager: NSObject {
animation.fromValue = 0
animation.toValue = 1
animation.duration = KVSpinnerView.settings.animationDuration - 0.5
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)

let group = CAAnimationGroup()
group.duration = KVSpinnerView.settings.animationDuration
Expand All @@ -57,17 +57,17 @@ class AnimationManager: NSObject {
animation.fromValue = 0.0
animation.toValue = 0.4
animation.duration = 0.5
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
animation.repeatCount = 1
animation.fillMode = kCAFillModeForwards
animation.fillMode = CAMediaTimingFillMode.forwards
animation.isRemovedOnCompletion = false

return animation
}()

internal func infiniteStrokeRotateAnimation(isOdd: Bool) -> CAAnimation {
let animation = CABasicAnimation(keyPath: "transform.rotation")
animation.byValue = isOdd ? M_PI * -2.0 : M_PI * 2.0
animation.byValue = isOdd ? Double.pi * -2.0 : Double.pi * 2.0

let group = CAAnimationGroup()
group.beginTime = 0.5
Expand All @@ -84,7 +84,7 @@ class AnimationManager: NSObject {
animation.toValue = 1
animation.repeatCount = 1
animation.duration = KVSpinnerView.settings.fadeInDuration
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)

return animation
}()
Expand All @@ -95,8 +95,8 @@ class AnimationManager: NSObject {
animation.toValue = 0
animation.repeatCount = 1
animation.duration = KVSpinnerView.settings.fadeOutDuration
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
animation.fillMode = kCAFillModeForwards
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
animation.fillMode = CAMediaTimingFillMode.forwards
animation.isRemovedOnCompletion = false

return animation
Expand All @@ -112,8 +112,8 @@ class AnimationManager: NSObject {
animation.toValue = value
animation.repeatCount = 1
animation.duration = 0.3
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.fillMode = kCAFillModeForwards
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
animation.fillMode = CAMediaTimingFillMode.forwards
animation.isRemovedOnCompletion = false
animation.delegate = self

Expand Down
6 changes: 3 additions & 3 deletions KVSpinnerView/Layers/CircleLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class CircleLayer: CAShapeLayer {
let radius = KVSpinnerView.settings.spinnerRadius
let linesDistance = radius / 5

let startEvenAngle = CGFloat(-M_PI_2)
let endEvenAngle = startEvenAngle + CGFloat(M_PI * 2)
let startEvenAngle = CGFloat(-Double.pi / 2)
let endEvenAngle = startEvenAngle + CGFloat(Double.pi * 2)
let startOddAngle = CGFloat(0)
let endOddAngle = startOddAngle + CGFloat(M_PI * 2)
let endOddAngle = startOddAngle + CGFloat(Double.pi * 2)

let isIndexEven = index % 2 == 1
let path = UIBezierPath(
Expand Down
2 changes: 1 addition & 1 deletion KVSpinnerView/Layers/ProgressLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ProgressLayer: CATextLayer {
// foregroundColor = KVSpinnerViewSettings.progressTextColor.cgColor
frame = CGRect(x: 0, y: 0, width: 100, height: 40)
fontSize = 24.0
alignmentMode = kCAAlignmentJustified
alignmentMode = CATextLayerAlignmentMode.justified
}

required init?(coder aDecoder: NSCoder) {
Expand Down
6 changes: 3 additions & 3 deletions KVSpinnerView/Layers/RectangleLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ class RectangleLayer: CAShapeLayer {
var isTextWrapped = false

let messageString = message as NSString
var messageWidth = messageString.size(attributes: [NSFontAttributeName : font]).width
var messageWidth = messageString.size(withAttributes: [NSAttributedString.Key.font : font]).width
if messageWidth > 200 {
isTextWrapped = true
messageWidth = 200
}

let attributes = [NSFontAttributeName : font]
let attributes = [NSAttributedString.Key.font : font]
let attributedString = NSAttributedString(string: message,
attributes: attributes)

Expand All @@ -70,7 +70,7 @@ class RectangleLayer: CAShapeLayer {
y: KVSpinnerView.settings.spinnerRadius,
width: max(messageWidth, rectSide),
height: isTextWrapped ? messageHeight : 25))
let radius = KVSpinnerView.settings.spinnerRadius
// let radius = KVSpinnerView.settings.spinnerRadius
// let layerPosition = CGPoint(x: bounds.midX, y: radius + frame.size.height)
// statusLayer.position = layerPosition

Expand Down
4 changes: 2 additions & 2 deletions KVSpinnerView/Layers/StatusTitleLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class StatusTitleLayer: CATextLayer {
font = UIFont.systemFont(ofSize: 16.0) //TODO: Change realization to SpinnerSettings
fontSize = 16.0
contentsScale = UIScreen.main.scale
alignmentMode = kCAAlignmentCenter
alignmentMode = CATextLayerAlignmentMode.center
foregroundColor = KVSpinnerView.settings.statusTextColor.cgColor
isWrapped = true

truncationMode = "middle"
truncationMode = CATextLayerTruncationMode(rawValue: "middle")
// backgroundColor = UIColor.red.cgColor // <- Uncomment to see layers frame borders
}

Expand Down
32 changes: 28 additions & 4 deletions Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.