Skip to content

a iOS library for you to create the effect of rubbing/wiping a front layer of image to reveal the back image.

License

Notifications You must be signed in to change notification settings

lozy219/RubAndReveal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubAndReveal

RubAndReveal is a iOS library for you to create the effect of rubbing/wiping a front layer of image to reveal the back image.

Installation

Using CocoaPods

pod 'RubAndReveal', '~> 0.1.1'

Usage

Objective-C

  • instantiate the RubAndReveal view
  RubAndReveal *demoView = [[RubAndReveal alloc] init];
  • configure the frame of the view

  • set the image

  [demoView configureLayoutWithBackImage:backImage
                              frontImage:frontImage];
  • add to subview
  [self.view addSubview demoView];
  • reset image if you want
  [demoView resetImage];

Swift

  • instantiate the RubAndReveal view
  let demoView = RubAndReveal()
  • configure the frame of the view

  • set the image

  demoView.configureLayoutWithBackImage(backImage, frontImage: frontImage)
  • add to subview
  self.view.addSubview(demoView)
  • reset image if you want
  demoView.resetImage()

Customization

you can change these properties for the RubAndReveal view

  • NSString *lineCap: it specifies the shape of the endpoints of an open path when rub
  • NSString *lineJoin: it specifies the style for join of the rubbing path
  • CGFloat lineWidth: it specifies the width of the rubbing stroke

About

a iOS library for you to create the effect of rubbing/wiping a front layer of image to reveal the back image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published