This commit is contained in:
Peter Iakovlev 2018-11-13 18:09:06 +04:00
parent f27bc011dc
commit 9cb0610c4b
2 changed files with 13 additions and 3 deletions

View File

@ -227,9 +227,7 @@ public extension ContainedViewLayoutTransition {
case .spring:
timingFunction = kCAMediaTimingFunctionSpring
}
node.layer.animateBoundsOriginXAdditive(from: offset, to: 0.0, duration: duration, timingFunction: timingFunction, completion: { completed in
print("completed \(completed)")
})
node.layer.animateBoundsOriginXAdditive(from: offset, to: 0.0, duration: duration, timingFunction: timingFunction)
}
}

View File

@ -384,6 +384,18 @@ open class ViewControllerPresentationArguments {
}
}
@available(iOSApplicationExtension 9.0, *)
public func registerForPreviewingNonNative(with delegate: UIViewControllerPreviewingDelegate, sourceView: UIView, theme: PeekControllerTheme) {
if self.traitCollection.forceTouchCapability != .available {
if self.previewingContext == nil {
let previewingContext = SimulatedViewControllerPreviewing(theme: theme, delegate: delegate, sourceView: sourceView, node: self.displayNode, present: { [weak self] c, a in
self?.presentInGlobalOverlay(c, with: a)
})
self.previewingContext = previewingContext
}
}
}
@available(iOSApplicationExtension 9.0, *)
open override func unregisterForPreviewing(withContext previewing: UIViewControllerPreviewing) {
if self.previewingContext != nil {