A Swift Package Manager version of FSPagerView, fully compatible with Swift 6.0. This package provides an elegant slider library for iOS applications with various customization options and transition effects.
- Infinite scrolling
- Automatic sliding
- Custom transitions and transformations
- Customizable cell content
- Page control integration
- Support for both UIKit and SwiftUI
- iOS 15.0+
- Swift 6.0+
- Xcode 15.0+
- In Xcode, select
File
→Add Packages...
- Enter the package URL:
https://github.com/kimkyuchul/FSPagerView-SPM
- Select the version or branch you want to use
- Click
Add Package
Alternatively, you can add the following dependency to your Package.swift
:
dependencies: [
.package(url: "https://github.com/kimkyuchul/FSPagerView-SPM", from: "1.3.6")
]
import FSPagerViewSwift
class ViewController: UIViewController, FSPagerViewDataSource, FSPagerViewDelegate {
private let pagerView = FSPagerView()
private let pageControl = FSPageControl()
override func viewDidLoad() {
super.viewDidLoad()
// Configure PagerView
pagerView.register(FSPagerViewCell.self, forCellWithReuseIdentifier: "cell")
pagerView.dataSource = self
pagerView.delegate = self
// Configure PageControl
pageControl.numberOfPages = 5
pageControl.currentPage = 0
}
// MARK: - FSPagerView DataSource
func numberOfItems(in pagerView: FSPagerView) -> Int {
return 5
}
func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
let cell = pagerView.dequeueReusableCell(withReuseIdentifier: "cell", at: index)
cell.imageView?.image = UIImage(named: "image\(index)")
return cell
}
}
import SwiftUI
import FSPagerViewSwift
public struct FSPagerBannerView: UIViewRepresentable {
private let bannerView = FSPagerView()
...
...
...
This package is a Swift Package Manager compatible version of FSPagerView, updated for Swift 6.0 compatibility.
FSPagerView-SPM is available under the MIT license.
Maintained by kimkyuchul
Feel free to open issues or submit pull requests on the GitHub repository.