Velar can present a custom view with a swipeable dismiss gesture.
- iOS 8.0+
Velar is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Velar'
final class DefaultBackgroundOverlayDesigner: BackgroundOverlayDesignable {
var dismissLabelText: String {
return "Release to Dismiss!"
}
var hideDismissLabel: Bool {
return false
}
var dismissLabelColor: UIColor {
return UIColor.white
}
var backgroundColor: UIColor {
return UIColor.black.withAlphaComponent(0.4)
}
}
private lazy var velarPresenter: VelarPresenter = {
return VelarPresenterBuilder.build(designer: DefaultBackgroundOverlayDesigner())
}()
velarPresenter.show(view: imagePopOverView, animate: true)
velarPresenter.hide(animate: true)
The VelarPresenter
has a delegate that can be used to know when the presenter is going to present or dismiss.
public protocol VelarPresenterDelegate {
/// Notifies delegate that velar presenter will present.
func willPresent()
/// Notifies delegate that velar presenter will dismiss.
func willDismiss()
/// Notifies delegate that velar presenter did present.
func didPresent()
/// Notifies delegate that velar presenter did dismiss.
func didDismiss()
}
Simply set the delegate of the VelarPresenter
to handle these updates.
velarPresenter.delegate = self
To report a bug or enhancement request, feel free to file an issue under the respective heading.
If you wish to contribute to the project, fork this repo and submit a pull request. Code contributions should follow the standards specified in the Prolific Swift Style Guide.
Copyright (c) 2017 Prolific Interactive
Velar is maintained and sponsored by Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.