diff --git a/PKHUD.podspec b/PKHUD.podspec index c55d000..38ad394 100644 --- a/PKHUD.podspec +++ b/PKHUD.podspec @@ -1,15 +1,15 @@ Pod::Spec.new do |s| s.name = 'PKHUD' s.module_name = 'PKHUD' - s.version = '5.0.0' - s.summary = 'A Swift 3 based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8 and up' - s.homepage = 'https://github.com/pkluz/PKHUD' + s.version = '5.1.0' + s.summary = 'A Swift 4.2 based reimplementation of the Apple HUD (Volume, Ringer, Rotation,…) for iOS 8 and up' + s.homepage = 'https://github.com/hathway/PKHUD' s.license = 'MIT' s.author = { 'Philip Kluz' => 'Philip.Kluz@gmail.com' } s.platform = :ios, '8.0' s.ios.deployment_target = '8.0' s.requires_arc = true - s.source = { :git => 'https://github.com/pkluz/PKHUD.git', :tag => s.version.to_s } + s.source = { :git => 'https://github.com/hathway/PKHUD.git', :tag => s.version.to_s } s.source_files = 'PKHUD/**/*.{h,swift}' s.resources = 'PKHUD/*.xcassets' end diff --git a/PKHUD.xcodeproj/project.pbxproj b/PKHUD.xcodeproj/project.pbxproj index 1e758ee..f81bbc8 100644 --- a/PKHUD.xcodeproj/project.pbxproj +++ b/PKHUD.xcodeproj/project.pbxproj @@ -329,7 +329,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = NSExceptional; TargetAttributes = { 12CE19F01E25784C0062D873 = { @@ -345,7 +345,7 @@ }; F996321D19514FD8001F73CA = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; }; }; }; @@ -530,12 +530,14 @@ 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_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; @@ -584,12 +586,14 @@ 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_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; @@ -672,8 +676,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -697,8 +700,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.NSExceptional.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUD Demo.xcscheme b/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUD Demo.xcscheme index 55c7908..1f05623 100644 --- a/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUD Demo.xcscheme +++ b/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUD Demo.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUDDemoUITests.xcscheme b/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUDDemoUITests.xcscheme index db4d723..6ea2a22 100644 --- a/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUDDemoUITests.xcscheme +++ b/PKHUD.xcodeproj/xcshareddata/xcschemes/PKHUDDemoUITests.xcscheme @@ -1,6 +1,6 @@ 0.0 { let timer = Timer(timeInterval: gracePeriod, target: self, selector: #selector(PKHUD.handleGraceTimer(_:)), userInfo: nil, repeats: false) - RunLoop.current.add(timer, forMode: .commonModes) + RunLoop.current.add(timer, forMode: RunLoop.Mode.common) graceTimer = timer } else { showContent() } + UIAccessibility.post(notification: UIAccessibility.Notification.layoutChanged, argument: self.container.frameView.content) } func showContent() { diff --git a/PKHUD/PKHUDAnimation.swift b/PKHUD/PKHUDAnimation.swift index 9f63dec..fc3b33c 100644 --- a/PKHUD/PKHUDAnimation.swift +++ b/PKHUD/PKHUDAnimation.swift @@ -45,7 +45,7 @@ public final class PKHUDAnimation { NSNumber(value: 1.0) ] animation.duration = 1.2 - animation.calculationMode = "discrete" + animation.calculationMode = convertToCAAnimationCalculationMode("discrete") animation.repeatCount = Float(INT_MAX) return animation }() @@ -59,3 +59,8 @@ public final class PKHUDAnimation { return animation }() } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToCAAnimationCalculationMode(_ input: String) -> CAAnimationCalculationMode { + return CAAnimationCalculationMode(rawValue: input) +} diff --git a/PKHUD/PKHUDErrorView.swift b/PKHUD/PKHUDErrorView.swift index 6c60d5d..25b6802 100644 --- a/PKHUD/PKHUDErrorView.swift +++ b/PKHUD/PKHUDErrorView.swift @@ -24,12 +24,12 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating { path.addLine(to: CGPoint(x: 88.0, y: 44.0)) return path.cgPath }() - dash.lineCap = kCALineCapRound - dash.lineJoin = kCALineJoinRound + dash.lineCap = CAShapeLayerLineCap.round + dash.lineJoin = CAShapeLayerLineJoin.round dash.fillColor = nil dash.strokeColor = UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0).cgColor dash.lineWidth = 6 - dash.fillMode = kCAFillModeForwards + dash.fillMode = CAMediaTimingFillMode.forwards return dash } @@ -64,7 +64,7 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating { animation.fromValue = 0.0 animation.toValue = angle * CGFloat(.pi / 180.0) animation.duration = 1.0 - animation.timingFunction = CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseInEaseOut) + animation.timingFunction = CAMediaTimingFunction(name:CAMediaTimingFunctionName.easeInEaseOut) return animation } diff --git a/PKHUD/PKHUDSquareBaseView.swift b/PKHUD/PKHUDSquareBaseView.swift index dbcf207..8dbddbf 100644 --- a/PKHUD/PKHUDSquareBaseView.swift +++ b/PKHUD/PKHUDSquareBaseView.swift @@ -33,7 +33,7 @@ open class PKHUDSquareBaseView: UIView { addSubview(subtitleLabel) } - open let imageView: UIImageView = { + public let imageView: UIImageView = { let imageView = UIImageView() imageView.alpha = 0.85 imageView.clipsToBounds = true @@ -41,7 +41,7 @@ open class PKHUDSquareBaseView: UIView { return imageView }() - open let titleLabel: UILabel = { + public let titleLabel: UILabel = { let label = UILabel() label.textAlignment = .center label.font = UIFont.boldSystemFont(ofSize: 17.0) @@ -51,7 +51,7 @@ open class PKHUDSquareBaseView: UIView { return label }() - open let subtitleLabel: UILabel = { + public let subtitleLabel: UILabel = { let label = UILabel() label.textAlignment = .center label.font = UIFont.systemFont(ofSize: 14.0) diff --git a/PKHUD/PKHUDSuccessView.swift b/PKHUD/PKHUDSuccessView.swift index adbe3e7..c7afec9 100644 --- a/PKHUD/PKHUDSuccessView.swift +++ b/PKHUD/PKHUDSuccessView.swift @@ -21,9 +21,9 @@ open class PKHUDSuccessView: PKHUDSquareBaseView, PKHUDAnimating { let layer = CAShapeLayer() layer.frame = CGRect(x: 3.0, y: 3.0, width: 88.0, height: 56.0) layer.path = checkmarkPath.cgPath - layer.fillMode = kCAFillModeForwards - layer.lineCap = kCALineCapRound - layer.lineJoin = kCALineJoinRound + layer.fillMode = CAMediaTimingFillMode.forwards + layer.lineCap = CAShapeLayerLineCap.round + layer.lineJoin = CAShapeLayerLineJoin.round layer.fillColor = nil layer.strokeColor = UIColor(red: 0.15, green: 0.15, blue: 0.15, alpha: 1.0).cgColor layer.lineWidth = 6.0 diff --git a/PKHUD/PKHUDSystemActivityIndicatorView.swift b/PKHUD/PKHUDSystemActivityIndicatorView.swift index c80cd51..157091e 100644 --- a/PKHUD/PKHUDSystemActivityIndicatorView.swift +++ b/PKHUD/PKHUDSystemActivityIndicatorView.swift @@ -40,7 +40,7 @@ public final class PKHUDSystemActivityIndicatorView: PKHUDSquareBaseView, PKHUDA } let activityIndicatorView: UIActivityIndicatorView = { - let activity = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge) + let activity = UIActivityIndicatorView(style: .whiteLarge) activity.color = UIColor.black return activity }() diff --git a/PKHUD/PKHUDTextView.swift b/PKHUD/PKHUDTextView.swift index 1bc4991..5dc5055 100644 --- a/PKHUD/PKHUDTextView.swift +++ b/PKHUD/PKHUDTextView.swift @@ -34,7 +34,7 @@ open class PKHUDTextView: PKHUDWideBaseView { titleLabel.frame = bounds.insetBy(dx: padding, dy: padding) } - open let titleLabel: UILabel = { + public let titleLabel: UILabel = { let label = UILabel() label.textAlignment = .center label.font = UIFont.boldSystemFont(ofSize: 17.0)