Skip to content

15110046/HNImageView

Repository files navigation

HNImageView

CI Status Version License Platform

Demo

Install

CocoaPods

pod 'HNImageView'

Example

For a detailed example, see the Example!.

import HNImageView

class MediaCell: UICollectionViewCell {
    
    @IBOutlet weak var imageView: HNImageView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        let configZoomImageView = HNImageViewConfigure(backgroundColor: .black,
                                             durationDismissZoom: 0.2,
                                             maxZoom: 3,
                                             minZoom: 0.8,
                                             vibrateWhenStop: false,
                                             autoStopWhenZoomMin: false,
                                             isUpdateAlphaWhenHandle: true)
        imageView.config(configZoomImageView)
        
        imageView.image = UIImage.init(named: ["pic1", "pic2", "pic3", "pic4", "pic5"].randomElement() ?? "pic1")
    }
    
    override func prepareForReuse() {
        super.prepareForReuse()
        imageView.prepareForReuse()
    }
}

Author

[email protected], [email protected]

License

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

Copyright (c) 2020 HieuNguyen