- July 26, 2025
- Mins Read
Open Xcode
, go to File -> Swift Packages -> Add Package Dependency
and enter https://github.com/JWAutumn/ACarousel
You can also add ACarousel
as a dependency to your Package.swift
:
dependencies: [
.package(url: “https://github.com/JWAutumn/ACarousel”, from: “0.2.0”)
]
Download and open the project, drag the ACarousel.swift
file into your own project.
Basic use: The parameters of ACarousel
have default values, so you can simply pass in the data source and eat it ~
struct Item: Identifiable {
let id = UUID()
let image: Image
}
let roles = [“Luffy”, “Zoro”, “Sanji”, “Nami”, “Usopp”, “Chopper”, “Robin”, “Franky”, “Brook”]
struct ContentView: View {
let items: [Item] = roles.map { Item(image: Image($0)) }
var body: some View {
ACarousel(items) { item in
item.image
.resizable()
.scaledToFill()
.frame(height: 300)
.cornerRadius(30)
}
.frame(height: 300)
}
}
or:
…
var body: some View {
ACarousel(roles, id: \.self) { name in
Image(name)
.resizable()
.scaledToFill()
.frame(height: 300)
.cornerRadius(30)
}
.frame(height: 300)
}
…
/// …
struct ContentView: View {
let items: [Item] = roles.map { Item(image: Image($0)) }
var body: some View {
ACarousel(items,
spacing: 10,
headspace: 10,
sidesScaling: 0.7,
isWrap: true,
autoScroll: .active(2)) { item in
item.image
.resizable()
.scaledToFill()
.frame(height: 300)
.cornerRadius(30)
}
.frame(height: 300)
}
}
NavigationKit is a lightweight library which makes SwiftUI navigation super easy to use. 💻 Installation 📦 Swift Package Manager Using Swift Package Manager, add ...
An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation. NavigationStack Installation ...
With SwiftUI Router you can power your SwiftUI app with path-based routing. By utilizing a path-based system, navigation in your app becomes ...
This package takes SwiftUI's familiar and powerful NavigationStack API and gives it superpowers, allowing you to use the same API not just ...