Skip to content
Projets

ra1028/PathDynamicModal

Voir sur GitHub

À propos

A modal view using UIDynamicAnimator, like the Path for iOS.

Développement web et applicatif

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

PathDynamicModal

A modal view using UIDynamicAnimator, like the Path for iOS.

Screen shots

screen shot1 screen shot2

Animation

animated gif

Explanation

This is the library that present modal with dynamic animation.
Slant of dismiss modal by tap background is depend on tap horizontal position.
Also, slant of swiping modal is depend on touch horizontal position and amount of swipe down.
If you want to change the modal dropping speed, please set the property showMagnitude or closeMagnitude.
By all means, use the Demo-project.

Installation

Simply copy & paste PathDynamicModal.swift into your project.
Or, use the git-submodule, please.
git submodule add https://github.com/ra1028/PathDynamicModal PathDynamicModal
Cocoapods has not yet supported.

Usage

  1. Create a instance of any UIView subclass.
  2. Call the show(modalView: , inView: ) of PathDynamicModal class-function or instance-function.
  3. For detail, please refer to Demo-project.

Functions

class func show(modalView view: UIView, inView: UIView) -> PathDynamicModal // Show modal with settings default all.
func show(modalView view: UIView, inView: UIView) // Show modal with custom settings.
func closeWithLeansRandom() // Close modal with random slant.
func closeWithStraight() // Close modal with non slant.
func closeWithLeansRight() // Close modal with right slant.
func closeWithLeansLeft() Close modal with left slant.

Property

var backgroundColor: UIColor // Default is UIColor.blackColor()
var backgroundAlpha: CGFloat // Default is 0.7 
var showMagnitude: CGFloat // Default is 250.0. This affects the speed of modal dropping to show.
var closeMagnitude: CGFloat // Default is 170.0. This affects the speed of modal dropping to close.
var closeByTapBackground: Bool // Default is true
var closeBySwipeBackground: Bool // Default is true
var showedHandler: (() -> Void)?
var closedHandler: (() -> Void)?

License

PathDynamicModal is available under the MIT license. See the LICENSE file for more info.

Explorer des projets similaires

Chargement…