Skip to content

Swift Package Manager version of FSPagerView, fully compatible with Swift 6.0

License

Notifications You must be signed in to change notification settings

kimkyuchul/FSPagerView-SPM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FSPagerView-SPM (Swift 6.0)

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.

Features

  • Infinite scrolling
  • Automatic sliding
  • Custom transitions and transformations
  • Customizable cell content
  • Page control integration
  • Support for both UIKit and SwiftUI

Requirements

  • iOS 15.0+
  • Swift 6.0+
  • Xcode 15.0+

Installation

Swift Package Manager

  1. In Xcode, select FileAdd Packages...
  2. Enter the package URL: https://github.com/kimkyuchul/FSPagerView-SPM
  3. Select the version or branch you want to use
  4. 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")
]

Usage

Import the package

import FSPagerViewSwift

Basic UIKit Implementation

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

SwiftUI Implementation

import SwiftUI
import FSPagerViewSwift

public struct FSPagerBannerView: UIViewRepresentable {
  private let bannerView = FSPagerView()
...
...
...

Credits

This package is a Swift Package Manager compatible version of FSPagerView, updated for Swift 6.0 compatibility.

License

FSPagerView-SPM is available under the MIT license.

Author

Maintained by kimkyuchul


Feel free to open issues or submit pull requests on the GitHub repository.

About

Swift Package Manager version of FSPagerView, fully compatible with Swift 6.0

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published