Skip to content

prolificinteractive/Velar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Velar

Travis build status Cocoapods Compatible Platform Docs

Description

Velar can present a custom view with a swipeable dismiss gesture.

Velar.gif

Requirements

  • iOS 8.0+

Installation

CocoaPods

Velar is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Velar'

Usage

Create the Designer

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)
    }
}

Build the Modal View Presenter

private lazy var velarPresenter: VelarPresenter = {
    return VelarPresenterBuilder.build(designer: DefaultBackgroundOverlayDesigner())
}()

Show the Alert

velarPresenter.show(view: imagePopOverView, animate: true)

Hide the Alert

velarPresenter.hide(animate: true)

Presenter Delegate

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

Contributing to Velar

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.

License

prolific

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.