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 yourUIViewController
. -
In your
viewDidLoad()
, add the following lines:
vkView = VKStackImageView(imageNamesArray: ["dhoni.jpg","yuvi.jpg","shikhar.jpg","kohli.jpg"])
view.addSubview(vkView!)
- On
buttonTapped
function, addvkView?.toggleGallery()
.
That's it. You are done.