Skip to content

Commit 82672cc

Browse files
committed
Make swift build not throw errors
1 parent dc2962d commit 82672cc

12 files changed

+48
-2
lines changed

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ let package = Package(
99
products: [
1010
.library(
1111
name: "BetterSegmentedControl",
12-
targets: ["BetterSegmentedControl"])
12+
targets: ["BetterSegmentedControl"]
13+
)
1314
],
1415
targets: [
1516
.target(
1617
name: "BetterSegmentedControl",
17-
path: "Pod")
18+
path: "Pod/Classes"
19+
)
1820
],
1921
swiftLanguageVersions: [.v5]
2022
)

Pod/Classes/BetterSegmentedControl+IBDesignable.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 20.10.20.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
extension BetterSegmentedControl {
@@ -36,3 +38,5 @@ extension BetterSegmentedControl {
3638
}
3739
}
3840
}
41+
42+
#endif

Pod/Classes/BetterSegmentedControl+IndicatorView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 19.10.20.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
extension BetterSegmentedControl {
@@ -37,3 +39,5 @@ extension BetterSegmentedControl {
3739
}
3840
}
3941
}
42+
43+
#endif

Pod/Classes/BetterSegmentedControl+Options.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77
//
88

9+
#if canImport(UIKit)
10+
911
import UIKit
1012

1113
public extension BetterSegmentedControl {
@@ -30,3 +32,5 @@ public extension BetterSegmentedControl {
3032
case cornerRadius(CGFloat)
3133
}
3234
}
35+
36+
#endif

Pod/Classes/BetterSegmentedControl+PredefinedStyles.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 18.10.20.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
public extension BetterSegmentedControl {
@@ -21,3 +23,5 @@ public extension BetterSegmentedControl {
2123
return control
2224
}
2325
}
26+
27+
#endif

Pod/Classes/BetterSegmentedControl+UIPointerInteractionDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 19.10.20.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
@available(iOS 13.4, *)
@@ -32,3 +34,5 @@ extension BetterSegmentedControl: UIPointerInteractionDelegate {
3234
return .init(effect: .highlight(.init(view: view)))
3335
}
3436
}
37+
38+
#endif

Pod/Classes/BetterSegmentedControl.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Copyright © 2020 George Marmaridis. All rights reserved.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
@IBDesignable open class BetterSegmentedControl: UIControl {
@@ -499,3 +501,5 @@ extension BetterSegmentedControl: UIGestureRecognizerDelegate {
499501
return super.gestureRecognizerShouldBegin(gestureRecognizer)
500502
}
501503
}
504+
505+
#endif

Pod/Classes/Helpers/UIColor+Helpers.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 16.10.20.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
extension UIColor {
@@ -18,3 +20,5 @@ extension UIColor {
1820
.black
1921
}
2022
}
23+
24+
#endif

Pod/Classes/Helpers/UIView+Helpers.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
// Created by George Marmaridis on 19.10.20.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
extension UIView {
1113
var width: CGFloat { bounds.width }
1214
var height: CGFloat { bounds.height }
1315
}
16+
17+
#endif

Pod/Classes/Segments/BetterSegmentedControlSegment.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 08/10/2017.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
/// A segment is comprised of a normal state view and a selected state view. These need to be separate view instances.
@@ -18,3 +20,5 @@ public protocol BetterSegmentedControlSegment {
1820
/// The view to be shown for the active or selected state.
1921
var selectedView: UIView { get }
2022
}
23+
24+
#endif

Pod/Classes/Segments/IconSegment.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 10/02/2018.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
open class IconSegment: BetterSegmentedControlSegment {
@@ -93,3 +95,5 @@ public extension IconSegment {
9395
}
9496
}
9597
}
98+
99+
#endif

Pod/Classes/Segments/LabelSegment.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by George Marmaridis on 08/10/2017.
66
//
77

8+
#if canImport(UIKit)
9+
810
import UIKit
911

1012
open class LabelSegment: BetterSegmentedControlSegment {
@@ -111,3 +113,5 @@ public extension LabelSegment {
111113
}
112114
}
113115
}
116+
117+
#endif

0 commit comments

Comments
 (0)