diff --git a/.jazzy.yaml b/.jazzy.yaml index cef3e04..cb52011 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,6 +1,6 @@ # ---- About ---- module: Hero -module_version: 1.5.0 +module_version: 1.6.0 author: HeroTransitions readme: README.md copyright: 'See [license](https://github.com/HeroTransitions/Hero/blob/develop/LICENSE) for more details.' @@ -9,7 +9,7 @@ copyright: 'See [license](https://github.com/HeroTransitions/Hero/blob/develop/L author_url: https://herotransitions.github.io/Hero/ dash_url: https://herotransitions.github.io/Hero/docsets/Hero.xml github_url: https://github.com/HeroTransitions/Hero/ -github_file_prefix: https://github.com/HeroTransitions/Hero/tree/1.5.0/ +github_file_prefix: https://github.com/HeroTransitions/Hero/tree/1.6.0/ # ---- Sources ---- podspec: Hero.podspec diff --git a/Hero.podspec b/Hero.podspec index a3a6b9b..fbfe512 100644 --- a/Hero.podspec +++ b/Hero.podspec @@ -2,12 +2,12 @@ Pod::Spec.new do |s| s.name = 'Hero' - s.version = '1.5.0' + s.version = '1.6.0' s.summary = 'Elegant transition library for iOS' s.description = <<-DESC - Hero is a library for building iOS view controller transitions. - It provides a declarative layer on top of the UIKit's cumbersome transition APIs. + Hero is a library for building iOS view controller transitions. + It provides a declarative layer on top of the UIKit's cumbersome transition APIs. Making custom transitions an easy task for developers. DESC @@ -16,21 +16,21 @@ Pod::Spec.new do |s| s.documentation_url = 'https://herotransitions.github.io/Hero/' s.screenshots = ['https://git.io/JeRkv', 'https://git.io/JeRke', 'https://git.io/JeRkf', 'https://git.io/JeRkJ'] s.license = { :type => 'MIT' } - s.author = { + s.author = { 'Luke' => 'lzhaoyilun@gmail.com', - 'Joe Mattiello' => 'git@joemattiello.com' + 'Joe Mattiello' => 'git@joemattiello.com' } s.source = { git: 'https://github.com/HeroTransitions/Hero.git', tag: s.version.to_s } s.cocoapods_version = '>= 1.4.0' - s.ios.deployment_target = '8.0' - s.tvos.deployment_target = '9.0' + s.ios.deployment_target = '10.0' + s.tvos.deployment_target = '10.0' s.ios.frameworks = 'UIKit', 'Foundation', 'QuartzCore', 'CoreGraphics', 'CoreMedia' s.tvos.frameworks = 'UIKit', 'Foundation', 'QuartzCore', 'CoreGraphics', 'CoreMedia' - s.swift_version = '4.2' + s.swift_version = '5.0' s.requires_arc = true diff --git a/Hero.xcodeproj/project.pbxproj b/Hero.xcodeproj/project.pbxproj index 2c43bd1..7e7d536 100644 --- a/Hero.xcodeproj/project.pbxproj +++ b/Hero.xcodeproj/project.pbxproj @@ -1186,7 +1186,7 @@ INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero; PRODUCT_NAME = Hero; SDKROOT = appletvos; @@ -1213,7 +1213,7 @@ INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero; PRODUCT_NAME = Hero; SDKROOT = appletvos; @@ -1236,7 +1236,7 @@ DEVELOPMENT_TEAM = 4VSEW78TKT; INFOPLIST_FILE = TvOSExamples/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTvOSExamples; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; @@ -1256,7 +1256,7 @@ DEVELOPMENT_TEAM = 4VSEW78TKT; INFOPLIST_FILE = TvOSExamples/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTvOSExamples; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; @@ -1283,7 +1283,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero; PRODUCT_NAME = Hero; SKIP_INSTALL = YES; @@ -1310,7 +1310,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero; PRODUCT_NAME = Hero; SKIP_INSTALL = YES; @@ -1443,7 +1443,7 @@ INFOPLIST_FILE = "$(SRCROOT)/Examples/Resources/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; @@ -1460,7 +1460,7 @@ INFOPLIST_FILE = "$(SRCROOT)/Examples/Resources/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.5.0; + MARKETING_VERSION = 1.6.0; PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; diff --git a/Hero.xcodeproj/xcshareddata/xcschemes/Hero (tvOS).xcscheme b/Hero.xcodeproj/xcshareddata/xcschemes/Hero (tvOS).xcscheme index 6c24ddf..f3bdece 100644 --- a/Hero.xcodeproj/xcshareddata/xcschemes/Hero (tvOS).xcscheme +++ b/Hero.xcodeproj/xcshareddata/xcschemes/Hero (tvOS).xcscheme @@ -1,6 +1,6 @@ - - - - + + + + BuildSystemType + Latest + PreviewsEnabled + + + diff --git a/Sources/HeroContext.swift b/Sources/HeroContext.swift index f1e1adc..f948e78 100644 --- a/Sources/HeroContext.swift +++ b/Sources/HeroContext.swift @@ -167,7 +167,7 @@ extension HeroContext { if superviewToNoSnapshotSubviewMap[superview] == nil { superviewToNoSnapshotSubviewMap[superview] = [] } - if let index = superview.subviews.index(of: view) { + if let index = superview.subviews.firstIndex(of: view) { superviewToNoSnapshotSubviewMap[superview]!.append((index, view)) } } @@ -272,7 +272,7 @@ extension HeroContext { let pairedView = pairedView(for: view), let pairedSnapshot = snapshotViews[pairedView], let siblingViews = pairedView.superview?.subviews, - let index = siblingViews.index(of: pairedView) { + let index = siblingViews.firstIndex(of: pairedView) { let nextSiblings = siblingViews[index+1.. Bool { - return enabledPlugins.index(where: { return $0 == plugin}) != nil + return enabledPlugins.firstIndex(where: { return $0 == plugin}) != nil } static func enable(plugin: HeroPlugin.Type) { @@ -166,7 +166,7 @@ internal extension HeroTransition { } static func disable(plugin: HeroPlugin.Type) { - if let index = enabledPlugins.index(where: { return $0 == plugin}) { + if let index = enabledPlugins.firstIndex(where: { return $0 == plugin}) { enabledPlugins.remove(at: index) } } diff --git a/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift b/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift index 0fdb957..2fa1daf 100644 --- a/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift +++ b/Sources/Transition/HeroTransition+UITabBarControllerDelegate.swift @@ -42,8 +42,8 @@ extension HeroTransition: UITabBarControllerDelegate { public func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { guard !isTransitioning else { return nil } self.state = .notified - let fromVCIndex = tabBarController.children.index(of: fromVC)! - let toVCIndex = tabBarController.children.index(of: toVC)! + let fromVCIndex = tabBarController.children.firstIndex(of: fromVC)! + let toVCIndex = tabBarController.children.firstIndex(of: toVC)! self.isPresenting = toVCIndex > fromVCIndex self.fromViewController = fromViewController ?? fromVC self.toViewController = toViewController ?? toVC