diff --git a/CFNotify.podspec b/CFNotify.podspec index ad7601a..b92a510 100644 --- a/CFNotify.podspec +++ b/CFNotify.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CFNotify" - s.version = "1.0.1" + s.version = "1.0.2" s.summary = "A customizable framework to create draggable views" s.homepage = "https://github.com/hallelujahbaby/CFNotify" s.license = { :type => "MIT", :file => "LICENSE" } diff --git a/CFNotify.xcodeproj/project.pbxproj b/CFNotify.xcodeproj/project.pbxproj index 3bda50d..2d4747f 100644 --- a/CFNotify.xcodeproj/project.pbxproj +++ b/CFNotify.xcodeproj/project.pbxproj @@ -408,13 +408,13 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Johnny Choi@Co-Fire"; TargetAttributes = { 05C8271C1DD31B7A003E0C5E = { CreatedOnToolsVersion = 8.1; DevelopmentTeam = 6J24DF2E7Y; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; 05C827251DD31B7A003E0C5E = { @@ -430,10 +430,11 @@ }; buildConfigurationList = 05C827171DD31B7A003E0C5E /* Build configuration list for PBXProject "CFNotify" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 05C827131DD31B7A003E0C5E; productRefGroup = 05C8271E1DD31B7A003E0C5E /* Products */; @@ -565,6 +566,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -574,6 +576,7 @@ 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; @@ -581,6 +584,7 @@ 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; @@ -627,6 +631,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -636,6 +641,7 @@ 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; @@ -643,6 +649,7 @@ 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; @@ -697,8 +704,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -721,8 +727,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "hk.co-fire.CFNotify"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = NO; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/CFNotify.xcodeproj/xcshareddata/xcschemes/CFNotify.xcscheme b/CFNotify.xcodeproj/xcshareddata/xcschemes/CFNotify.xcscheme index a1113f2..4bf7a53 100644 --- a/CFNotify.xcodeproj/xcshareddata/xcschemes/CFNotify.xcscheme +++ b/CFNotify.xcodeproj/xcshareddata/xcschemes/CFNotify.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/CFNotify.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CFNotify.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/CFNotify.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CFNotify/CFNoticeView/ClassicView.swift b/CFNotify/CFNoticeView/ClassicView.swift index ab061d6..a9c5892 100644 --- a/CFNotify/CFNoticeView/ClassicView.swift +++ b/CFNotify/CFNoticeView/ClassicView.swift @@ -190,7 +190,7 @@ open class ClassicView: UIView { /** Set image view's content mode */ - open var imageViewContentMode: UIViewContentMode = .scaleAspectFill { + open var imageViewContentMode: UIView.ContentMode = .scaleAspectFill { didSet { imageView.contentMode = imageViewContentMode } diff --git a/CFNotify/CFNoticeView/CyberView.swift b/CFNotify/CFNoticeView/CyberView.swift index 76499ae..2c2b581 100644 --- a/CFNotify/CFNoticeView/CyberView.swift +++ b/CFNotify/CFNoticeView/CyberView.swift @@ -190,7 +190,7 @@ open class CyberView: UIView { /** Set image view's content mode */ - open var imageViewContentMode: UIViewContentMode = .scaleAspectFill { + open var imageViewContentMode: UIView.ContentMode = .scaleAspectFill { didSet { imageView.contentMode = imageViewContentMode } @@ -212,7 +212,7 @@ open class CyberView: UIView { var vibrancyEffectView: UIVisualEffectView // MARK: - Initialization - public init(title: String? = nil, body: String? = nil, image: UIImage? = nil, blurStyle: UIBlurEffectStyle) { + public init(title: String? = nil, body: String? = nil, image: UIImage? = nil, blurStyle: UIBlurEffect.Style) { blurEffect = UIBlurEffect(style: blurStyle) blurEffectView = UIVisualEffectView(effect: blurEffect) vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect) diff --git a/CFNotify/CFNotifyView.swift b/CFNotify/CFNotifyView.swift index 79e7714..247d07c 100644 --- a/CFNotify/CFNotifyView.swift +++ b/CFNotify/CFNotifyView.swift @@ -84,7 +84,7 @@ extension CFNotifyView { return view } - public static func cyberWith(title: String? = nil, titleFont: UIFont, titleColor: UIColor, body: String? = nil, bodyFont: UIFont, bodyColor: UIColor, image: UIImage? = nil, backgroundColor: UIColor, blurStyle: UIBlurEffectStyle) -> CyberView { + public static func cyberWith(title: String? = nil, titleFont: UIFont, titleColor: UIColor, body: String? = nil, bodyFont: UIFont, bodyColor: UIColor, image: UIImage? = nil, backgroundColor: UIColor, blurStyle: UIBlurEffect.Style) -> CyberView { let view = CyberView(title: title, body: body, image: image, blurStyle: blurStyle) view.titleTextFont = titleFont diff --git a/CFNotify/Notifier.swift b/CFNotify/Notifier.swift index e6d9d4f..1508a86 100644 --- a/CFNotify/Notifier.swift +++ b/CFNotify/Notifier.swift @@ -102,7 +102,7 @@ class Notifier: NSObject, UIGestureRecognizerDelegate { self.containerView.bounds = self.view.bounds self.containerView.backgroundColor = UIColor.clear self.containerView.addSubview(self.view) - self.containerView.bringSubview(toFront: self.view) + self.containerView.bringSubviewToFront(self.view) self.containerView.addGestureRecognizer(self.panRecognizer) if self.tapAction == nil { self.containerView.addGestureRecognizer(self.tapRecognizer) @@ -272,7 +272,7 @@ class Notifier: NSObject, UIGestureRecognizerDelegate { } //Add Push Behaviour - let pushBehavior = UIPushBehavior(items: [gestureView], mode: UIPushBehaviorMode.instantaneous) + let pushBehavior = UIPushBehavior(items: [gestureView], mode: UIPushBehavior.Mode.instantaneous) pushBehavior.pushDirection = vector let pushMagnitude : CGFloat = pushBehavior.magnitude * self.config.pushForceFactor diff --git a/Example/CFNotifyExample/CFNotifyExample.xcodeproj/project.pbxproj b/Example/CFNotifyExample/CFNotifyExample.xcodeproj/project.pbxproj index f9acd1e..6b31848 100644 --- a/Example/CFNotifyExample/CFNotifyExample.xcodeproj/project.pbxproj +++ b/Example/CFNotifyExample/CFNotifyExample.xcodeproj/project.pbxproj @@ -179,20 +179,20 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Johnny@Co-fire"; TargetAttributes = { B231B36F1DD35A1400D29BD5 = { CreatedOnToolsVersion = 8.1; DevelopmentTeam = 6J24DF2E7Y; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = B231B36B1DD35A1400D29BD5 /* Build configuration list for PBXProject "CFNotifyExample" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -271,6 +271,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -280,6 +281,7 @@ 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; @@ -287,6 +289,7 @@ 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; @@ -327,6 +330,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -336,6 +340,7 @@ 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; @@ -343,6 +348,7 @@ 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; @@ -383,8 +389,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "hk.co-fire.CFNotifyExample"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -398,8 +403,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "hk.co-fire.CFNotifyExample"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Example/CFNotifyExample/CFNotifyExample.xcodeproj/xcshareddata/xcschemes/CFNotifyExample.xcscheme b/Example/CFNotifyExample/CFNotifyExample.xcodeproj/xcshareddata/xcschemes/CFNotifyExample.xcscheme index a9701c8..0ba435a 100644 --- a/Example/CFNotifyExample/CFNotifyExample.xcodeproj/xcshareddata/xcschemes/CFNotifyExample.xcscheme +++ b/Example/CFNotifyExample/CFNotifyExample.xcodeproj/xcshareddata/xcschemes/CFNotifyExample.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Example/CFNotifyExample/CFNotifyExample/AppDelegate.swift b/Example/CFNotifyExample/CFNotifyExample/AppDelegate.swift index 4e4f10b..736a692 100644 --- a/Example/CFNotifyExample/CFNotifyExample/AppDelegate.swift +++ b/Example/CFNotifyExample/CFNotifyExample/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. Thread.sleep(forTimeInterval: 2) return true diff --git a/Example/CFNotifyExample/CFNotifyExample/ClassicVC.swift b/Example/CFNotifyExample/CFNotifyExample/ClassicVC.swift index b5d6136..924674c 100644 --- a/Example/CFNotifyExample/CFNotifyExample/ClassicVC.swift +++ b/Example/CFNotifyExample/CFNotifyExample/ClassicVC.swift @@ -58,6 +58,8 @@ class ClassicVC: UIViewController { classicViewConfig.initPosition = .top(.random) classicViewConfig.appearPosition = .top classicViewConfig.hideTime = .never + classicViewConfig.snapDamping = 1.0 + CFNotify.present(config: classicViewConfig, view: classicView) CFNotify.present(config: classicViewConfig, view: classicView2)