Skip to content

campierce88/SlidableImage

 
 

Repository files navigation

SlidableImage

Build Status codecov codebeat badge GitHub license Platform Version Swift Package Manager compatible Readme Score

Easy to use library for before & after images. One-line initialization and very customizable API.

Requirements

  • iOS 8
  • Swift 3.0

Instalation

This library support

  • Cocoapods
  • Swift Package Manager
pod 'SlidableImage', '~>1.0'

Using

Constructor

Common init with image

init(frame: CGRect, firstImage: UIImage, secondImage: UIImage)

Gemeric init with views

init(frame: CGRect, firstView: UIView, secondView: UIView)

Move slider

updateMask(location maskLocation: CGFloat)

Variables

First image container view. You can override it with your custom view

var firstView: UIView

Second image container view. You can override it with your custom view.

var secondView: UIView

Circle view with icon for sliding images. You can override it with your custom view.

sliderCircle: UIView

Example

let slider = SlidableImage(frame: rect, firstView: firstSubView, secondView: secondSubView)
view.addSubview(slider)

TODO

  • Test with storyboards

Author

Paweł Bednorz, Quver

License

SlidableImage Lib and Slider graphic are available under the MIT license. Check the LICENSE file for more information.

Images from http://www.comicsbeat.com/awesome-infographic-on-the-avengers-then-and-now/

About

Fancy slider for before&after images

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 90.1%
  • Ruby 9.9%