This project is only for SwiftUI
An automatic scrolling carousel similar to how ScrollView is used
- iOS 13.0
- macOS 10.15
- tvOS 13.0
- watchOS 6.0
structItem:Identifiable{letid=UUID()letimage:Stringlettitle:String}letitems=[Item(image:"image1", title:"first"),Item(image:"image2", title:"second"),Item(image:"image3", title:"third"),Item(image:"image4", title:"fourth")]varbody:someView{VStack{Spacer()Slideshow(items, spacing:20, isWrap:true, autoScroll:.active(2)){ item initemView(item: item).frame(width:350, height:200).cornerRadius(16)}.frame(width:UIScreen.main.bounds.width, height:200)Spacer()}}@ViewBuilderfunc itemView(item:Item)->someView{ZStack{Image(item.image).resizable().aspectRatio(contentMode:.fill).frame(height:200)}}You can add Slideshow to an Xcode project by adding it as a package dependency
- From the File menu, select Swift Packages > Add Package Dependency...
- Enter https://github.com/HumorousGhost/Slideshow into the package repository URL text field.
- Link Slideshow to your application target.
