Skip to content

This package have two functions, they are writen as extension for UINavigationController class and allows to 'push to new' or 'pop' UIViewController with choosing easy build in animations.

License

foxfollow/FAnimationChangingViewController

Repository files navigation

FAnimationChangingViewController

from swift 5.0 from iOS 13 UINavigationController for UIKit Cocoapods Compatible SPM supported

Description

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.

Note

Compatible FROM swift 5, and iOS 13

Functions Introduction

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) {...}

Installation

Cocoapods

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

Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code.

dependencies: [
    .package(url: "https://github.com/foxfollow/FAnimationChangingViewController.git")
]

Usage

Firstly, import FAnimationChangingViewController.

import FAnimationChangingViewController

Initialization

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 ⬇️

Example

navigationController?.finePushViewController(ExampleFineViewController(), animationType: .moveIn, animationSubType: .fromBottom, duration: 1.0)

navigationController?.finePushViewController(ExampleFineViewController(), animationSubType: .fromTop)

navigationController?.finePopViewController(popToRoot: false, animationType: .fade)

License

The MIT License (MIT)

Copyright (c) 2022 Heorhii Savoiskyi d3f0ld@proton.me

About

This package have two functions, they are writen as extension for UINavigationController class and allows to 'push to new' or 'pop' UIViewController with choosing easy build in animations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published