From 2f16b6f98fd66fa45468a4a99c4a691ea6253cb9 Mon Sep 17 00:00:00 2001 From: Sereivoan Yong Date: Sun, 12 Jan 2020 23:24:01 +0700 Subject: [PATCH 1/9] Fix Package.swift --- Package.swift | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/Package.swift b/Package.swift index a4435dc..1bb8e6b 100644 --- a/Package.swift +++ b/Package.swift @@ -1,34 +1,14 @@ -// -// Package.swift -// FSPagerView -// -// Created by Wenchao Ding on 22/02/2017. -// Copyright © 2017 Wenchao Ding. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - - -// swift-tools-version:5.0 +// swift-tools-version:5.1 import PackageDescription let package = Package( name: "FSPagerView", - dependencies : [], - exclude: [] + platforms: [.iOS(.v8)], + products: [ + .library(name: "FSPagerView", targets: ["FSPagerView"]), + ], + targets: [ + .target(name: "FSPagerView", path: "Sources", exclude: ["FSPagerViewObjcCompat.h", "FSPagerViewObjcCompat.m"]), + ], + swiftLanguageVersions: [.v5] ) From 6b4a11fa78e4db6c2c96e3a01a053df94236badd Mon Sep 17 00:00:00 2001 From: Dipansh Khandelwal Date: Tue, 16 Jun 2020 21:51:27 +0530 Subject: [PATCH 2/9] Transformer Type : Typos in REAMDE crossfading -> crossFading zoomout -> zoomOut --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc544d1..c3ff8ec 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ pagerView.interitemSpacing = 10 | ![1](https://cloud.githubusercontent.com/assets/5186464/22686429/1983b97e-ed5f-11e6-9a32-44c1830df7ac.gif) | ```swift -pagerView.transformer = FSPagerViewTransformer(type: .crossfading) +pagerView.transformer = FSPagerViewTransformer(type: .crossFading) ``` --- @@ -96,7 +96,7 @@ pagerView.transformer = FSPagerViewTransformer(type: .crossfading) | ![2](https://cloud.githubusercontent.com/assets/5186464/22686426/19830862-ed5f-11e6-90be-8fb1319cd125.gif) | ```swift -pagerView.transformer = FSPagerViewTransformer(type: .zoomout) +pagerView.transformer = FSPagerViewTransformer(type: .zoomOut) ``` --- From d25867705ff1569af81934fc42c31bbbdfda8b74 Mon Sep 17 00:00:00 2001 From: dirtmelon <0xffdirtmelon@gmail.com> Date: Wed, 4 Nov 2020 17:04:35 +0800 Subject: [PATCH 3/9] add objc bridges of minimumScale and minimumAlpha. --- Sources/FSPageViewTransformer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/FSPageViewTransformer.swift b/Sources/FSPageViewTransformer.swift index 2878679..7f46771 100644 --- a/Sources/FSPageViewTransformer.swift +++ b/Sources/FSPageViewTransformer.swift @@ -26,8 +26,8 @@ open class FSPagerViewTransformer: NSObject { open internal(set) weak var pagerView: FSPagerView? open internal(set) var type: FSPagerViewTransformerType - open var minimumScale: CGFloat = 0.65 - open var minimumAlpha: CGFloat = 0.6 + @objc open var minimumScale: CGFloat = 0.65 + @objc open var minimumAlpha: CGFloat = 0.6 @objc public init(type: FSPagerViewTransformerType) { From a67e26d75d58407742a9b05163777ecd88cb03e6 Mon Sep 17 00:00:00 2001 From: brennoumobi Date: Wed, 9 Dec 2020 15:19:56 -0300 Subject: [PATCH 4/9] Fix iOS minimum version --- .../xcode/package.xcworkspace/contents.xcworkspacedata | 7 +++++++ FSPagerView.podspec | 4 ++-- Package.swift | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/FSPagerView.podspec b/FSPagerView.podspec index cbf945f..a39b4e4 100644 --- a/FSPagerView.podspec +++ b/FSPagerView.podspec @@ -11,11 +11,11 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/WenchaoD/FSPagerView.git", :tag => s.version.to_s } s.platform = :ios - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' s.requires_arc = true s.framework = 'UIKit' s.source_files = 'Sources/*.{swift,h,m}' - s.swift_version = '5.0' + s.swift_version = '5.3' s.cocoapods_version = '>= 1.4.0' end diff --git a/Package.swift b/Package.swift index 1bb8e6b..df36449 100644 --- a/Package.swift +++ b/Package.swift @@ -1,9 +1,9 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.3 import PackageDescription let package = Package( name: "FSPagerView", - platforms: [.iOS(.v8)], + platforms: [.iOS(.v9)], products: [ .library(name: "FSPagerView", targets: ["FSPagerView"]), ], From 977ac1f5cf4bd89d167c972695b073d5ff371a57 Mon Sep 17 00:00:00 2001 From: brennoumobi Date: Wed, 9 Dec 2020 15:24:48 -0300 Subject: [PATCH 5/9] Removed swiftLanguageVersions --- Package.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index df36449..e1d480f 100644 --- a/Package.swift +++ b/Package.swift @@ -9,6 +9,5 @@ let package = Package( ], targets: [ .target(name: "FSPagerView", path: "Sources", exclude: ["FSPagerViewObjcCompat.h", "FSPagerViewObjcCompat.m"]), - ], - swiftLanguageVersions: [.v5] + ] ) From 0560602b2fcd2ae7cb65cf790cbd78fd52ab2f55 Mon Sep 17 00:00:00 2001 From: Sereivoan Yong Date: Fri, 28 May 2021 16:59:34 +0700 Subject: [PATCH 6/9] Increase swift-tools-version to 5.4 --- Package.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index e1d480f..5febfa1 100644 --- a/Package.swift +++ b/Package.swift @@ -1,9 +1,11 @@ -// swift-tools-version:5.3 +// swift-tools-version:5.4 import PackageDescription let package = Package( name: "FSPagerView", - platforms: [.iOS(.v9)], + platforms: [ + .iOS(.v9) + ], products: [ .library(name: "FSPagerView", targets: ["FSPagerView"]), ], From 68b82f91e1e35d678ad8a39a5b96c3db2fbdccbf Mon Sep 17 00:00:00 2001 From: thrillseek3r Date: Mon, 20 Dec 2021 19:11:52 +0300 Subject: [PATCH 7/9] fix scrollToItem forces crash in case of index out of range --- Sources/FSPagerView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FSPagerView.swift b/Sources/FSPagerView.swift index 7fb17d9..dd54eba 100644 --- a/Sources/FSPagerView.swift +++ b/Sources/FSPagerView.swift @@ -512,7 +512,7 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega @objc(scrollToItemAtIndex:animated:) open func scrollToItem(at index: Int, animated: Bool) { guard index < self.numberOfItems else { - fatalError("index \(index) is out of range [0...\(self.numberOfItems-1)]") + return } let indexPath = { () -> IndexPath in if let indexPath = self.possibleTargetingIndexPath, indexPath.item == index { From aa652bfe05866992aef81705e8c570948d20e586 Mon Sep 17 00:00:00 2001 From: thrillseek3r Date: Mon, 20 Dec 2021 20:22:19 +0300 Subject: [PATCH 8/9] code review --- FSPagerView.podspec | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FSPagerView.podspec b/FSPagerView.podspec index a39b4e4..cbf945f 100644 --- a/FSPagerView.podspec +++ b/FSPagerView.podspec @@ -11,11 +11,11 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/WenchaoD/FSPagerView.git", :tag => s.version.to_s } s.platform = :ios - s.ios.deployment_target = '9.0' + s.ios.deployment_target = '8.0' s.requires_arc = true s.framework = 'UIKit' s.source_files = 'Sources/*.{swift,h,m}' - s.swift_version = '5.3' + s.swift_version = '5.0' s.cocoapods_version = '>= 1.4.0' end diff --git a/Package.swift b/Package.swift index 5febfa1..089fee2 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.4 +// swift-tools-version:5.0 import PackageDescription let package = Package( From 15a64b5c3f6d67c0585143baf4bd77b7db280e2f Mon Sep 17 00:00:00 2001 From: thrillseek3r Date: Tue, 21 Dec 2021 15:46:01 +0300 Subject: [PATCH 9/9] code review --- Package.swift | 27 ++++++++++++++++++++++++++- Sources/FSPagerView.swift | 3 ++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 5febfa1..5d86919 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,29 @@ -// swift-tools-version:5.4 +// +// Package.swift +// FSPagerView +// +// Created by Wenchao Ding on 22/02/2017. +// Copyright © 2017 Wenchao Ding. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + import PackageDescription let package = Package( diff --git a/Sources/FSPagerView.swift b/Sources/FSPagerView.swift index 7fb17d9..554a7af 100644 --- a/Sources/FSPagerView.swift +++ b/Sources/FSPagerView.swift @@ -512,7 +512,8 @@ open class FSPagerView: UIView,UICollectionViewDataSource,UICollectionViewDelega @objc(scrollToItemAtIndex:animated:) open func scrollToItem(at index: Int, animated: Bool) { guard index < self.numberOfItems else { - fatalError("index \(index) is out of range [0...\(self.numberOfItems-1)]") + assertionFailure("index \(index) is out of range [0...\(self.numberOfItems-1)]") + return } let indexPath = { () -> IndexPath in if let indexPath = self.possibleTargetingIndexPath, indexPath.item == index {