https://github.com/yurii-lysytsia/uiwindowtransition
UIWindowTransition is easy way to animated set root view controller of UIWindow. It written in Swift 4.2
https://github.com/yurii-lysytsia/uiwindowtransition
ios ios-swift rootviewcontroller swift swift-4 swift4 transition transition-animation uiwindow viewcontroller
Last synced: 4 months ago
JSON representation
UIWindowTransition is easy way to animated set root view controller of UIWindow. It written in Swift 4.2
- Host: GitHub
- URL: https://github.com/yurii-lysytsia/uiwindowtransition
- Owner: yurii-lysytsia
- License: mit
- Archived: true
- Created: 2018-01-31T19:05:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-21T14:37:45.000Z (over 2 years ago)
- Last Synced: 2024-09-29T00:21:46.554Z (8 months ago)
- Topics: ios, ios-swift, rootviewcontroller, swift, swift-4, swift4, transition, transition-animation, uiwindow, viewcontroller
- Language: Swift
- Homepage:
- Size: 27.3 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UIWindowTransition
[]()
[]()
[]()
[]()- [Deprecated!](#deprecated)
- [Requirements](#requirements)
- [Installation](#installation)
- [CocoaPods](#CocoaPods)
- [Manually](#Manually)
- [Usage](#usage)
- [License](#license)## ⚠️ Deprecated!
This repository is currently unsupported because it become a part of [AirKit](https://github.com/yurii-lysytsia/AirKit/blob/master/AirKit/Source/UIKit/UIWindow%2BAirKit.swift) repository.## Requirements
- iOS 8.0+
- Xcode 10.0+
- Swift 4.2+## Installation
### CocoaPods[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:
```bash
$ gem install cocoapods
```- Create `Podfile` into your Xcode project. Open up `Terminal` → `cd` into your project's top-level directory → Run the following command:
```bash
$ pod init
```- Open up created `Podfile`.
```bash
$ open Podfile
```- In the `Podfile` that appears, specify. Instead of ``, enter your project's name :
```ruby
platform :ios, ‘8.0’target '' do
use_frameworks!
pod 'UIWindowTransition'
end
```- Then, run the following command:
```bash
$ pod install
```- Finally, open your Xcode `.xcworkspace`.
### Manually
- Download `UIWindowTransition` and copy file from `Source` folder into your project
## Usage
- First of all you have to import `UIWindowTransition`
```swift
import UIWindowTransition
```- You have the opportunity to use several options to set root view controller. Choose which one suits you best.
```swift// First of all you need get window. e.g:
let window = UIApplication.windows.first// 1. Transition with UIWindow.Transition
// After that you need create UIWindow.Transition and set custom parameters if you need.
var transition = UIWindow.Transition()
transition.style = .fromRight // Set custom transition animation.
transition.duration = 0.4 // Set custom transition duration in seconds.// At the end you need create transition between view controllers and use one of that functions
window.transition(transition, to: newRootViewController)
// or
UIApplication.shared.setRootViewController(newRootController, transition: transition)// 2. Transition with UIWindow.TransitionStyle
// You can make transition between view controllers and use one of that functions
window.transition(to: newRootViewController, style: .fromRight)
// or
UIApplication.shared.setRootViewController(newRootViewController, style: .fromRight)
```## License
Released under the MIT license. See [LICENSE](https://github.com/YuriFox/UIWindowTransition/blob/master/LICENSE) for details.