A description of this package. This package have two functions: finePushViewController and finePopViewController, they are writen as extension for UINavigationController and allows to push to new/pop ViewController with choosing easy build in animations.
Compatible FROM swift 5, and iOS 13
public func finePushViewController(_ controller: UIViewController,
animationType: CATransitionType = .push,
animationSubType: CATransitionSubtype? = nil,
duration: CFTimeInterval = 0.4) {...}
public func finePopViewController(popToRoot: Bool,
animationType: CATransitionType = .push,
animationSubType: CATransitionSubtype? = nil,
duration: CFTimeInterval = 0.4) {...}
Cocoapods To use
nimationChangingViewController with CocoaPods, add it in your Podfile
.
Close your project. Go to your directory with project in terminal ➡️ paste pod init
➡️ change Podfile - add ⬇️ line before "end" in file
pod 'FAnimationChangingViewController'
✅ pod install
in terminal
now in your folder use <YourProjectName>.xcworkspace
The Swift Package Manager is a tool for managing the distribution of Swift code.
dependencies: [
.package(url: "https://github.com/foxfollow/FAnimationChangingViewController.git")
]
Firstly, import FAnimationChangingViewController
.
import FAnimationChangingViewController
You need to use UINavigationController
, initiate for example in AppDelegate.swift
as in my Example folder and now you can use it new functions instead of pushToViewController(...)
or popViewController
try it like ⬇️
navigationController?.finePushViewController(ExampleFineViewController(), animationType: .moveIn, animationSubType: .fromBottom, duration: 1.0)
navigationController?.finePushViewController(ExampleFineViewController(), animationSubType: .fromTop)
navigationController?.finePopViewController(popToRoot: false, animationType: .fade)
The MIT License (MIT)
Copyright (c) 2022 Heorhii Savoiskyi d3f0ld@proton.me