Skip to content

Commit

Permalink
Merge branch 'release/1.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeMatt committed Sep 1, 2022
2 parents efa7096 + 5268cdb commit 66a554b
Show file tree
Hide file tree
Showing 143 changed files with 2,627 additions and 2,444 deletions.
22 changes: 22 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- confirmed bug
- investigating
- bug?
- WIP
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: true

20 changes: 20 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Swift Lint

on:
pull_request:
paths:
- '.github/workflows/swiftlint.yml'
- '.swiftlint.yml'
- '**/*.swift'

jobs:
swift-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DIFF_BASE: ${{ github.base_ref }}
6 changes: 3 additions & 3 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ---- About ----
module: Hero
module_version: 1.6.1
module_version: 1.6.2
author: HeroTransitions
readme: README.md
copyright: 'See [license](https://github.com/HeroTransitions/Hero/blob/develop/LICENSE) for more details.'
Expand All @@ -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.6.1/
github_file_prefix: https://github.com/HeroTransitions/Hero/tree/1.6.2/

# ---- Sources ----
podspec: Hero.podspec
Expand All @@ -21,7 +21,7 @@ min_acl: public
hide_documentation_coverage: false
skip_undocumented: false
objc: false
# swift_version: 5.1.0
# swift_version: 5.1.0

# ---- Formatting ----
theme: fullwidth
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
The changelog for `Hero`. Also see the [releases](https://github.com/HeroTransitions/Hero/releases) on GitHub.

--------------------------------------
## [1.6.2](https://github.com/HeroTransitions/Hero/releases/tag/1.6.2)

### Fixed

- [#717](https://github.com/HeroTransitions/Hero/issues/717)
- [#734](https://github.com/HeroTransitions/Hero/issues/734)
- [#735](https://github.com/HeroTransitions/Hero/issues/735)
- [#736](https://github.com/HeroTransitions/Hero/issues/736)
- [#739](https://github.com/HeroTransitions/Hero/issues/739)
- [#740](https://github.com/HeroTransitions/Hero/issues/740) Fix build warings in XCode 13.4.1 c30a7a867d3bc420e90ad276d9bf12287628ce87
- [#742](https://github.com/HeroTransitions/Hero/issues/742) Add `anchorPoint` support for transitioning a76e9f6dbeefb530743994634d37235e59401911


## [1.6.1](https://github.com/HeroTransitions/Hero/releases/tag/1.6.1)

### Added
Expand All @@ -28,7 +41,6 @@ The changelog for `Hero`. Also see the [releases](https://github.com/HeroTransit
- #595 - Add Accio supported badge
- #619 - XCode 11/12 support in example
- CI/CD improvements

### Changed

- #648 - Updated iOS version support
Expand Down
2 changes: 1 addition & 1 deletion Hero.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'Hero'
s.version = '1.6.1'
s.version = '1.6.2'
s.summary = 'Elegant transition library for iOS'

s.description = <<-DESC
Expand Down
16 changes: 8 additions & 8 deletions Hero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero;
PRODUCT_NAME = Hero;
SDKROOT = appletvos;
Expand Down Expand Up @@ -1233,7 +1233,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero;
PRODUCT_NAME = Hero;
SDKROOT = appletvos;
Expand All @@ -1259,7 +1259,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTvOSExamples;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
Expand All @@ -1282,7 +1282,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTvOSExamples;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
Expand Down Expand Up @@ -1315,7 +1315,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero;
PRODUCT_NAME = Hero;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1347,7 +1347,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero;
PRODUCT_NAME = Hero;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1486,7 +1486,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand Down Expand Up @@ -1519,7 +1519,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.6.1;
MARKETING_VERSION = 1.6.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
Expand Down
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ let package = Package(
],
products: [
.library(name: "Hero",
type: .dynamic,
targets: ["Hero"]),
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DEPENDENCIES:
- CollectionKit

SPEC REPOS:
https://cdn.cocoapods.org/:
trunk:
- CollectionKit

SPEC CHECKSUMS:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ let package = Package(
targets: ["MyPackage"]),
],
dependencies: [
.package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.6.1"))
.package(url: "https://github.com/HeroTransitions/Hero.git", .upToNextMajor(from: "1.6.2"))
],
targets: [
.target(
name: "MyPackage",1.6.1
name: "MyPackage",
dependencies: ["Hero"])
]
)
Expand Down
1 change: 0 additions & 1 deletion SUMMARY.md

This file was deleted.

4 changes: 4 additions & 0 deletions Sources/Animator/HeroCoreAnimationViewContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ internal class HeroCoreAnimationViewContext: HeroAnimatorViewContext {
state.cornerRadius != nil ||
state.opacity != nil ||
state.overlay != nil ||
state.anchorPoint != nil ||
state.backgroundColor != nil ||
state.borderColor != nil ||
state.borderWidth != nil ||
Expand Down Expand Up @@ -290,6 +291,9 @@ internal class HeroCoreAnimationViewContext: HeroAnimatorViewContext {
if let zPosition = targetState.zPosition {
rtn["zPosition"] = NSNumber(value: zPosition.native)
}
if let anchorPoint = targetState.anchorPoint {
rtn["anchorPoint"] = NSValue(cgPoint: anchorPoint)
}

if let borderWidth = targetState.borderWidth {
rtn["borderWidth"] = NSNumber(value: borderWidth.native)
Expand Down
3 changes: 2 additions & 1 deletion Sources/Animator/HeroViewPropertyViewContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ internal class HeroViewPropertyViewContext: HeroAnimatorViewContext {
}

override func resume(timePassed: TimeInterval, reverse: Bool) -> TimeInterval {
guard let visualEffectView = snapshot as? UIVisualEffectView else { return 0 }
guard let visualEffectView = snapshot as? UIVisualEffectView else { return .zero }
guard duration > 0 else { return .zero }
if reverse {
viewPropertyAnimator?.stopAnimation(false)
viewPropertyAnimator?.finishAnimation(at: .current)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Debug Plugin/HeroDebugView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import UIKit

protocol HeroDebugViewDelegate: class {
protocol HeroDebugViewDelegate: AnyObject {
func onProcessSliderChanged(progress: Float)
func onPerspectiveChanged(translation: CGPoint, rotation: CGFloat, scale: CGFloat)
func on3D(wants3D: Bool)
Expand Down
8 changes: 6 additions & 2 deletions Sources/Extensions/UIKit+Hero.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ import UIKit
private let parameterRegex = "(?:\\-?\\d+(\\.?\\d+)?)|\\w+"
private let modifiersRegex = "(\\w+)(?:\\(([^\\)]*)\\))?"

internal extension NSObject {
internal extension NSCoding where Self: NSObject {
func copyWithArchiver() -> Any? {
return NSKeyedUnarchiver.unarchiveObject(with: NSKeyedArchiver.archivedData(withRootObject: self))!
if #available(iOS 11.0, tvOS 11.0, *) {
return try? NSKeyedUnarchiver.unarchivedObject(ofClass: type(of: self), from: NSKeyedArchiver.archivedData(withRootObject: self, requiringSecureCoding: false))
} else {
return NSKeyedUnarchiver.unarchiveObject(with: NSKeyedArchiver.archivedData(withRootObject: self))!
}
}
}

Expand Down
22 changes: 10 additions & 12 deletions Sources/Extensions/UIViewController+Hero.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public extension HeroExtension where Base: UIViewController {
}

/**
Replace the current view controller with another VC on the navigation/modal stack.
Replace the current view controller with another VC on the navigation/modal/root view of UIWindow stack.
*/
func replaceViewController(with next: UIViewController, completion: (() -> Void)? = nil) {
let hero = next.transitioningDelegate as? HeroTransition ?? Hero.shared
Expand All @@ -324,21 +324,19 @@ public extension HeroExtension where Base: UIViewController {
hero.forceNotInteractive = true
}
navigationController.setViewControllers(viewControllers: vcs, animated: true, completion: completion)
} else if let container = base.view.superview {
let parentVC = base.presentingViewController
} else if let container = base.view.superview, let parentVC = base.presentingViewController {
hero.transition(from: base, to: next, in: container) { [weak base] finished in
guard let base = base else { return }
guard finished else { return }

guard let base = base, finished else { return }
next.view.window?.addSubview(next.view)
if let parentVC = parentVC {
base.dismiss(animated: false) {
parentVC.present(next, animated: false, completion: completion)
}
} else {
parentVC?.view.window?.rootViewController = next
base.dismiss(animated: false) {
parentVC.present(next, animated: false, completion: completion)
}
}
} else if let baseWindow = base.view.window, baseWindow.rootViewController == base {
hero.transition(from: base, to: next, in: baseWindow) { [weak base] finished in
guard base != nil, finished else { return }
baseWindow.rootViewController = next
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Sources/HeroTargetState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public struct HeroTargetState {
public var cornerRadius: CGFloat?
public var backgroundColor: CGColor?
public var zPosition: CGFloat?
public var anchorPoint: CGPoint?

public var contentsRect: CGRect?
public var contentsScale: CGFloat?
Expand Down
6 changes: 3 additions & 3 deletions Sources/HeroTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

import UIKit

public protocol HeroPreprocessor: class {
public protocol HeroPreprocessor: AnyObject {
var hero: HeroTransition! { get set }
func process(fromViews: [UIView], toViews: [UIView])
}

public protocol HeroAnimator: class {
public protocol HeroAnimator: AnyObject {
var hero: HeroTransition! { get set }
func canAnimate(view: UIView, appearing: Bool) -> Bool
func animate(fromViews: [UIView], toViews: [UIView]) -> TimeInterval
Expand All @@ -41,7 +41,7 @@ public protocol HeroAnimator: class {
func changeTarget(state: HeroTargetState, isDestination: Bool, to view: UIView)
}

public protocol HeroProgressUpdateObserver: class {
public protocol HeroProgressUpdateObserver: AnyObject {
func heroDidUpdateProgress(progress: Double)
}

Expand Down
3 changes: 3 additions & 0 deletions Sources/Preprocessors/SourcePreprocessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class SourcePreprocessor: BasePreprocessor {
if view.layer.contentsScale != targetView.layer.contentsScale {
state.contentsScale = targetView.layer.contentsScale
}
if view.layer.anchorPoint != targetView.layer.anchorPoint {
state.anchorPoint = targetView.layer.anchorPoint
}

context[view] = state
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CoreMedia
import CoreGraphics

extension CMTime {
static let zero = CMTime.zero
static let zero = kCMTimeZero
}

enum CAMediaTimingFillMode {
Expand Down Expand Up @@ -46,7 +46,7 @@ extension UIViewController {

extension RunLoop {
enum Mode {
static let common = RunLoop.Mode.common
static let common = RunLoopMode.commonModes
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Transition/HeroProgressRunner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#if canImport(UIKit)
import QuartzCore

protocol HeroProgressRunnerDelegate: class {
protocol HeroProgressRunnerDelegate: AnyObject {
func updateProgress(progress: Double)
func complete(finished: Bool)
}
Expand Down
Loading

0 comments on commit 66a554b

Please sign in to comment.