diff --git a/.swift-version b/.swift-version index 9f55b2c..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.0 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e86663d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: objective-c +osx_image: xcode9 +xcode_project: KDInteractiveNavigationController +# xcode_workspace: +xcode_scheme: KDInteractiveNavigationController +xcode_sdk: iphonesimulator10.0 +env: + global: + - FRAMEWORK_NAME=KDInteractiveNavigationController +before_install: + - brew update + - brew outdated carthage || brew upgrade carthage +before_script: + # bootstrap the dependencies for the project + # you can remove if you don't have dependencies + # - carthage bootstrap +script: + - set -o pipefail && xcodebuild test -verbose -scheme "KDInteractiveNavigationController" -destination "platform=iOS Simulator,OS=10.0,name=iPhone 7 Plus" ONLY_ACTIVE_ARCH=NO | xcpretty +before_deploy: + - carthage build --no-skip-current + - carthage archive $FRAMEWORK_NAME +skip_cleanup: true +on: + repo: repo/repo + tags: true diff --git a/DemoApp/DemoApp.xcodeproj/project.pbxproj b/DemoApp/DemoApp.xcodeproj/project.pbxproj index a34f5db..aaf1a27 100644 --- a/DemoApp/DemoApp.xcodeproj/project.pbxproj +++ b/DemoApp/DemoApp.xcodeproj/project.pbxproj @@ -129,12 +129,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Kingiol; TargetAttributes = { 6260F8031C00CE99003DC9FE = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -260,13 +260,21 @@ 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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -305,13 +313,21 @@ 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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -330,6 +346,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -339,13 +356,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = BF6FFFD1C1DE246CCC7B8EC8 /* Pods-DemoApp.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = DemoApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.kingiol.DemoApp; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -353,13 +373,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = 20EF51AEA7B58B499FBB4251 /* Pods-DemoApp.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = DemoApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.kingiol.DemoApp; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/DemoApp/DemoApp/Base.lproj/Main.storyboard b/DemoApp/DemoApp/Base.lproj/Main.storyboard index ec70377..15b971c 100644 --- a/DemoApp/DemoApp/Base.lproj/Main.storyboard +++ b/DemoApp/DemoApp/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -14,26 +18,27 @@ - + - - + + + + @@ -48,20 +53,28 @@ - + + - - + @@ -85,20 +98,18 @@ - + - - + @@ -119,14 +130,13 @@ - + - - + - + @@ -142,10 +152,9 @@ - + - - + @@ -162,12 +171,11 @@ - + - - + @@ -200,13 +207,12 @@ - - + + - - + @@ -226,7 +231,7 @@ - + @@ -237,12 +242,11 @@ - + - - + @@ -276,7 +279,6 @@ - @@ -295,7 +297,6 @@ - @@ -314,9 +315,9 @@ + - - + diff --git a/DemoApp/DemoApp/TwoViewController.swift b/DemoApp/DemoApp/TwoViewController.swift index 93f565e..3bfc6cf 100644 --- a/DemoApp/DemoApp/TwoViewController.swift +++ b/DemoApp/DemoApp/TwoViewController.swift @@ -31,5 +31,24 @@ class TwoViewController: UIViewController { // Pass the selected object to the new view controller. } */ + + @IBAction func showActivityVC() { + + let activityViewController = UIActivityViewController(activityItems: ["hello"], applicationActivities: nil) + activityViewController.interactiveNavigationBarHidden = true + activityViewController.excludedActivityTypes = [ + .postToWeibo, + .print, + .assignToContact, + .saveToCameraRoll, + .addToReadingList, + .postToFlickr, + .postToVimeo, + .assignToContact, + .postToTencentWeibo, + .airDrop + ] + self.present(activityViewController, animated: true, completion: nil) + } } diff --git a/DemoApp/Pods/Pods.xcodeproj/project.pbxproj b/DemoApp/Pods/Pods.xcodeproj/project.pbxproj index b6bd9e7..c66636c 100644 --- a/DemoApp/Pods/Pods.xcodeproj/project.pbxproj +++ b/DemoApp/Pods/Pods.xcodeproj/project.pbxproj @@ -243,10 +243,10 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0900; TargetAttributes = { 0561928EC4BD64F22F762FE0759AB365 = { - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 3129F8A9E159D3D6A45801805ADC09AA = { LastSwiftMigration = 0800; @@ -311,20 +311,30 @@ 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; 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; + 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; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_DEBUG=1", @@ -355,19 +365,29 @@ 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; 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; + 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; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_RELEASE=1", "$(inherited)", @@ -381,6 +401,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SYMROOT = "${SRCROOT}/../build"; VALIDATE_PRODUCT = YES; }; @@ -390,6 +411,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = CF36111D03FDDB19B87A10AABCEE93BD /* Pods-DemoApp.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -426,6 +448,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 4F6DA398B8798082C8619CE9DDAC896F /* Pods-DemoApp.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -485,7 +508,8 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -517,7 +541,8 @@ PRODUCT_NAME = KDInteractiveNavigationController; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/KDInteractiveNavigationController.podspec b/KDInteractiveNavigationController.podspec index 6db30f7..86d11dd 100644 --- a/KDInteractiveNavigationController.podspec +++ b/KDInteractiveNavigationController.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "KDInteractiveNavigationController" - s.version = "0.1.2" + s.version = "0.4" s.summary = "A UINavigationController subclass that support interactive UINavigationbar with hidden or show." s.homepage = "https://github.com/kingiol/KDInteractiveNavigationController" @@ -10,9 +10,14 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT', :file => 'LICENSE' } s.authors = { "kingiol" => "kingxiaokang@gmail.com" } - s.platform = :ios, "8.0" + # s.platform = :ios, "8.0" s.requires_arc = true + s.ios.deployment_target = "8.0" + # s.osx.deployment_target = "10.9" + # s.watchos.deployment_target = "2.0" + # s.tvos.deployment_target = "9.0" + s.source = { :git => "https://github.com/kingiol/KDInteractiveNavigationController.git", :tag => s.version.to_s } s.source_files = "KDInteractiveNavigationController/*.{swift}" diff --git a/KDInteractiveNavigationController.xcodeproj/project.pbxproj b/KDInteractiveNavigationController.xcodeproj/project.pbxproj index 57c4c49..e93bf65 100644 --- a/KDInteractiveNavigationController.xcodeproj/project.pbxproj +++ b/KDInteractiveNavigationController.xcodeproj/project.pbxproj @@ -97,12 +97,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Kingiol; TargetAttributes = { 6260F7991C00A4A7003DC9FE = { CreatedOnToolsVersion = 7.1.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -154,13 +154,21 @@ 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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -188,6 +196,8 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -202,13 +212,21 @@ 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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -228,6 +246,9 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -239,6 +260,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -247,11 +269,13 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.kingiol.component.KDInteractiveNavigationController; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -259,6 +283,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -267,10 +292,12 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.kingiol.component.KDInteractiveNavigationController; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/KDInteractiveNavigationController.xcodeproj/project.xcworkspace/xcuserdata/kingiol.xcuserdatad/UserInterfaceState.xcuserstate b/KDInteractiveNavigationController.xcodeproj/project.xcworkspace/xcuserdata/kingiol.xcuserdatad/UserInterfaceState.xcuserstate index eab92b3..a06da6f 100644 Binary files a/KDInteractiveNavigationController.xcodeproj/project.xcworkspace/xcuserdata/kingiol.xcuserdatad/UserInterfaceState.xcuserstate and b/KDInteractiveNavigationController.xcodeproj/project.xcworkspace/xcuserdata/kingiol.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/KDInteractiveNavigationController.xcscheme b/KDInteractiveNavigationController.xcodeproj/xcshareddata/xcschemes/KDInteractiveNavigationController.xcscheme similarity index 99% rename from KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/KDInteractiveNavigationController.xcscheme rename to KDInteractiveNavigationController.xcodeproj/xcshareddata/xcschemes/KDInteractiveNavigationController.xcscheme index d8174df..51a5852 100644 --- a/KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/KDInteractiveNavigationController.xcscheme +++ b/KDInteractiveNavigationController.xcodeproj/xcshareddata/xcschemes/KDInteractiveNavigationController.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/xcschememanagement.plist b/KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/xcschememanagement.plist index 2a41eec..b60de88 100644 --- a/KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/KDInteractiveNavigationController.xcodeproj/xcuserdata/kingiol.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,7 +4,7 @@ SchemeUserState - KDInteractiveNavigationController.xcscheme + KDInteractiveNavigationController.xcscheme_^#shared#^_ orderHint 0 diff --git a/KDInteractiveNavigationController/UIViewController+InteractiveNavigation.swift b/KDInteractiveNavigationController/UIViewController+InteractiveNavigation.swift index dc818a0..4f59dfc 100644 --- a/KDInteractiveNavigationController/UIViewController+InteractiveNavigation.swift +++ b/KDInteractiveNavigationController/UIViewController+InteractiveNavigation.swift @@ -8,13 +8,21 @@ import UIKit -private var didKDVCInitialized = false - private var interactiveNavigationBarHiddenAssociationKey: UInt8 = 0 -@IBDesignable +extension UIApplication { + override open var next: UIResponder? { + UIViewController.awake + return super.next + } +} + extension UIViewController { - + static let awake : Void = { + replaceInteractiveMethods() + return + }() + @IBInspectable public var interactiveNavigationBarHidden: Bool { get { var associateValue = objc_getAssociatedObject(self, &interactiveNavigationBarHiddenAssociationKey) @@ -27,23 +35,23 @@ extension UIViewController { objc_setAssociatedObject(self, &interactiveNavigationBarHiddenAssociationKey, newValue, .OBJC_ASSOCIATION_RETAIN) } } - - override open static func initialize() { - if !didKDVCInitialized { - replaceInteractiveMethods() - didKDVCInitialized = true - } - } - + fileprivate static func replaceInteractiveMethods() { method_exchangeImplementations( - class_getInstanceMethod(self, #selector(UIViewController.viewWillAppear(_:))), - class_getInstanceMethod(self, #selector(UIViewController.KD_interactiveViewWillAppear(_:)))) + class_getInstanceMethod(self, #selector(UIViewController.viewWillAppear(_:)))!, + class_getInstanceMethod(self, #selector(UIViewController.KD_interactiveViewWillAppear(_:)))!) } - - func KD_interactiveViewWillAppear(_ animated: Bool) { + + @objc func KD_interactiveViewWillAppear(_ animated: Bool) { KD_interactiveViewWillAppear(animated) + let excludeVCs = [ + "CKSMSComposeRemoteViewController", + "CKSMSComposeController", + ] + let vcName = NSStringFromClass(type(of: self)) + if excludeVCs.contains(vcName) { return } navigationController?.setNavigationBarHidden(interactiveNavigationBarHidden, animated: animated) } - + } + diff --git a/README.md b/README.md index 44d4786..1fa22c7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![Swift](https://img.shields.io/badge/language-Swift-orange.svg) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kingiol/KDInteractiveNavigationController/blob/master/LICENSE) [![CocoaPods](https://img.shields.io/cocoapods/v/KDInteractiveNavigationController.svg)](https://github.com/kingiol/KDInteractiveNavigationController) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/kingiol/KDInteractiveNavigationController) ![screenshots](./etc/screenshots.gif) @@ -56,10 +57,10 @@ $ brew install carthage To integrate KDInteractiveNavigationController into your Xcode project using Carthage, specify it in your `Cartfile`: ```ogdl -github 'kingiol/AHKNavigationController' +github 'kingiol/KDInteractiveNavigationController' ``` -Run `carthage` to build the framework and drag the built `AHKNavigationController.framework` into your Xcode project. +Run `carthage` to build the framework and drag the built `KDInteractiveNavigationController.framework` into your Xcode project. ## Usage - Easy to Use