diff --git a/Classes/ESTMusicIndicatorContentView.swift b/Classes/ESTMusicIndicatorContentView.swift index f90d3d1..891a792 100644 --- a/Classes/ESTMusicIndicatorContentView.swift +++ b/Classes/ESTMusicIndicatorContentView.swift @@ -175,7 +175,7 @@ class ESTMusicIndicatorContentView: UIView { animation.repeatCount = Float.infinity // Forever animation.autoreverses = true animation.duration = TimeInterval((CGFloat(basePeriod) / 2) * (kBarMaxPeakHeight / peakHeight)) - animation.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionEaseIn) + animation.timingFunction = CAMediaTimingFunction.init(name: CAMediaTimingFunctionName.easeIn) layer.add(animation, forKey: kOscillationAnimationKey) } @@ -188,7 +188,7 @@ class ESTMusicIndicatorContentView: UIView { } animation.toValue = NSValue(cgRect:layer.bounds) animation.duration = kDecayDuration - animation.timingFunction = CAMediaTimingFunction.init(name: kCAMediaTimingFunctionEaseOut) + animation.timingFunction = CAMediaTimingFunction.init(name: CAMediaTimingFunctionName.easeOut) layer.add(animation, forKey: kDecayAnimationKey) } diff --git a/Classes/ESTMusicIndicatorView.swift b/Classes/ESTMusicIndicatorView.swift index 00a5eb3..53f06f9 100644 --- a/Classes/ESTMusicIndicatorView.swift +++ b/Classes/ESTMusicIndicatorView.swift @@ -126,18 +126,18 @@ open class ESTMusicIndicatorView: UIView { addSubview(contentView) prepareLayoutPriorities() setNeedsUpdateConstraints() - NotificationCenter.default.addObserver(self, selector: #selector(UIApplicationDelegate.applicationDidEnterBackground(_:)), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) - NotificationCenter.default.addObserver(self, selector: #selector(UIApplicationDelegate.applicationWillEnterForeground(_:)), name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(UIApplicationDelegate.applicationDidEnterBackground(_:)), name: UIApplication.didEnterBackgroundNotification, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(UIApplicationDelegate.applicationWillEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil) } private func prepareLayoutPriorities() { // Custom views should set default values for both orientations on creation, // based on their content, typically to NSLayoutPriorityDefaultLow or NSLayoutPriorityDefaultHigh. - setContentHuggingPriority(UILayoutPriority.defaultHigh, for: UILayoutConstraintAxis.horizontal) - setContentHuggingPriority(UILayoutPriority.defaultHigh, for: UILayoutConstraintAxis.vertical) + setContentHuggingPriority(UILayoutPriority.defaultHigh, for: NSLayoutConstraint.Axis.horizontal) + setContentHuggingPriority(UILayoutPriority.defaultHigh, for: NSLayoutConstraint.Axis.vertical) - setContentCompressionResistancePriority(UILayoutPriority.defaultHigh, for: UILayoutConstraintAxis.horizontal) - setContentCompressionResistancePriority(UILayoutPriority.defaultHigh, for: UILayoutConstraintAxis.vertical) + setContentCompressionResistancePriority(UILayoutPriority.defaultHigh, for: NSLayoutConstraint.Axis.horizontal) + setContentCompressionResistancePriority(UILayoutPriority.defaultHigh, for: NSLayoutConstraint.Axis.vertical) } deinit { diff --git a/Example/ESTMusicIndicator.xcodeproj/project.pbxproj b/Example/ESTMusicIndicator.xcodeproj/project.pbxproj index 09c8f34..5250208 100644 --- a/Example/ESTMusicIndicator.xcodeproj/project.pbxproj +++ b/Example/ESTMusicIndicator.xcodeproj/project.pbxproj @@ -246,28 +246,28 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1160; ORGANIZATIONNAME = "The EST Group"; TargetAttributes = { 564E7FE71C14624500353CC0 = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0940; + LastSwiftMigration = 1160; }; 564E7FFB1C14624500353CC0 = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1160; TestTargetID = 564E7FE71C14624500353CC0; }; 564E80061C14624500353CC0 = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1160; TestTargetID = 564E7FE71C14624500353CC0; }; }; }; buildConfigurationList = 564E7FE31C14624500353CC0 /* Build configuration list for PBXProject "ESTMusicIndicator" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -373,6 +373,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -420,6 +421,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -427,6 +429,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -467,6 +470,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -481,7 +485,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.est-group.ESTMusicIndicator"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -495,7 +499,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.est-group.ESTMusicIndicator"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -508,7 +512,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.est-group.ESTMusicIndicatorTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ESTMusicIndicator.app/ESTMusicIndicator"; }; name = Debug; @@ -522,7 +526,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.est-group.ESTMusicIndicatorTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ESTMusicIndicator.app/ESTMusicIndicator"; }; name = Release; @@ -535,7 +539,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.est-group.ESTMusicIndicatorUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = ESTMusicIndicator; USES_XCTRUNNER = YES; }; @@ -549,7 +553,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.est-group.ESTMusicIndicatorUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = ESTMusicIndicator; USES_XCTRUNNER = YES; };