A customizable ImageView with zooming enabled and zooming region bounded
- iOS 12.0+
- Xcode 10.0+
Add the following to your Podfile:
use_frameworks!
pod 'ImageZoomViewPW', :git => 'https://github.com/pierre-wehbe/ImageZoomViewPW.git', :tag => '1.0.3'
- Open ImageZoomViewPW.xcproject
- Build
- You will get "ImageZoomViewPW.framework" under product
- Go to your project and drag the the framework of 3 anywhere in the project
- Go to Project -> General -> Linked Frameworks and Binaries, the framework should be present there
- Select it and click on the "-" sign to remove it
- Select "+" in the "Embedded Binaries" section and select the framework, it should now be present in both "Embedded Binarie" and "Linked Frameworks and Binaries"
- You're done :)
or just drag and drop ImageZoomViewPW.swift file to your project
import ImageZoomViewPW
@IBOutlet weak var zoomViewPW: ZoomViewPW!
override func viewDidLoad() {
super.viewDidLoad()
zoomViewPW.setImage(#imageLiteral(resourceName: "imageName.jpg"))
}
var zoomPW: ZoomViewPW!
override func viewDidLoad() {
super.viewDidLoad()
zoomPW = ZoomViewPW(frame: CGRect(origin: CGPoint.zero,
size: CGSize(width: UIScreen.main.bounds.size.width / 2.0,
height: UIScreen.main.bounds.size.height / 2.0)),
image: #imageLiteral(resourceName: "IMG_7419.jpg"))
zoomPW.center = view.center
view.addSubview(zoomPW)
}
Contributions are highly appreciated! To submit one:
- Fork
- Commit changes to a branch in your fork
- Push your code and make a pull request
Pierre WEHBE