/OverlayController-Swift

Convenient to make an overlay. Written in Swift 3.0

Primary LanguageSwiftMIT LicenseMIT

OverlayController-Swift

Swift 3.0 enter image description here enter image description here

 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.
 

image image image

image image

Installation

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.

Requirements

  • Swift 3.0
  • iOS 8 or higher

Usage

    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

License

OverlayController is distributed under the MIT license.