Skip to content

Commit 8638804

Browse files
authored
Update test apps to support Mac Catalyst (#40)
1 parent b079a83 commit 8638804

19 files changed

+80
-8
lines changed

.spi.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 1
2+
builder:
3+
configs:
4+
- documentation_targets:
5+
- Drops

Drops.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Drops'
3-
s.version = '1.5.0'
3+
s.version = '1.6.0'
44
s.summary = 'A µFramework for showing iOS 13 like system alerts'
55
s.description = <<-DESC
66
A µFramework for showing alerts like the one used when copying from pasteboard or connecting Apple pencil.
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.module_name = 'Drops'
1414
s.source = { :git => 'https://github.com/omaralbeik/Drops.git', :tag => s.version }
1515
s.source_files = 'Sources/**/*.swift'
16-
s.swift_versions = ['5.1', '5.2', '5.3']
16+
s.swift_versions = ['5.5', '5.6', '5.7']
1717
s.requires_arc = true
1818
s.ios.deployment_target = '13.0'
1919
end

Drops.xcodeproj/project.pbxproj

+26-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@
128128
07D8147D26361DB7003F51DB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
129129
07D8148B26361DC6003F51DB /* Drop.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Drop.swift; sourceTree = "<group>"; };
130130
07D8149D26361DE8003F51DB /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ViewController.swift; path = ../UIKitExample/ViewController.swift; sourceTree = "<group>"; };
131+
07EB028828F08EA900ABC5B3 /* SwiftUIExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SwiftUIExample.entitlements; sourceTree = "<group>"; };
132+
07EB028928F08ECE00ABC5B3 /* UIKitExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = UIKitExample.entitlements; sourceTree = "<group>"; };
131133
/* End PBXFileReference section */
132134

133135
/* Begin PBXFrameworksBuildPhase section */
@@ -168,6 +170,7 @@
168170
074941EB2642CCD20031D338 /* UIKitExample */ = {
169171
isa = PBXGroup;
170172
children = (
173+
07EB028928F08ECE00ABC5B3 /* UIKitExample.entitlements */,
171174
074941FA2642CCD50031D338 /* Info.plist */,
172175
074941EC2642CCD20031D338 /* AppDelegate.swift */,
173176
074941EE2642CCD20031D338 /* SceneDelegate.swift */,
@@ -181,6 +184,7 @@
181184
074942092642D4140031D338 /* SwiftUIExample */ = {
182185
isa = PBXGroup;
183186
children = (
187+
07EB028828F08EA900ABC5B3 /* SwiftUIExample.entitlements */,
184188
074942132642D4160031D338 /* Info.plist */,
185189
0749420A2642D4140031D338 /* App.swift */,
186190
0749420C2642D4140031D338 /* ContentView.swift */,
@@ -553,6 +557,7 @@
553557
buildSettings = {
554558
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
555559
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
560+
CODE_SIGN_ENTITLEMENTS = UIKitExample/UIKitExample.entitlements;
556561
CODE_SIGN_STYLE = Automatic;
557562
CURRENT_PROJECT_VERSION = 1;
558563
DEVELOPMENT_TEAM = C3VKVFB3SA;
@@ -564,6 +569,9 @@
564569
);
565570
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.uikit-example";
566571
PRODUCT_NAME = "$(TARGET_NAME)";
572+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
573+
SUPPORTS_MACCATALYST = YES;
574+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
567575
SWIFT_VERSION = 5.0;
568576
TARGETED_DEVICE_FAMILY = "1,2";
569577
};
@@ -574,6 +582,7 @@
574582
buildSettings = {
575583
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
576584
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
585+
CODE_SIGN_ENTITLEMENTS = UIKitExample/UIKitExample.entitlements;
577586
CODE_SIGN_STYLE = Automatic;
578587
CURRENT_PROJECT_VERSION = 1;
579588
DEVELOPMENT_TEAM = C3VKVFB3SA;
@@ -585,6 +594,9 @@
585594
);
586595
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.uikit-example";
587596
PRODUCT_NAME = "$(TARGET_NAME)";
597+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
598+
SUPPORTS_MACCATALYST = YES;
599+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
588600
SWIFT_VERSION = 5.0;
589601
TARGETED_DEVICE_FAMILY = "1,2";
590602
};
@@ -595,6 +607,7 @@
595607
buildSettings = {
596608
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
597609
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
610+
CODE_SIGN_ENTITLEMENTS = SwiftUIExample/SwiftUIExample.entitlements;
598611
CODE_SIGN_STYLE = Automatic;
599612
CURRENT_PROJECT_VERSION = 1;
600613
DEVELOPMENT_TEAM = C3VKVFB3SA;
@@ -607,6 +620,9 @@
607620
);
608621
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.swiftui-example";
609622
PRODUCT_NAME = "$(TARGET_NAME)";
623+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
624+
SUPPORTS_MACCATALYST = YES;
625+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
610626
SWIFT_VERSION = 5.0;
611627
TARGETED_DEVICE_FAMILY = "1,2";
612628
};
@@ -617,6 +633,7 @@
617633
buildSettings = {
618634
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
619635
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
636+
CODE_SIGN_ENTITLEMENTS = SwiftUIExample/SwiftUIExample.entitlements;
620637
CODE_SIGN_STYLE = Automatic;
621638
CURRENT_PROJECT_VERSION = 1;
622639
DEVELOPMENT_TEAM = C3VKVFB3SA;
@@ -629,6 +646,9 @@
629646
);
630647
PRODUCT_BUNDLE_IDENTIFIER = "com.omaralbeik.drops.swiftui-example";
631648
PRODUCT_NAME = "$(TARGET_NAME)";
649+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
650+
SUPPORTS_MACCATALYST = YES;
651+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
632652
SWIFT_VERSION = 5.0;
633653
TARGETED_DEVICE_FAMILY = "1,2";
634654
};
@@ -778,7 +798,9 @@
778798
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
779799
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
780800
SKIP_INSTALL = YES;
781-
SUPPORTS_MACCATALYST = NO;
801+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
802+
SUPPORTS_MACCATALYST = YES;
803+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
782804
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
783805
SWIFT_VERSION = 5.0;
784806
TARGETED_DEVICE_FAMILY = "1,2";
@@ -807,7 +829,9 @@
807829
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
808830
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
809831
SKIP_INSTALL = YES;
810-
SUPPORTS_MACCATALYST = NO;
832+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
833+
SUPPORTS_MACCATALYST = YES;
834+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
811835
SWIFT_VERSION = 5.0;
812836
TARGETED_DEVICE_FAMILY = "1,2";
813837
};

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ DEPENDENCIES
1515
xcpretty-json-formatter
1616

