ImageStackView is a beautiful image stack view to show your selected images..
- iOS 9.0 or higher
- Swift 5
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, adding ImageStackView as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/kf99916/ImageStackView.git")
]
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate ImageStackView into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'ImageStackView'
import ImageStackView
- Add the UIView into your storyboard and set the UIView's class as
ImageStackView
or initializeImageStackView
programmatically. - Invoke
add(imageView: gestureRecognizers:)
to add a imageView toImageStackView
. - Invoke
remove(imageView:)
to remove a imageView toImageStackView
.
The image stack view.
var imageViews: [UIImageView]
All imageViews in the stack view. (default []
)
var maxNumViews: Int
the maximum of #views in the image stack view. A count text is added to the stack view when #views is larger than this number. (default 5
)
var numViewsInFirstStack: Int
#views in the first stack. If #views in the stack view is larger than this number, The different axis stack will be added. (default 1
)
var spacing: CGFloat
The spacing of the stack view. (default 5
)
add(imageView: UIImageView, gestureRecognizers: [UIGestureRecognizer] = [])
Add a imageView with gestureRecognizers into the stack view.
remove(imageView: UIImageView)
Remove a imageView from the stack view.
If you are using ImageStackView in your app and want to be listed here, simply create a pull request.
I am always curious who is using my projects :)
Hikingbook - by Zheng-Xiang Ke
ImageStackViewDemo is a simple demo app which shows the usage of ImageStackView in a storyboard.
Zheng-Xiang Ke, kf99916@gmail.com
ImageStackView is available under the MIT license. See the LICENSE file for more info.