ShuffleIt

2.0.0

A UI library for SwiftUI custom stack views with a wide range of elegant and unique shuffling, sliding and swiping behaviors.
dscyrescotti/ShuffleIt

What's New

Version 2.0.0

2022-10-02T05:56:46Z

What's new in Version 2.0.0?

  • In Version 2.0.0, ShuffleIt provides a new stack view called CarouselStack with carousel sliding behavior which also supports the customization to its appearance.
  • As there is a new stack view, some modifiers and types for ShuffleStack are renamed to get rid of naming conflicts. Please check out the documentation to migrate to Version 2.0.0 if you are using Version 1.

Action Status MIT License

ShuffleIt is a user interface library for SwiftUI which delivers a collection of customizable stack views with a wide range of elegant shuffling, sliding and swiping behaviours.

CarouselStack ShuffleStack
CarouselStack-Demo ShuffleStack-Demo

💡 Features

For now, ShuffleIt only provides CarouselStack and ShuffleStack views. (🚨 Spoiler Alert - There will be very soon various types of stack views coming.)

CarouselStack

CarouselStack is a stack view with sliding behaviour on the stack of content views with carousel effect. Just like ShuffleStack, it doesn't render all content views but it renders at most five content views which is enough to display content views with sliding animation. Besides, it provides customizablae modifiers to modify the view's appearance so that it is easy to adjust to what is desired.

Usage

let colors: [Color] = [.blue, .brown, .black, .cyan, .green, .indigo, .pink, .purple, .red, .orange, .yellow]
var body: some View {
    CarouselStack(
        colors,
        initialIndex: 0
    ) { color in
        color
            .frame(height: 200)
            .cornerRadius(16)
    }
}
Preview CarouselStack-Preview

To explore more about CarouselStack, check out the documentation.

ShuffleStack

ShuffleStack is a stack view with shuffling behaviour on the stack of content views which will be useful as a banner. Not like normal stack view, it only renders three content views visible on the screen and switches data of content views based on the current index. As it comes with a bunch of modifiers, it is highly customizable to get the desired appearance.

Usage

let colors: [Color] = [.blue, .brown, .black, .cyan, .green, .indigo, .pink, .purple, .red, .orange, .yellow]
var body: some View {
    ShuffleStack(
        colors,
        initialIndex: 0
    ) { color in
        color
            .frame(height: 200)
            .cornerRadius(16)
    }
}
Preview ShuffleStack-Preview

To explore more about ShuffleStack, check out the documentation.

Starting from Version 2.0.0, there are some changes which rename some modifiers and some types of ShuffleStack. Please check out documentation to update your code accordingly.

⚠️ Requirements

  • iOS 15+, macOS 12+, watchOS 8+, tvOS 15+

ShuffleIt is developed using Xcode 13.3.1. Make sure you are using Xcode 13.3.1 and above.

🛠 Installation

📦 Using Swift Package Manager

Add it as a dependency within your Package.swift.

dependencies: [
    .package(url: "https://github.com/dscyrescotti/ShuffleIt.git", from: "2.0.0")
]

🔎 Exploration

Documentation

ShuffleIt provides a clear documentation to increase the familiarity with the API and shallow learning curve when using it. You can check it out via this link.

Demo Project

ShuffleIt also comes with the demo project which is an optimal spot to explore the API usage for available stack views. To run the demo project, you can use the following commands in your terminal.

> git clone https://github.com/dscyrescotti/ShuffleIt.git
> cd ShuffleIt && xed Demo

Afterwards, Xcode will open the project and then you can hit ⌘+R to run the project.

🎉 Motivation

As I'm kinda like an artistic guy, I really indulge in crafting something innovative, in particular, in area of implementing user interface elements. It's a huge pleasure for me to explore the API and create an elegant components and then it has attached to me as my precious hobby. That's why, I used to craft various components to test out what I can achieve so far. Recently, I got the idea of gathering my creations in one place and delivering them to the world so that it can be easily used in other projects and also used as a learning resource for other developers. With this intention, I eventually published my first UI library called ShuffleIt for SwiftUI.

✍️ Author

Scotti | @dscyrescotti

 

👨‍💻 Contributions

ShuffleIt welcomes all developers to contribute if you have any idea to enhance and open an issue if you encounter any bug.

© License

ShuffleIt is available under the MIT license. See the LICENSE file for more info.

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

Last updated: Mon Oct 03 2022 09:43:33 GMT-0500 (GMT-05:00)