turbolinks / turbolinks-ios

Native iOS adapter for building hybrid apps with Turbolinks 5
MIT License
881 stars 92 forks source link

Fix iOS 10 crash with nil snapshot #48

Closed zachwaugh closed 8 years ago

zachwaugh commented 8 years ago

iOS 10 changes snapshotView to return an optional. In some cases, like when the view being snapshotted has been removed from the screen, the snapshot will be nil. Since we expect it to always be non-nil, it will crash on iOS 10 beta, but work fine on iOS 9.

This wraps the snapshot method to return an optional, which we can remove when building against iOS 10 SDK.