This project is a native iOS application developed as part of a coding challenge. It demonstrates a clean, modern architecture using the latest Apple frameworks and development practices, without relying on any third-party libraries.
The app displays a grid of photos retrieved from the public Picsum Photos API, which does not require any API key. Users can scroll through a masonry layout and tap on an image to view its detail with a smooth transition animation.
If the device is offline, previously fetched data is loaded from the local SwiftData store as a fallback.
- Clean Architecture with clear separation between
Domain,Data, andPresentationlayers. - MVVM (Model–View–ViewModel) pattern for UI management and data binding.
- Repository pattern for abstracting data sources (network + local persistence).
- Use Cases encapsulate application-specific business logic.
- Built entirely with SwiftUI using declarative, reactive UI principles.
- Masonry-style photo grid with adaptive columns and pagination.
- Matched geometry animations for transitioning between list and detail views.
- Smooth bounce and fade-in animations when images load.
- Xcode: 16.2
- Deployment version: iOS 18.2
- Language: Swift 6
- UI Framework: SwiftUI
- Local Persistence: SwiftData
- Networking: URLSession (no external library)
- Testing:
- Swift Tests for unit and integration testing (repository, use case, and view model).
- XCUITest for UI automation (grid rendering, pagination, and overlay transitions).
The app uses the open Picsum Photos endpoint:
https://picsum.photos/v2/list?page={page}&limit={limit}
This endpoint returns a JSON list of photo objects containing author name, dimensions, and URLs for downloading images. No authentication or API key is required.
- Open the project in Xcode 16 or newer.
- Select the
HatchworksChallenge-iOSscheme. - Choose an iOS simulator (iPhone 15 or newer recommended).
- Run the app (
Cmd + R).
The app will fetch and display the first page of photos. Scrolling to the bottom automatically triggers pagination. Tapping on any image opens the detail view with an animated expansion.
To run all tests:
Cmd + U
This executes both unit tests and UI tests. UI tests include checks for:
- Initial grid rendering
- Infinite scrolling pagination
- Overlay transition and close behavior
Below are a few screenshots of the app in action:
| Grid View | Detail View | Offline Mode |
|---|---|---|
![]() |
![]() |
![]() |
These images demonstrate the masonry layout, smooth transition animation, and SwiftData offline persistence.


