To run the example project, clone the repo, and run pod install
from the Example directory first.
ios >= 8.0
swift >= 3.1
TTAImageBrowser is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TTAImageBrowser"
// create
let browseVc = TTAImageBrowserViewController(the_items, currentIndex:the_index_you_wanna_to_show_first)
// show
browseVc.show()
##API
/// The timeInterval when the image browse enter and exit
public var animationTimeInterval: TimeInterval
/// Init method
public convenience init(_ items: [TTAImageBrowser.TTAImageBrowserViewModel], currentIndex: Int)
/// Show The ImageBrowser
///
/// - Parameter completionHandler: The handler after the browser has been shown
public func show(_ completionHandler: (() -> ())? = default)
/// Is the first one when open or not
public var isFirstOpen: Bool
/// Init the view model wiht image url and corresponding imageView
public init(imageURL: String?, thumbnailImageView: UIImageView?)
/// Init the view model wiht image localPath and corresponding imageView
public init(imageLocalPath: String?, thumbnailImageView: UIImageView?)
/// Init the view model wiht image and corresponding imageView
public init(image: UIImage?, thumbnailImageView: UIImageView?)
/// Init the view model wiht image data and corresponding imageView
public init(data: Data?, thumbnailImageView: UIImageView?)
/// The HUD will always show in the center of the param `view`.
/// If your will is widther or highter than the screen, maybe you should pass a `nil` or `UIApplication.shared.keyWindow` to the `view`
public static func show(_ message: String?, dismissAfter time: TimeInterval = 1, in view: UIView? = UIApplication.shared.keyWindow)
/// Dismiss the the HUD
public static func dismiss(after: TimeInterval)
TMTBO, [email protected]
TTAImageBrowser is available under the MIT license. See the LICENSE file for more info.