Skip to content

KenanAtmaca/KTransition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


MIT Licance Pod Platform Tag Swift

Requirements

  • Xcode 9.0 +
  • iOS 11.0 or greater

Installation

CocoaPods

  1. Install CocoaPods
  2. Add this repo to your Podfile
platform :ios, '11.0'

target 'ProjectName' do
  use_frameworks!
  pod 'KTransition'
end
  1. Run pod install
  2. Open up the new .xcworkspace that CocoaPods generated
  3. 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
self.navigationController?.customPushTransition = KTransition.push(style: .top, duration: 0.5)
  • ViewController Present & Dismiss
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
override func touchesBegan(_ touches: Set<UITouch>, 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

  • Alpha
  • Scale
  • Top
  • Left
  • Bounds

License

Usage is provided under the MIT License. See LICENSE for the full details.