/InfiniteScrollGallery

iOS application of infinite scroll gallery using Swift and SwiftUI

Primary LanguageSwift

InfiniteScrollGallery

GitHub license

InfiniteScrollGallery is an iOS app that allows you to browse an infinite gallery of images. Built using Swift and SwiftUI.

Using SwiftUI and UIKit

This repository provides two branches for different iOS development approaches:

  • main: The main branch is built using SwiftUI.

  • uikit: The uikit branch is built using UIKit.

Feel free to choose the branch that aligns with your preferred development framework.

Requirements

  • iOS Deployment Target: 15.0
  • Xcode 15.0
  • Swift 5.9
  • Tested on iPhone 15 Simulator (17.0) and iPhone 13 Pro (16.3.1)

Setup

  1. Make sure you have Cocoapods installed. You can install it with the following command:
sudo gem install cocoapods
  1. Clone the project to your machine:
git clone https://github.com/liauli/InfiniteScrollGallery.git
  1. Navigate to the project directory:
cd InfiniteScrollGallery
  1. Install Ruby dependencies
bundle install
  1. Install the pods:
pod install
  1. Open the project workspace in Xcode:
open InfiniteScrollGallery.xcworkspace

Running the project

Select the InfiniteScrollGallery scheme and the iPhone 15 simulator.

Press Command+R to run the project.

API

The InfiniteScrollGallery project uses a public API (https://api.artic.edu/docs/) to fetch images. The API sometimes returns the same response regardless of the query, which is something that is outside of our control.

Example when API returns same response

  1. Normal API (https://api.artic.edu/api/v1/artworks?fields=id,image_id&limit=15&page=1)

Screenshot 2023-10-08 at 11 45 55

  1. API with query "cat" (https://api.artic.edu/api/v1/artworks?q=cat&fields=id,image_id&limit=15&page=1)

Screenshot 2023-10-08 at 11 46 08

Notice that the ids and image_ids has exactly same value

Contributing

If you have any suggestions or bug reports, please feel free to create a pull request on GitHub.

License

This project is licensed under the MIT License.