OverlayController is an implementation of a overlay effect for any view. It can be used to easily add dynamics to user interactions and popups views.
To install OverlayController using CocoaPods, please integrate it in your existing Podfile, or create a new Podfile:
platform :ios, '8.0'
use_frameworks!
target 'You Project' do
pod 'OverlayController', '~> 0.0.1'
end
Then run pod install.
- Swift 3.0
- iOS 8 or higher
var overlayController : OverlayController!
overlayController = OverlayController(aView: customView, overlayStyle: .BlackTranslucent)
overlayController.present(animated: true)
- Properties
open var presentationStyle: PresentationStyle = .Centered
open var transitionStyle: TransitionStyle = .CrossDissolve
open var overlayAlpha: CGFloat = 0.5
open var animateDuration: TimeInterval = 0.25
open var isAllowOverlayTouch = true
open var isAllowDrag = false
/**
The view disappear in the opposite direction.
- set default value is false!
*/
open var isDismissedOppositeDirection = false
- Closures
/**
presentExtra
- parameter willPresent: WillPresent block to be executed before the view is presented.
- parameter completions: Completion block to be executed after the view is presented.
*/
overlayController.presentExtra(animated: true, willPresent: { (overlayController: OverlayController) in
// code...
}) { (finished: Bool, overlayController: OverlayController) in
// code...
}
/**
dismissExtra
- parameter willDismiss: WillDismiss block to be executed before the view is dismissed.
- parameter completions: Completion block to be executed after the view is dismissed.
*/
overlayController.dismissExtra(animated: true, willDismiss: { (overlayController: OverlayController) in
// code...
}) { (finished: Bool, overlayController: OverlayController) in
// code...
}
If you need use the Objective-C version : SnailQuickMaskPopups
OverlayController is distributed under the MIT license.