All Projects → JWAutumn → ACarousel

JWAutumn / ACarousel

Licence: MIT license
A carousel view for SwiftUI | SwiftUI 旋转木马效果

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to ACarousel

SwiftUI-Tooltip
Easy Tooltip for your SwiftUI Project
Stars: ✭ 130 (+4.84%)
Mutual labels:  swiftui, swift5
OnlySwitch
⚙️ All-in-One menu bar app, hide 💻MacBook Pro's notch, dark mode, AirPods, Shortcuts
Stars: ✭ 1,288 (+938.71%)
Mutual labels:  swiftui, swift5
stinsen
Coordinators in SwiftUI. Simple, powerful and elegant.
Stars: ✭ 563 (+354.03%)
Mutual labels:  swiftui, swift5
QuoteKit
A framework to use the free APIs provided by https://quotable.io
Stars: ✭ 17 (-86.29%)
Mutual labels:  swiftui, swift5
SwiftUI-App
This swiftUI Demo is very simple & easy to understand. This swiftUI demo includes On-boarding screens, login screen, forgot password screen, sign up screen, home & logout.
Stars: ✭ 175 (+41.13%)
Mutual labels:  swiftui, swift5
BottomSheet
A sliding Sheet from the bottom of the Screen with 3 States build with SwiftUI.
Stars: ✭ 597 (+381.45%)
Mutual labels:  swiftui, swift5
Harbour
Docker/Portainer management app for iOS
Stars: ✭ 210 (+69.35%)
Mutual labels:  swiftui, swift5
SwiftUIDemo
A demo app showing you how to build a table view and navigation interface with SwiftUI
Stars: ✭ 26 (-79.03%)
Mutual labels:  swiftui, swift5
iOS-SwiftUI-Firebase-Login-Example
Complete Sign up and Sign in Process for iOS SwiftUI - using Firebase Email and Password Authentication.
Stars: ✭ 37 (-70.16%)
Mutual labels:  swiftui, swift5
SimpleToast
SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or MacOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals.
Stars: ✭ 131 (+5.65%)
Mutual labels:  swiftui, swift5
Shift
Light-weight EventKit wrapper.
Stars: ✭ 31 (-75%)
Mutual labels:  swiftui, swift5
aprenda-swift
Uma lista de conteúdos para você aprender Swift
Stars: ✭ 429 (+245.97%)
Mutual labels:  swiftui, swift5
JewelCase
This is the source code for JewelCase, a sample app demonstrating how to use SwiftUI and Firebase together. This slide deck discusses the architecture of the app: https://www.slideshare.net/peterfriese/building-swiftui-apps-with-firebase
Stars: ✭ 42 (-66.13%)
Mutual labels:  swiftui, swift5
Swipeable-View
Simple editActionsForRowAt functionality, written on SWIFTUI
Stars: ✭ 37 (-70.16%)
Mutual labels:  swiftui, swift5
Windows11
💻 Windows 11 in SwiftUI.
Stars: ✭ 177 (+42.74%)
Mutual labels:  swiftui, swift5
LongWeekend-iOS
🏖📱 LongWeekend is iOS Application that supports checking long weekends when taking a vacation in Japan
Stars: ✭ 19 (-84.68%)
Mutual labels:  swiftui, swift5
Scroll Snap Carousel
Carousel based on CSS Scroll Snap functionality
Stars: ✭ 31 (-75%)
Mutual labels:  carousel, scroll
React Native Swiper Flatlist
👆 Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (+75%)
Mutual labels:  carousel, scroll
StoreHelper
Implementing and testing In-App Purchases with StoreKit2 and StoreHelper in Xcode 13, Swift 5.5, SwiftUI, iOS 15 and macOS 12.
Stars: ✭ 158 (+27.42%)
Mutual labels:  swiftui, swift5
GameKitUI.swift
GameKit (GameCenter) for SwiftUI
Stars: ✭ 29 (-76.61%)
Mutual labels:  swiftui, swift5

ACarousel

A carousel view for SwiftUI

中文文档

   

Table of Contents

Requirements

  • iOS 13.0+ / macOS 10.15+ / tvOS 13.0+
  • Xcode 11.0+
  • Swift 5.1+

Install

Swift Package Manager

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")
]

Manually

Download and open the project, drag the ACarousel.swift file into your own project.

Usage

  • 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)
}
...
  • Customize configuration: You can configure the corresponding parameters to customize the display style according to your needs.
 /// ...

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)
    }
}

Example

Download and open ACarouselDemo -> ACarouselDemo.xcodeproj, run and view.

Maintainers

@JWAutumn@Underthestars-zhy@Alexander Chapliuk@thitran-incepit.

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

MIT © JWAutumn

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].