Image gallery similar to Adidias' app, built in SwiftUI

Overview

TripleStackGallery

TripleStackGallery is a image gallery component, which displays a set of images as a stack of three images, always displaying the image beign currently displayed and the next two ones in the list, under the current image. To move to the next image in the stack, simply swipe the image on the top and the component will dismiss it and present the next image in the stack.

TripleStackGalleryDemo

This component is a rebuild of the image gallery present in the Adidas' store app, but built entirely with SwiftUI:

Installation

This package can be added to a project thorugh Swift Package Manager. To add it through Xcode, select File -> Add Pacakges... and type TripleStackGallery or paste this page's URL in the search field in the top right of the screen.

Adding Package from Xcode

You can also add it by declaring this package as a dependency on your project Package.swift file, inside the dependencies property of your Package:

dependencies: [
    .package(name: "TripleStackGallery", url: "https://github.com/tfmart/TripleStackGallery.git", from: "1.0.0"),
]

How to Use

First, create an instance of TripleStackViewModel by passing the array of images that will be displayed in the gallery. This class will be the source of the images to the component,

let images: [UIImage] = [...]

let viewModel = TripleStackViewModel(images: images)

Use the instance of view model you just created on the TripleStackGallery component initializer

let gallery = TripleStackGallery(viewModel: viewModel)

With the component ready, you should be all set!

Cusotmizations

You can change some of the presentation rules with the TripleStackViewModel class. On it's initializer there are two optional parameters: index and animationDuration

index let's you set the starting index of the gallery when component first appears on screen. Be aware though that if the value set is out of bounds of the images arary, a error message will be shown in place of the gallery component

animationDuration let's you configure the amount of time the animations displayed when transitioning to a new image takes. The default value is 0.25 second

let viewModel = TripleStackViewModel(images: images, index: 2, animationDuration: 0.75)

Contribution

Contributions are always welcome! If you have any trouble with this package, you are welcome to open an issue in this repository. If you want to contribute with code instead, feel free to fork the repo and open a pull request!

You might also like...
How to create a circular and rectangular ImageView with similar image?

chapter11CircularAndRectangularImage How to create a circular and rectangular ImageView with similar image? I add two imageView in Main.storyboard I a

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

📷 A composable image editor using Core Image and Metal.
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component 🎉 v2.0.0-alpha now open!

An image download extension of the image view written in Swift for iOS, tvOS and macOS.
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

📷 A composable image editor using Core Image and Metal.
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component 🎉 v2.0.0-alpha now open!

AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.
AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.

AYImageKit AYImageKit is a Swift Library for Async Image Downloading. Features Async Image Downloading. Can Show Text Initials. Can have Custom Styles

Convert the image to hexadecimal to send the image to e-paper

ConvertImageToHex Convert the image to hexadecimal to send the image to e-paper Conversion Order // 0. hex로 변환할 이미지 var image = UIImage(named: "sample

Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Releases(1.0)
  • 1.0(Dec 26, 2021)

    This is the initial release of the TripleStackGallery component! You can learn more on how to use this component on your project by reading the README. If you run into any issues, feel free to open a new Issue or a Pull Request with your contribution!

    Source code(tar.gz)
    Source code(zip)
Owner
Tomás Martins
iOS Developer at Guru
Tomás Martins
Applies filter to a selected image from the Gallery using Combine

CombinePhotoFiltering App CombinePhotoFiltering is an app that applies sepia and bloom to a selected picture from the Photos app. Highlights The app i

Mauricio Esteves 0 Nov 14, 2021
🖼 Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI.

?? Actomaton-Gallery Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI. NOTE: Most of the code are reused from Harvest-SwiftUI-Gall

Yasuhiro Inami 44 Dec 20, 2022
Photo Gallery App demo using a REST API

Photo Gallery iOS App - (Using Rest API) A demo Photo Gallery App using a Rest API using MVVM architecture in Swift + UIKit. Overview Fully Programmat

Neel Mewada 2 Nov 22, 2021
Nilay Dagdemir 0 Jan 23, 2022
An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.

This project is unmaintained. Alex passed away in an accident in late 2019. His love of iOS development will always be remembered. AXPhotoViewer AXPho

Alex Hill 596 Dec 30, 2022
IRGallery-swift is a powerful gallery for iOS.

IRGallery-swift IRGallery-swift is a powerful gallery for iOS. Features Captions. Rotation support. Load images locally or from a web URL. Custom UITa

Phil Chang 1 Oct 6, 2021
This simple cordova plugin will download picture from an URL and save to IOS Photo Gallery.

Photo Viewer This plugin is intended to download a picture from an URL into IOS Photo library.. How to Install Cordova: cordova plugin add https://git

Alwin jose 1 Oct 23, 2021
iOS photo gallery written in Swift

SwiftPhotoGallery Overview A full screen photo gallery for iOS and tvOS written in Swift. Photos can be panned and zoomed (iOS only) Pinch to zoom (iO

Justin Vallely 271 Dec 17, 2022
Gallery has a clearer flow based on albums and focuses on the use case of selecting video

Description We all love image pickers, don't we? You may already know of ImagePicker, the all in one solution for capturing pictures and selecting ima

null 1 Sep 14, 2022
Slide image viewer library similar to Twitter and LINE.

Overview You can use it simply by passing the necessary information! Serrata is a UI library that allows you to intuitively view images. Features King

Takuma Horiuchi 324 Dec 9, 2022