SnapCarouselView

main

Carousel View that snaps made purely in SwiftUI.
mrtksn/SnapCarouselView

A Carousel View for SwiftUI

package demonstration

SnapCarouselView can loop through any Identifiable and display it in your custom View.

    import SwiftUI
    import SnapCarouselView
    
    struct ContentView: View {
        let items : [ItemModel] = []
        @State var index : Int = 0
        var body: some View {
            SnapCarouselView(nextIndex : $index, cards: items) { index, item in
                //index
                ItemView(item)
            }
        }
    }
    //Your data type. It has to conform to identifiable
    struct ItemModel : Identifiable {
        }
        
    //Your View that will display the data from you data type
    struct ItemView : View {
        let item : ItemModel
        
        var body: some View {
            // Your code
        }
    }

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 06:15:58 GMT-0900 (Hawaii-Aleutian Daylight Time)