Skip to content

Instantly share code, notes, and snippets.

SKPaymentQueue.default().restoreCompletedTransactions()
class IAPManager {
func receipt() -> NSData? {
if let receiptURL = Bundle.main.appStoreReceiptURL,
FileManager.default.fileExists(atPath: receiptURL.path) {
return NSData(contentsOf: receiptURL)
}
return nil
}
}
class InteracitveTransition: UIPercentDrivenInteractiveTransition {
var hasStarted = false
var shouldFinish = false
}
extension ChromecastExpandedViewController: UIViewControllerTransitioningDelegate {
public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return VerticalStackDismissAnimatedTransitioning()
}
}
@sonjh1217
sonjh1217 / gist:c4433264ba288ff204203b7edaf91106
Last active April 28, 2021 13:56
Interactive Transition
class ChromecastExpandedViewController: UIViewController {
private var dismissInteractiveTransition = InteracitveTransition()
override func viewDidLoad() {
super.viewDidLoad()
addPanGestureRecognizer()
}
}