Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Feb 7, 2018
1 parent 01d51ba commit 26240ff
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions README.md
Expand Up @@ -38,16 +38,16 @@ Checkout the [Example Gallery Blog Post](http://lkzhao.com/2016/12/28/hero.html)

##### View Controller 1
```swift
redView.heroID = "ironMan"
blackView.heroID = "batMan"
redView.hero.id = "ironMan"
blackView.hero.id = "batMan"
```

##### View Controller 2
```swift
isHeroEnabled = true
redView.heroID = "ironMan"
blackView.heroID = "batMan"
whiteView.heroModifiers = [.translate(y:100)]
self.hero.isEnabled = true
redView.hero.id = "ironMan"
blackView.hero.id = "batMan"
whiteView.hero.modifiers = [.translate(y:100)]
```


Expand All @@ -56,18 +56,18 @@ whiteView.heroModifiers = [.translate(y:100)]

##### View Controller 1
```swift
greyView.heroID = "skyWalker"
greyView.hero.id = "skyWalker"
```

##### View Controller 2
```swift
isHeroEnabled = true
greyView.heroID = "skyWalker"
self.hero.isEnabled = true
greyView.hero.id = "skyWalker"

// collectionView is the parent view of all red cells
collectionView.heroModifiers = [.cascade]
collectionView.hero.modifiers = [.cascade]
for cell in redCells {
cell.heroModifiers = [.fade, .scale(0.5)]
cell.hero.modifiers = [.fade, .scale(0.5)]
}
```

Expand All @@ -89,25 +89,17 @@ For more up-to-date ones, please see the header-doc. (use **alt+click** in Xcode

## FAQ

#### White flashes occurs on iPhone 7 (Plus) Simulators
#### Not able to use Hero transition even when `self.hero.isEnabled` is set to true

Hero **does not work** on iPhone 7 (Plus) Simulators due to an [Apple bug](https://forums.developer.apple.com/thread/63438). Please use other simulators or a real device when working with Hero.

#### Not able to use Hero transition even when `isHeroEnabled` is set to true

Make sure that you have also enabled `isHeroEnabled` on the navigation controller if you are doing a push/pop inside the navigation controller.
Make sure that you have also enabled `self.hero.isEnabled` on the navigation controller if you are doing a push/pop inside the navigation controller.

#### Views being covered by another matched view during the transition

Matched views use global coordinate space while unmatched views use local coordinate space by default. Local coordinate spaced views might be covered by other global coordinate spaced views. To solve this, use the `useGlobalCoordinateSpace` modifier on the views being covered. Checkout [Coordinate Space Wiki page](https://github.com/lkzhao/Hero/wiki/Coordinate-Space) for details.

#### Weird behavior with UIVisualEffectView

UIVisualEffectView is quite hard to animate due to its private implementation and incompatibility with `snapshotAfterScreenUpdate` and some Core Animation APIs. We are trying to get these solved as much as we can. Currently, as of 0.3.2, only unmatched UIVisualEffectView with noninteractive `.fade` animation is supported.

#### Push animation is shown along side my custom animation

This is the default animation for navigation controller provided by Hero. To disable the push animation, set `heroNavigationAnimationType` to `.fade` or `.none` on the navigation controller.
This is the default animation for navigation controller provided by Hero. To disable the push animation, set `self.hero.navigationAnimationType` to `.fade` or `.none` on the navigation controller.

#### How do I use a different default animation when dismissing

Expand All @@ -116,7 +108,7 @@ You can use the animation type `.selectBy(presenting:dismissing)` to specify a d
For example:

```swift
heroModalAnimationType = .selectBy(presenting:.zoom, dismissing:.zoomOut)
self.hero.modalAnimationType = .selectBy(presenting:.zoom, dismissing:.zoomOut)
```

## Contribute
Expand Down

0 comments on commit 26240ff

Please sign in to comment.