Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kenanatmaca/ktransition

iOS Custom Transition Library
https://github.com/kenanatmaca/ktransition

animation custom-transitions ios ios-transition swift swift-library transition-animation ui ux

Last synced: 2 months ago
JSON representation

iOS Custom Transition Library

Awesome Lists containing this project

README

        











MIT Licance
Pod
Platform
Tag
Swift

## Requirements

- Xcode 9.0 +
- iOS 11.0 or greater

## Installation

### CocoaPods

1. Install [CocoaPods](http://cocoapods.org)
2. Add this repo to your `Podfile`

```ruby
platform :ios, '11.0'

target 'ProjectName' do
use_frameworks!
pod 'KTransition'
end
```

3. Run `pod install`
4. Open up the new `.xcworkspace` that CocoaPods generated
5. Whenever you want to use the library: `import KTransition`

### Manually

1. Simply download the `KTransition` source files and import them into your project.

## Usage

- Navigation Push & Pop

```Swift
self.navigationController?.customPushTransition = KTransition.push(style: .top, duration: 0.5)
```

- ViewController Present & Dismiss

```Swift
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "OtherVC") as! OtherVC
vc.customPresentTransition = KTransition.present(style: .scale, duration: 0.5, startFrame: nil)
self.present(vc, animated: true, completion: nil)
```

- Touch and start in location animate

```Swift
override func touchesBegan(_ touches: Set, with event: UIEvent?) {
let touch = touches.first!
let location = touch.location(in: self.view)

let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "OtherVC") as! OtherVC
vc.customPresentTransition = KTransition.present(style: .bounds, duration: 0.5, startFrame: location)
self.present(vc, animated: true, completion: nil)
}
```

### Animate styles
- [X] Alpha
- [X] Scale
- [X] Top
- [X] Left
- [X] Bounds

## License
Usage is provided under the [MIT License](http://http//opensource.org/licenses/mit-license.php). See LICENSE for the full details.