Modal controller as in mail or Apple music application. Similar animation and transition. I tried to repeat all the animations, corner radius and frames. The controller supports gestures and Navigation Bar
Preview GIF loading 4mb
. Please, wait
The project is absolutely free, but but it takes time to support and update it. Your support is very motivating and very important. I often receive emails asking me to update or add functionality. Small donate for a cup of coffee helps to develop the project and make it better
Swift 4.2. Ready for use on iOS 10+
Drop in Source/Sparrow
folder to your Xcode project. Make sure to enable Copy items if needed
and Create groups
Or via CocoaPods:
pod 'SPStorkController'
and import library in class:
import SparrowKit
Create controller (please, set background, it maybe clear color) and set transitioningDelegate
to SPStorkTransitioningDelegate()
. Use present
or dismiss
functions:
let controller = UIViewController()
controller.transitioningDelegate = SPStorkTransitioningDelegate()
controller.modalPresentationStyle = .custom
present(controller, animated: true, completion: nil)
You may want to add a navigation bar to your modal controller. Since it became impossible to change or customize the native controller in swift 4 (I couldn’t even find a way to change the height of bar), I completely create navigation bar. Visually, it looks real, but it doesn’t execute the necessary functions
import UIKit
class ModalController: UIViewController {
let navBar = SPFakeBarView(style: .stork)
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
self.navBar.titleLabel.text = "Title"
self.navBar.leftButton.setTitle("Cancel")
self.navBar.leftButton.target {
self.dismiss()
}
self.view.addSubview(self.navBar)
}
}
You only need to add a navigation bar to the main view, it will automatically layout. Use style .stork
in init SPFakeBarView
. It is image preview with Navigation Bar and without it:
Here I would like to offer you my other projects
Project SPPermission for managing permissions with the customizable visual effects. Beautiful dialog increases the chance of approval (which is important when we request notification). Simple control of this module saves you hours of development. You can start using this project with just two lines of code and easy customization!
The SPStorkController
use SparrowKit library. You can install it if you want to receive updates often. Also in library you can find SPPermission and other useful extensions. For install via CocoaPods use:
pod 'SparrowKit'
If you use pod SPStorkController
, library SparrowKit install automatically.
SPStorkController
is released under the MIT license. Check LICENSE.md for details
If you need develop application or UI, write me to [email protected]. I am develop design and ios apps. I am use swift
. If you want to ask for more functionality, you should create a new issue.
My apps in AppStore: first account & second account