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

Commit 76c9b47

Browse files
author
Amir Khorsandi
committed
Add compiler condition for SwiftU
1 parent b551bcb commit 76c9b47

10 files changed

Lines changed: 21 additions & 2 deletions

Lib/SwiftUI/PagePadding.swift

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

9+
#if canImport(SwiftUI)
910
import Foundation
1011
import UIKit
1112

@@ -29,3 +30,4 @@ public struct PagePadding {
2930
case fractionalWidth(CGFloat)
3031
}
3132
}
33+
#endif

Lib/SwiftUI/PagingCollectionViewCell.swift

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

9+
#if canImport(SwiftUI)
910
import UIKit
1011
import SwiftUI
1112

@@ -182,3 +183,4 @@ extension PagingCollectionViewCell: TransformableView,
182183
return snapshot.snapshotSize == targetView.bounds.size
183184
}
184185
}
186+
#endif

Lib/SwiftUI/PagingCollectionViewController.swift

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

9+
#if canImport(SwiftUI)
910
import UIKit
1011
import SwiftUI
1112

@@ -154,3 +155,4 @@ private extension UICollectionViewCell {
154155
String(describing: self)
155156
}
156157
}
158+
#endif

Lib/SwiftUI/PagingCollectionViewControllerBuilder.swift

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

9+
#if canImport(SwiftUI)
910
import SwiftUI
1011

1112
@available(iOS 13.0, *)
@@ -69,3 +70,4 @@ public class PagingCollectionViewControllerBuilder<ValueType: Identifiable, Page
6970
viewController.update(list: data, currentIndex: selectedIndex)
7071
}
7172
}
73+
#endif

Lib/SwiftUI/PagingCollectionViewModifierData.swift

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

9+
#if canImport(SwiftUI)
910
import Foundation
1011
import UIKit
1112

@@ -45,3 +46,4 @@ struct CollectionViewProperty<T>: CollectionViewPropertyProtocol {
4546
value as? T
4647
}
4748
}
49+
#endif

Lib/SwiftUI/ScalePageView.swift

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

9+
#if canImport(SwiftUI)
910
import Foundation
1011
import SwiftUI
1112

@@ -37,3 +38,4 @@ public extension ScalePageView {
3738
return self
3839
}
3940
}
41+
#endif

Lib/SwiftUI/SnapshotPageView.swift

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

9+
#if canImport(SwiftUI)
910
import Foundation
1011
import SwiftUI
1112

@@ -62,3 +63,4 @@ public extension SnapshotPageView {
6263
return self
6364
}
6465
}
66+
#endif

Lib/SwiftUI/StackPageView.swift

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

9+
#if canImport(SwiftUI)
910
import Foundation
1011
import SwiftUI
1112

@@ -37,3 +38,4 @@ public extension StackPageView {
3738
return self
3839
}
3940
}
41+
#endif

Lib/SwiftUI/TransformPageView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Amir on 28/03/2021.
66
// Copyright © 2021 Amir Khorsandi. All rights reserved.
77
//
8-
8+
#if canImport(SwiftUI)
99
import Foundation
1010
import SwiftUI
1111

@@ -27,3 +27,4 @@ public struct TransformPageView<ValueType: Identifiable, PageContent: View>: UIV
2727
builder = .init(data: data, pageViewBuilder: viewBuilder, selection: selection)
2828
}
2929
}
30+
#endif

Lib/SwiftUI/TransformPageViewProtocol.swift

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

9+
#if canImport(SwiftUI)
910
import Foundation
1011
import SwiftUI
1112

@@ -55,7 +56,7 @@ public extension TransformPageViewProtocol {
5556
}
5657

5758
func pagePadding(_ padding: PagePadding.Padding? = nil) -> Self {
58-
return pagePadding(vertical: padding, horizontal: padding)
59+
pagePadding(vertical: padding, horizontal: padding)
5960
}
6061

6162
func pagePadding(vertical: PagePadding.Padding? = nil,
@@ -103,3 +104,4 @@ public extension TransformPageViewProtocol where Self: UIViewControllerRepresent
103104
builder.update(viewController: uiViewController)
104105
}
105106
}
107+
#endif

0 commit comments

Comments
 (0)