Skip to content

Commit afa5b34

Browse files
ianyhwtmoose
authored andcommitted
Prevent usage of UIApplication.shared when building for extensions (SwiftKickMobile#191)
* Prevent usage of UIApplication.shared when building for extensions It's not accessible at compile-time for anything requiring app extension only APIs. * Add iMessageDemo target to Demo project * Bump version to 4.1.4
1 parent 761032e commit afa5b34

34 files changed

+2030
-458
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 4.1.4
5+
6+
### Bug Fixes
7+
* Fix #191 Prevent usage of UIApplication.shared when building for extensions
8+
9+
### Improvements
10+
* #192 Add a way to test compilation with app extension
11+
412
## 4.1.3
513

14+
### Features
15+
* #183 Added iOS app extension support at compile time.
16+
617
### Bug Fixes
718
* Fix #185 Incorrect margin adjustments in landscape
819
* Fix #188 Physics animation visual glitch

Demo/Demo.xcodeproj/project.pbxproj

+215-2
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0930"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
18+
BuildableName = "Demo.app"
19+
BlueprintName = "Demo"
20+
ReferencedContainer = "container:Demo.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
36+
BuildableName = "Demo.app"
37+
BlueprintName = "Demo"
38+
ReferencedContainer = "container:Demo.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
59+
BuildableName = "Demo.app"
60+
BlueprintName = "Demo"
61+
ReferencedContainer = "container:Demo.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
78+
BuildableName = "Demo.app"
79+
BlueprintName = "Demo"
80+
ReferencedContainer = "container:Demo.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0930"
4+
wasCreatedForAppExtension = "YES"
5+
version = "2.0">
6+
<BuildAction
7+
parallelizeBuildables = "YES"
8+
buildImplicitDependencies = "YES">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "22774C1220B8461900813732"
19+
BuildableName = "iMessageDemo.appex"
20+
BlueprintName = "iMessageDemo"
21+
ReferencedContainer = "container:Demo.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
<BuildActionEntry
25+
buildForTesting = "YES"
26+
buildForRunning = "YES"
27+
buildForProfiling = "YES"
28+
buildForArchiving = "YES"
29+
buildForAnalyzing = "YES">
30+
<BuildableReference
31+
BuildableIdentifier = "primary"
32+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
33+
BuildableName = "Demo.app"
34+
BlueprintName = "Demo"
35+
ReferencedContainer = "container:Demo.xcodeproj">
36+
</BuildableReference>
37+
</BuildActionEntry>
38+
</BuildActionEntries>
39+
</BuildAction>
40+
<TestAction
41+
buildConfiguration = "Debug"
42+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
43+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
44+
shouldUseLaunchSchemeArgsEnv = "YES">
45+
<Testables>
46+
</Testables>
47+
<MacroExpansion>
48+
<BuildableReference
49+
BuildableIdentifier = "primary"
50+
BlueprintIdentifier = "22774C1220B8461900813732"
51+
BuildableName = "iMessageDemo.appex"
52+
BlueprintName = "iMessageDemo"
53+
ReferencedContainer = "container:Demo.xcodeproj">
54+
</BuildableReference>
55+
</MacroExpansion>
56+
<AdditionalOptions>
57+
</AdditionalOptions>
58+
</TestAction>
59+
<LaunchAction
60+
buildConfiguration = "Debug"
61+
selectedDebuggerIdentifier = ""
62+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
63+
launchStyle = "0"
64+
useCustomWorkingDirectory = "NO"
65+
ignoresPersistentStateOnLaunch = "NO"
66+
debugDocumentVersioning = "YES"
67+
debugServiceExtension = "internal"
68+
allowLocationSimulation = "YES"
69+
launchAutomaticallySubstyle = "2">
70+
<BuildableProductRunnable
71+
runnableDebuggingMode = "0">
72+
<BuildableReference
73+
BuildableIdentifier = "primary"
74+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
75+
BuildableName = "Demo.app"
76+
BlueprintName = "Demo"
77+
ReferencedContainer = "container:Demo.xcodeproj">
78+
</BuildableReference>
79+
</BuildableProductRunnable>
80+
<AdditionalOptions>
81+
</AdditionalOptions>
82+
</LaunchAction>
83+
<ProfileAction
84+
buildConfiguration = "Release"
85+
shouldUseLaunchSchemeArgsEnv = "YES"
86+
savedToolIdentifier = ""
87+
useCustomWorkingDirectory = "NO"
88+
debugDocumentVersioning = "YES"
89+
launchAutomaticallySubstyle = "2">
90+
<BuildableProductRunnable
91+
runnableDebuggingMode = "0">
92+
<BuildableReference
93+
BuildableIdentifier = "primary"
94+
BlueprintIdentifier = "86AEDCE11D5D1DB70030232E"
95+
BuildableName = "Demo.app"
96+
BlueprintName = "Demo"
97+
ReferencedContainer = "container:Demo.xcodeproj">
98+
</BuildableReference>
99+
</BuildableProductRunnable>
100+
</ProfileAction>
101+
<AnalyzeAction
102+
buildConfiguration = "Debug">
103+
</AnalyzeAction>
104+
<ArchiveAction
105+
buildConfiguration = "Release"
106+
revealArchiveInOrganizer = "YES">
107+
</ArchiveAction>
108+
</Scheme>

Demo/Podfile

+7
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ target 'Demo' do
44
xcodeproj 'Demo.xcodeproj'
55
pod 'SwiftMessages', :path => '../'
66
end
7+
8+
target 'iMessageDemo' do
9+
use_frameworks!
10+
workspace 'Demo.xcworkspace'
11+
xcodeproj 'Demo.xcodeproj'
12+
pod 'SwiftMessages/AppExtension', :path => '../'
13+
end

Demo/Podfile.lock

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ PODS:
22
- SwiftMessages (4.1.3):
33
- SwiftMessages/App (= 4.1.3)
44
- SwiftMessages/App (4.1.3)
5+
- SwiftMessages/AppExtension (4.1.3)
56

67
DEPENDENCIES:
78
- SwiftMessages (from `../`)
9+
- SwiftMessages/AppExtension (from `../`)
810

911
EXTERNAL SOURCES:
1012
SwiftMessages:
@@ -13,6 +15,6 @@ EXTERNAL SOURCES:
1315
SPEC CHECKSUMS:
1416
SwiftMessages: dea7e8f42d8c166bc7ca6ded4e5bd45300f36bf0
1517

16-
PODFILE CHECKSUM: 6431c980c9207084d738b6ba87b2101dd9eb5097
18+
PODFILE CHECKSUM: 1146262ef9e9150bdfd257730666a46938cb783c
1719

1820
COCOAPODS: 1.5.2

Demo/Pods/Manifest.lock

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)