This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class TransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning { | |
| func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { | |
| } | |
| func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class TransitionAnimator: NSObject, UIViewControllerAnimatedTransitioning { | |
| // 1 | |
| let presenting: Bool | |
| // 2 | |
| init(presenting: Bool) { | |
| self.presenting = presenting | |
| } | |
| func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class TransitionCoordinator: NSObject, UINavigationControllerDelegate { | |
| // 1 | |
| var interactionController: UIPercentDrivenInteractiveTransition? | |
| // 2 | |
| func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| switch operation { | |
| case .push: | |
| return TransitionAnimator(presenting: true) | |
| case .pop: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private func saveSomeArticles() { | |
| guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { | |
| return | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private func saveSomeArticles() { | |
| guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { | |
| return | |
| } | |
| // 1 | |
| let context = appDelegate.persistentContainer.viewContext | |
| // 2 | |
| let mediumArticle = Article(context: context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private func loadArticles() -> [Article] { | |
| guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { | |
| return [] | |
| } | |
| let context = appDelegate.persistentContainer.viewContext | |
| // 1 | |
| let request: NSFetchRequest<Article> = Article.fetchRequest() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private func deleteAllArticles() { | |
| guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { | |
| return | |
| } | |
| let context = appDelegate.persistentContainer.viewContext | |
| // 1 | |
| let articles = loadArticles() |
OlderNewer