This project is from Chapter 11 of the SwiftUI Masterclass. The main goal was to build a pinch-to-zoom image viewer using tap, drag, and magnification gestures. I also took it a step further by breaking everything into small, clean components for better code structure.
A minimal SwiftUI image viewer with smooth zoom, drag, and tap-to-reset interactions. UI updates in real-time and stays responsive while scaling or moving the image.
- Gestures in SwiftUI: Tap, drag, and magnification
- Custom Components: Split UI into small reusable views
- Smooth Animations: Used
withAnimation
andsymbolEffect
- View Coordination: Managed state across different parts of the app
β
Pinch to zoom in and out
β
Double tap to zoom and reset
β
Drag to move image around
β
Info panel with scale and position values
β
Drawer with thumbnails to switch images
β
Clean and modular structure
- Clone the repo
- Open the project in Xcode
- Run on iPhone simulator or physical device (iOS 16+)
For any questions or feedback, feel free to reach out:
- Email: aranfononi@gmail.com