1717
BUNDLED WITH
18-
2.1.4
18+
2.3.22

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ The [Swift Package Manager](https://swift.org/package-manager/) is a tool for ma
119119

120120
```swift
121121
dependencies: [
122-
.package(url: "https://github.com/omaralbeik/Drops.git", from: "1.5.0")
122+
.package(url: "https://github.com/omaralbeik/Drops.git", from: "1.6.0")
123123
]
124124
```
125125

@@ -134,15 +134,15 @@ $ swift build
134134
To integrate Drops into your Xcode project using [CocoaPods](https://cocoapods.org), specify it in your Podfile:
135135

136136
```rb
137-
pod 'Drops', :git => 'https://github.com/omaralbeik/Drops.git', :tag => '1.5.0'
137+
pod 'Drops', :git => 'https://github.com/omaralbeik/Drops.git', :tag => '1.6.0'
138138
```
139139

140140
### Carthage
141141

142142
To integrate Drops into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your Cartfile:
143143

144144
```
145-
github "omaralbeik/Drops" ~> 1.5.0
145+
github "omaralbeik/Drops" ~> 1.6.0
146146
```
147147

148148
### Manually

Sources/Drops.swift

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
23+
2324
#if os(iOS)
2425
import UIKit
2526

Sources/Weak.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
internal struct Weak<T: AnyObject> {
2526
init(value: T?) {
2627
self.value = value
2728
}
2829

2930
weak var value: T?
3031
}
32+
#endif
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.network.client</key>
8+
<true/>
9+
</dict>
10+
</plist>

Tests/AnimatorTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -209,3 +210,4 @@ final class AnimatorTests: XCTestCase {
209210
XCTAssertNil(endedState)
210211
}
211212
}
213+
#endif

Tests/DropTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -81,3 +82,4 @@ final class DropTests: XCTestCase {
8182
XCTAssertEqual(Drop.Duration.seconds(1).value, 1)
8283
}
8384
}
85+
#endif

Tests/DropViewTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -179,3 +180,4 @@ extension Drop: Equatable {
179180
return lhs.title == rhs.title
180181
}
181182
}
183+
#endif

Tests/DropsTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -239,3 +240,4 @@ private extension Task where Success == Never, Failure == Never {
239240
}
240241
}
241242
}
243+
#endif

Tests/PassthroughViewTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -33,3 +34,4 @@ final class PassthroughViewTests: XCTestCase {
3334
XCTAssertNil(result)
3435
}
3536
}
37+
#endif

Tests/PassthroughWindowTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -38,3 +39,4 @@ final class PassthroughWindowTests: XCTestCase {
3839
XCTAssertNil(result)
3940
}
4041
}
42+
#endif

Tests/PresenterTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -98,3 +99,4 @@ final class PresenterTests: XCTestCase {
9899
hide(animated: false)
99100
}
100101
}
102+
#endif

Tests/TestAnimatorDelegate.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
@testable import Drops
2526

2627
final class TestAnimatorDelegate: AnimatorDelegate {
@@ -40,3 +41,4 @@ final class TestAnimatorDelegate: AnimatorDelegate {
4041
didCallPanEnded = true
4142
}
4243
}
44+
#endif

Tests/WeakTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -37,3 +38,4 @@ final class WeakTests: XCTestCase {
3738

3839
private final class TestClass: NSObject {}
3940
}
41+
#endif

Tests/WindowViewControllerTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import XCTest
2526
@testable import Drops
2627

@@ -71,3 +72,4 @@ final class WindowViewControllerTests: XCTestCase {
7172
XCTAssertEqual(controller.top, controller)
7273
}
7374
}
75+
#endif
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.network.client</key>
8+
<true/>
9+
</dict>
10+
</plist>

0 commit comments

Comments
 (0)