This project uses CoreAnimation to mimic StackView from iOS. I have used UIImageView as the Base View for Stack.
This project uses CoreAnimation
to mimic StackView from iOS. I have used UIImageView
as the Base View for Stack.
Usage is real simple.
Drag and drop VKStackImageView.Swift
in your project.
Add a variable like var vkView : VKStackImageView?
in your UIViewController
.
In your viewDidLoad()
, add the following lines:
vkView = VKStackImageView(imageNamesArray: ["dhoni.jpg","yuvi.jpg","shikhar.jpg","kohli.jpg"])
view.addSubview(vkView!)
buttonTapped
function, add vkView?.toggleGallery()
.That’s it. You are done.