Skip to content

Instantly share code, notes, and snippets.

View IAPManager.swift
SKPaymentQueue.default().restoreCompletedTransactions()
View IAPManager.swift
class IAPManager {
func receipt() -> NSData? {
if let receiptURL = Bundle.main.appStoreReceiptURL,
FileManager.default.fileExists(atPath: receiptURL.path) {
return NSData(contentsOf: receiptURL)
}
return nil
}
}
View InteracitveTransition.swift
class InteracitveTransition: UIPercentDrivenInteractiveTransition {
var hasStarted = false
var shouldFinish = false
}
View ChromecastExpandedViewController+TransitioningDelegate.swift
extension ChromecastExpandedViewController: UIViewControllerTransitioningDelegate {
public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return VerticalStackDismissAnimatedTransitioning()
}
}
View gist:c4433264ba288ff204203b7edaf91106
class ChromecastExpandedViewController: UIViewController {
private var dismissInteractiveTransition = InteracitveTransition()
override func viewDidLoad() {
super.viewDidLoad()
addPanGestureRecognizer()
}
}