diff --git a/Source/ShoutFactory.swift b/Source/ShoutFactory.swift index 3211985..37b99c6 100644 --- a/Source/ShoutFactory.swift +++ b/Source/ShoutFactory.swift @@ -208,7 +208,7 @@ open class ShoutView: UIView { // MARK: - Timer methods - open func displayTimerDidFire() { + @objc open func displayTimerDidFire() { shouldSilent = true if panGestureActive { return } @@ -262,7 +262,7 @@ open class ShoutView: UIView { // MARK: - Handling screen orientation - func orientationDidChange() { + @objc func orientationDidChange() { setupFrames() } } diff --git a/Source/WhisperFactory.swift b/Source/WhisperFactory.swift index 7043558..380fe43 100644 --- a/Source/WhisperFactory.swift +++ b/Source/WhisperFactory.swift @@ -173,11 +173,11 @@ class WhisperFactory: NSObject { // MARK: - Timer methods - func delayFired(_ timer: Timer) { + @objc func delayFired(_ timer: Timer) { hideView() } - func presentFired(_ timer: Timer) { + @objc func presentFired(_ timer: Timer) { guard let navigationController = self.navigationController, let userInfo = timer.userInfo as? [String : AnyObject], let title = userInfo["title"] as? String, @@ -252,7 +252,7 @@ class WhisperFactory: NSObject { // MARK: - Handling screen orientation - func orientationDidChange() { + @objc func orientationDidChange() { guard let navigationController = self.navigationController else { return } for subview in navigationController.navigationBar.subviews { guard let whisper = subview as? WhisperView else { continue } diff --git a/Source/WhistleFactory.swift b/Source/WhistleFactory.swift index e25105f..019450c 100644 --- a/Source/WhistleFactory.swift +++ b/Source/WhistleFactory.swift @@ -103,7 +103,7 @@ open class WhistleFactory: UIViewController { NSString(string: text).boundingRect( with: CGSize(width: labelWidth, height: CGFloat.infinity), options: NSStringDrawingOptions.usesLineFragmentOrigin, - attributes: [NSFontAttributeName: titleLabel.font], + attributes: [NSAttributedStringKey.font: titleLabel.font], context: nil ) titleLabelHeight = CGFloat(neededDimensions.size.height) @@ -166,11 +166,11 @@ open class WhistleFactory: UIViewController { // MARK: - Timer methods - public func timerDidFire() { + @objc public func timerDidFire() { hide() } - func orientationDidChange() { + @objc func orientationDidChange() { if whistleWindow.isKeyWindow { setupFrames() hide() diff --git a/Whisper.podspec b/Whisper.podspec index b271304..6cd0a04 100644 --- a/Whisper.podspec +++ b/Whisper.podspec @@ -11,5 +11,5 @@ Pod::Spec.new do |s| s.requires_arc = true s.source_files = 'Source/**/*' s.frameworks = 'UIKit', 'Foundation' - s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' } + s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' } end diff --git a/Whisper.xcodeproj/project.pbxproj b/Whisper.xcodeproj/project.pbxproj index 17c612c..ed17efb 100644 --- a/Whisper.xcodeproj/project.pbxproj +++ b/Whisper.xcodeproj/project.pbxproj @@ -133,7 +133,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Hyper Interaktiv AS"; TargetAttributes = { 290530F81C20511C00FB382C = { @@ -198,14 +198,20 @@ 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_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_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; @@ -248,14 +254,20 @@ 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_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_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; @@ -299,7 +311,7 @@ PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Whisper; PRODUCT_NAME = Whisper; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -318,7 +330,7 @@ PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Whisper; PRODUCT_NAME = Whisper; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Whisper.xcodeproj/xcshareddata/xcschemes/Whisper-iOS.xcscheme b/Whisper.xcodeproj/xcshareddata/xcschemes/Whisper-iOS.xcscheme index dbe103b..920f78d 100644 --- a/Whisper.xcodeproj/xcshareddata/xcschemes/Whisper-iOS.xcscheme +++ b/Whisper.xcodeproj/xcshareddata/xcschemes/Whisper-iOS.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO"