Skip to content

Commit

Permalink
fix view orders and crossfade strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Feb 11, 2017
1 parent 80e73a4 commit ea762ec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Hero.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Hero"
s.version = "0.3.0"
s.version = "0.3.1"
s.summary = "Elegant transition library for iOS"

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.3.0</string>
<string>0.3.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 2 additions & 2 deletions Sources/MatchPreprocessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class MatchPreprocessor: BasePreprocessor {
fvState.spring = tvState.spring

tvState.opacity = 0
if !fv.isOpaque || !tv.isOpaque {
// cross fade if fromView is not opaque or if toView is transparent
if !fv.isOpaque || fv.alpha < 1 || !tv.isOpaque || tv.alpha < 1 {
// cross fade if from/toViews are not opaque
fvState.opacity = 0
} else {
// no cross fade in this case, fromView is always displayed during the transition.
Expand Down
8 changes: 1 addition & 7 deletions Sources/UIKit+Hero.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,7 @@ public extension UIView {
}

internal var flattenedViewHierarchy: [UIView] {
var flattened: [UIView] = [self]
var index = 0
while index < flattened.count {
flattened.append(contentsOf: flattened[index].subviews)
index += 1
}
return flattened
return [self] + subviews.flatMap{ $0.flattenedViewHierarchy }
}

/// Used for .overFullScreen presentation
Expand Down

0 comments on commit ea762ec

Please sign in to comment.