Skip to content

kf99916/ImageStackView

Repository files navigation

ImageStackView

ImageStackView is a beautiful image stack view to show your selected images..

GitHub stars GitHub forks CocoaPods Compatible Platform GitHub license

ImageStackView ImageStackView

Requirements

  • iOS 9.0 or higher
  • Swift 5

Installation

Swift Package Manager

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

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'

Usage

Import

import ImageStackView

Integration

  • Add the UIView into your storyboard and set the UIView's class as ImageStackView or initialize ImageStackView programmatically.
  • Invoke add(imageView: gestureRecognizers:) to add a imageView to ImageStackView.
  • Invoke remove(imageView:) to remove a imageView to ImageStackView.

ImageStackView

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)

Member Methods

add(imageView: UIImageView, gestureRecognizers: [UIGestureRecognizer] = [])

Add a imageView with gestureRecognizers into the stack view.

remove(imageView: UIImageView)

Remove a imageView from the stack view.

Apps using ImageStackView

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

Hikingbook

Demo

ImageStackViewDemo is a simple demo app which shows the usage of ImageStackView in a storyboard.

Author

Zheng-Xiang Ke, kf99916@gmail.com

License

ImageStackView is available under the MIT license. See the LICENSE file for more info.