Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

Commit 4bdec32

Browse files
author
Amir Khorsandi
authored
Bump minimum to 13.0 (#70)
* Bump minimum iOS to 13 * remove min ios 10
1 parent b565d1e commit 4bdec32

20 files changed

+34
-87
lines changed

CollectionViewPagingLayout.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "CollectionViewPagingLayout"
3-
s.version = "1.0.3"
3+
s.version = "1.1.0"
44
s.summary = "A simple but highly customizable layout for UICollectionView and SwiftUI."
55

66
s.description = <<-DESC
@@ -14,9 +14,9 @@ Pod::Spec.new do |s|
1414
s.source = { :git => "https://github.com/amirdew/CollectionViewPagingLayout.git", :tag => "#{s.version}" }
1515
s.source_files = ["Lib/**/*.swift"]
1616

17-
s.swift_versions = ["5.4"]
17+
s.swift_versions = ["5.5"]
1818

19-
s.ios.deployment_target = "10.0"
19+
s.ios.deployment_target = "13.0"
2020

2121
s.frameworks = "UIKit"
2222
s.weak_frameworks = "SwiftUI", "Combine"

CollectionViewPagingLayout.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
291EC0DA2610B32500C65A34 /* SwiftUI */ = {
122122
isa = PBXGroup;
123123
children = (
124+
291EC0E22610B32500C65A34 /* SnapshotPageView.swift */,
124125
2967EBA126230A320035540A /* PagePadding.swift */,
125126
291EC0DB2610B32500C65A34 /* PagingCollectionViewControllerBuilder.swift */,
126127
291EC0DC2610B32500C65A34 /* StackPageView.swift */,
@@ -130,7 +131,6 @@
130131
291EC0DF2610B32500C65A34 /* PagingCollectionViewCell.swift */,
131132
291EC0E02610B32500C65A34 /* TransformPageView.swift */,
132133
291EC0E12610B32500C65A34 /* PagingCollectionViewController.swift */,
133-
291EC0E22610B32500C65A34 /* SnapshotPageView.swift */,
134134
);
135135
path = SwiftUI;
136136
sourceTree = "<group>";
@@ -294,7 +294,7 @@
294294
isa = PBXProject;
295295
attributes = {
296296
LastSwiftUpdateCheck = 1240;
297-
LastUpgradeCheck = 1220;
297+
LastUpgradeCheck = 1330;
298298
ORGANIZATIONNAME = Amir;
299299
TargetAttributes = {
300300
291FDEC2262327FD00AD1C14 = {
@@ -513,7 +513,7 @@
513513
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
514514
GCC_WARN_UNUSED_FUNCTION = YES;
515515
GCC_WARN_UNUSED_VARIABLE = YES;
516-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
516+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
517517
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
518518
MTL_FAST_MATH = YES;
519519
ONLY_ACTIVE_ARCH = YES;
@@ -571,7 +571,7 @@
571571
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
572572
GCC_WARN_UNUSED_FUNCTION = YES;
573573
GCC_WARN_UNUSED_VARIABLE = YES;
574-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
574+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
575575
MTL_ENABLE_DEBUG_INFO = NO;
576576
MTL_FAST_MATH = YES;
577577
SDKROOT = iphoneos;
@@ -594,13 +594,13 @@
594594
DYLIB_INSTALL_NAME_BASE = "@rpath";
595595
INFOPLIST_FILE = CollectionViewPagingLayout/Info.plist;
596596
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
597-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
597+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
598598
LD_RUNPATH_SEARCH_PATHS = (
599599
"$(inherited)",
600600
"@executable_path/Frameworks",
601601
"@loader_path/Frameworks",
602602
);
603-
MARKETING_VERSION = 1.0.2;
603+
MARKETING_VERSION = 1.1.0;
604604
PRODUCT_BUNDLE_IDENTIFIER = amir.app.CollectionViewPagingLayout;
605605
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
606606
SKIP_INSTALL = YES;
@@ -621,13 +621,13 @@
621621
DYLIB_INSTALL_NAME_BASE = "@rpath";
622622
INFOPLIST_FILE = CollectionViewPagingLayout/Info.plist;
623623
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
624-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
624+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
625625
LD_RUNPATH_SEARCH_PATHS = (
626626
"$(inherited)",
627627
"@executable_path/Frameworks",
628628
"@loader_path/Frameworks",
629629
);
630-
MARKETING_VERSION = 1.0.2;
630+
MARKETING_VERSION = 1.1.0;
631631
PRODUCT_BUNDLE_IDENTIFIER = amir.app.CollectionViewPagingLayout;
632632
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
633633
SKIP_INSTALL = YES;

CollectionViewPagingLayout.xcodeproj/xcshareddata/xcschemes/CollectionViewPagingLayout.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1220"
3+
LastUpgradeVersion = "1330"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

CollectionViewPagingLayout.xcodeproj/xcshareddata/xcschemes/CollectionViewPagingLayoutTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1240"
3+
LastUpgradeVersion = "1330"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Lib/BlurEffectView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import UIKit
1010

11-
@available(iOS 10.0, *)
1211
public class BlurEffectView: UIVisualEffectView {
1312

1413
// MARK: Parameters

Lib/Scale/ScaleTransformView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ public extension ScaleTransformView {
155155
}
156156
scalableView.layer.transform = transform
157157
}
158-
159-
@available(iOS 10.0, *)
158+
160159
private func applyBlurEffect(progress: CGFloat) {
161160
guard scaleOptions.blurEffectRadiusRatio > 0, scaleOptions.blurEffectEnabled else {
162161
scaleBlurViewHost.subviews.first(where: { $0 is BlurEffectView })?.removeFromSuperview()

Lib/Stack/StackTransformView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ public extension StackTransformView {
187187

188188
cardView.transform = cardView.transform.rotated(by: angle)
189189
}
190-
191-
@available(iOS 10.0, *)
190+
192191
private func applyBlurEffect(progress: CGFloat) {
193192
guard stackOptions.maxBlurEffectRadius > 0, stackOptions.blurEffectEnabled else {
194193
stackBlurViewHost.subviews.first(where: { $0 is BlurEffectView })?.removeFromSuperview()

Lib/SwiftUI/PagePadding.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
88

9-
#if canImport(SwiftUI) && canImport(Combine)
109
import Foundation
1110
import UIKit
1211

13-
@available(iOS 13.0, *)
1412
/// Provides paddings around the page
1513
public struct PagePadding {
1614

@@ -30,4 +28,3 @@ public struct PagePadding {
3028
case fractionalWidth(CGFloat)
3129
}
3230
}
33-
#endif

Lib/SwiftUI/PagingCollectionViewCell.swift

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1-
//
2-
// PagingCollectionViewCell.swift
3-
// CollectionViewPagingLayout
4-
//
5-
// Created by Amir on 20/03/2021.
6-
// Copyright © 2021 Amir Khorsandi. All rights reserved.
7-
//
8-
9-
#if canImport(SwiftUI) && canImport(Combine)
10-
import UIKit
111
import SwiftUI
2+
import UIKit
123

13-
@available(iOS 13.0, *)
144
class PagingCollectionViewCell<ValueType: Identifiable, Content: View>: UICollectionViewCell {
15-
165
typealias Parent = PagingCollectionViewController<ValueType, Content>
176

187
// MARK: Properties
@@ -29,7 +18,7 @@ class PagingCollectionViewCell<ValueType: Identifiable, Content: View>: UICollec
2918

3019
func update(value: ValueType, index: IndexPath, parent: Parent) {
3120
self.parent = parent
32-
self.viewBuilder = parent.pageViewBuilder
21+
viewBuilder = parent.pageViewBuilder
3322
self.value = value
3423
self.index = index
3524
if hostingController != nil {
@@ -53,7 +42,6 @@ class PagingCollectionViewCell<ValueType: Identifiable, Content: View>: UICollec
5342
}
5443
}
5544

56-
5745
// MARK: Private functions
5846

5947
@discardableResult private func updateView(progress: CGFloat? = nil) -> Content? {
@@ -77,7 +65,8 @@ class PagingCollectionViewCell<ValueType: Identifiable, Content: View>: UICollec
7765
func constraint<T>(_ first: NSLayoutAnchor<T>,
7866
_ second: NSLayoutAnchor<T>,
7967
_ paddingKeyPath: KeyPath<PagePadding, PagePadding.Padding?>,
80-
_ inside: Bool) {
68+
_ inside: Bool)
69+
{
8170
let padding = parent.modifierData?.pagePadding?[keyPath: paddingKeyPath] ?? .absolute(0)
8271
let constant: CGFloat
8372
switch padding {
@@ -90,7 +79,8 @@ class PagingCollectionViewCell<ValueType: Identifiable, Content: View>: UICollec
9079
}
9180
let identifier = "pagePaddingConstraint_\(inside)_\(T.self)"
9281
if let constraint = contentView.constraints.first(where: { $0.identifier == identifier }) ??
93-
viewController.view.constraints.first(where: { $0.identifier == identifier }) {
82+
viewController.view.constraints.first(where: { $0.identifier == identifier })
83+
{
9484
constraint.constant = constant * (inside ? 1 : -1)
9585
} else {
9686
let constraint = first.constraint(equalTo: second, constant: constant * (inside ? 1 : -1))
@@ -106,13 +96,11 @@ class PagingCollectionViewCell<ValueType: Identifiable, Content: View>: UICollec
10696
}
10797
}
10898

109-
110-
@available(iOS 13.0, *)
11199
extension PagingCollectionViewCell: TransformableView,
112-
ScaleTransformView,
113-
StackTransformView,
114-
SnapshotTransformView {
115-
100+
ScaleTransformView,
101+
StackTransformView,
102+
SnapshotTransformView
103+
{
116104
var scalableView: UIView {
117105
hostingController?.view ?? contentView
118106
}
@@ -132,9 +120,11 @@ extension PagingCollectionViewCell: TransformableView,
132120
var scaleOptions: ScaleTransformViewOptions {
133121
parent?.modifierData?.scaleOptions ?? .init()
134122
}
123+
135124
var stackOptions: StackTransformViewOptions {
136125
parent?.modifierData?.stackOptions ?? .init()
137126
}
127+
138128
var snapshotOptions: SnapshotTransformViewOptions {
139129
parent?.modifierData?.snapshotOptions ?? .init()
140130
}
@@ -183,4 +173,3 @@ extension PagingCollectionViewCell: TransformableView,
183173
return snapshot.snapshotSize == targetView.bounds.size
184174
}
185175
}
186-
#endif

Lib/SwiftUI/PagingCollectionViewController.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
88

9-
#if canImport(SwiftUI) && canImport(Combine)
109
import UIKit
1110
import SwiftUI
1211

13-
@available(iOS 13.0, *)
1412
public class PagingCollectionViewController<ValueType: Identifiable, PageContent: View>: UIViewController,
1513
UICollectionViewDataSource,
1614
CollectionViewPagingLayoutDelegate,
@@ -153,14 +151,12 @@ private protocol PagingCollectionViewControllerEquatableList {
153151
func isListSame<T>(as list: [T]) -> Bool
154152
}
155153

156-
@available(iOS 13.0, *)
157154
extension PagingCollectionViewController: PagingCollectionViewControllerEquatableList where ValueType: Equatable {
158155
func isListSame<T>(as list: [T]) -> Bool {
159156
self.list == (list as? [ValueType])
160157
}
161158
}
162159

163-
@available(iOS 13.0, *)
164160
private extension UICollectionView {
165161
func registerClass<T: UICollectionViewCell>(_ cellType: T.Type, reuseIdentifier: String = T.reuseIdentifier) {
166162
register(cellType, forCellWithReuseIdentifier: reuseIdentifier)
@@ -172,10 +168,8 @@ private extension UICollectionView {
172168
}
173169

174170

175-
@available(iOS 13.0, *)
176171
private extension UICollectionViewCell {
177172
static var reuseIdentifier: String {
178173
String(describing: self)
179174
}
180175
}
181-
#endif

Lib/SwiftUI/PagingCollectionViewControllerBuilder.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
88

9-
#if canImport(SwiftUI) && canImport(Combine)
109
import SwiftUI
1110

12-
@available(iOS 13.0, *)
1311
public class PagingCollectionViewControllerBuilder<ValueType: Identifiable, PageContent: View> {
1412

1513
public typealias ViewController = PagingCollectionViewController<ValueType, PageContent>
@@ -78,4 +76,3 @@ public class PagingCollectionViewControllerBuilder<ValueType: Identifiable, Page
7876
}
7977
}
8078
}
81-
#endif

Lib/SwiftUI/PagingCollectionViewModifierData.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
88

9-
#if canImport(SwiftUI) && canImport(Combine)
109
import Foundation
1110
import UIKit
1211

13-
@available(iOS 13.0, *)
1412
struct PagingCollectionViewModifierData {
1513
var scaleOptions: ScaleTransformViewOptions?
1614
var stackOptions: StackTransformViewOptions?
@@ -28,13 +26,11 @@ struct PagingCollectionViewModifierData {
2826
var transparentAttributeWhenCellNotLoaded: Bool?
2927
}
3028

31-
@available(iOS 13.0, *)
3229
protocol CollectionViewPropertyProtocol {
3330
func getKey<T>() -> WritableKeyPath<UICollectionView, T>?
3431
func getValue<T>() -> T?
3532
}
3633

37-
@available(iOS 13.0, *)
3834
struct CollectionViewProperty<T>: CollectionViewPropertyProtocol {
3935
let keyPath: WritableKeyPath<UICollectionView, T>
4036
let value: T
@@ -47,4 +43,3 @@ struct CollectionViewProperty<T>: CollectionViewPropertyProtocol {
4743
value as? T
4844
}
4945
}
50-
#endif

Lib/SwiftUI/ScalePageView.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
88

9-
#if canImport(SwiftUI) && canImport(Combine)
109
import Foundation
1110
import SwiftUI
1211

13-
@available(iOS 13.0, *)
1412
public struct ScalePageView<ValueType: Identifiable, PageContent: View>: UIViewControllerRepresentable, TransformPageViewProtocol {
1513

1614
// MARK: Properties
@@ -31,11 +29,9 @@ public struct ScalePageView<ValueType: Identifiable, PageContent: View>: UIViewC
3129
}
3230

3331

34-
@available(iOS 13.0, *)
3532
public extension ScalePageView {
3633
func options(_ options: ScaleTransformViewOptions) -> Self {
3734
builder.modifierData.scaleOptions = options
3835
return self
3936
}
4037
}
41-
#endif

Lib/SwiftUI/SnapshotPageView.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
88

9-
#if canImport(SwiftUI) && canImport(Combine)
109
import Foundation
1110
import SwiftUI
1211

13-
@available(iOS 13.0, *)
1412
public struct SnapshotPageView<ValueType: Identifiable, PageContent: View>: UIViewControllerRepresentable, TransformPageViewProtocol {
1513

1614
// MARK: Properties
@@ -31,15 +29,13 @@ public struct SnapshotPageView<ValueType: Identifiable, PageContent: View>: UIVi
3129
}
3230

3331

34-
@available(iOS 13.0, *)
3532
public extension SnapshotPageView {
3633
func options(_ options: SnapshotTransformViewOptions) -> Self {
3734
builder.modifierData.snapshotOptions = options
3835
return self
3936
}
4037
}
4138

42-
@available(iOS 13.0, *)
4339
public extension SnapshotPageView {
4440
/// A unique identifier for the snapshot, a new snapshot won't be made if
4541
/// there is a cashed snapshot with the same identifier
@@ -52,7 +48,6 @@ public extension SnapshotPageView {
5248
}
5349
}
5450

55-
@available(iOS 13.0, *)
5651
public extension SnapshotPageView {
5752
/// Check if the snapshot can be reused
5853
/// - Parameter snapshotContainer: The container for snapshot pieces, see `SnapshotContainerView`
@@ -63,4 +58,3 @@ public extension SnapshotPageView {
6358
return self
6459
}
6560
}
66-
#endif

0 commit comments

Comments
 (0)