Skip to content

Commit 35aa78c

Browse files
Merge pull request #78 from apivideo/feature/improve_swift_samples
Feature/improve swift samples
2 parents b44d3bd + 4c3359e commit 35aa78c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+643
-356
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ on: [push]
55
jobs:
66
build-swift:
77
name: Build with swift
8-
runs-on: macos-12
8+
runs-on: macos-latest
99

1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
- name: xcode version
1414
uses: maxim-lobanov/setup-xcode@v1
1515
with:
16-
xcode-version: '13.4.1'
16+
xcode-version: latest-stable
1717
- name: Build Package with swift
1818
run: swift build
1919

2020
build-xcodebuild:
2121
name: Build with xcodebuild
22-
runs-on: macos-12
22+
runs-on: macos-latest
2323

2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727
- name: xcode version
2828
uses: maxim-lobanov/setup-xcode@v1
2929
with:
30-
xcode-version: '13.4.1'
30+
xcode-version: latest-stable
3131
- name: Set Default Scheme
3232
run: |
3333
scheme_list=$(xcodebuild -list -json | tr -d "\n")
@@ -50,14 +50,14 @@ jobs:
5050
cocoapods:
5151
name: Verify cocopods podspec
5252
needs: [ build-xcodebuild ]
53-
runs-on: macos-12
53+
runs-on: macos-latest
5454

5555
steps:
5656
- name: Checkout
57-
uses: actions/checkout@v2
57+
uses: actions/checkout@v3
5858
- name: xcode version
5959
uses: maxim-lobanov/setup-xcode@v1
6060
with:
61-
xcode-version: '13.4.1'
61+
xcode-version: latest-stable
6262
- name: Verify cocoapods
6363
run: pod lib lint --allow-warnings

.github/workflows/create-release-from-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
update-documentation:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
- name: Create draft release if needed
1414
uses: apivideo/api.video-release-from-changelog-action@main
1515
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
deploy:
77
runs-on: macos-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010

1111
- name: Install Cocoapods
1212
run: gem install cocoapods

Example/Example.xcodeproj/project.pbxproj

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,44 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
212CE7122B03CABA001F70DD /* InAppSettingsKit in Frameworks */ = {isa = PBXBuildFile; productRef = 212CE7112B03CABA001F70DD /* InAppSettingsKit */; };
11+
212CE7502B03CB21001F70DD /* Contents.json in Resources */ = {isa = PBXBuildFile; fileRef = 212CE7392B03CB20001F70DD /* Contents.json */; };
12+
212CE76A2B03CB5B001F70DD /* AsyncApiUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7662B03CB5A001F70DD /* AsyncApiUtils.swift */; };
13+
212CE76B2B03CB5B001F70DD /* AlertUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7672B03CB5A001F70DD /* AlertUtils.swift */; };
14+
212CE76C2B03CB5B001F70DD /* SettingsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7682B03CB5A001F70DD /* SettingsManager.swift */; };
15+
212CE76D2B03CB5B001F70DD /* UIColorExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7692B03CB5A001F70DD /* UIColorExtensions.swift */; };
16+
212CE7732B03CB6F001F70DD /* ClientAppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE76F2B03CB6E001F70DD /* ClientAppError.swift */; };
17+
212CE7742B03CB6F001F70DD /* TaskManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7702B03CB6E001F70DD /* TaskManager.swift */; };
18+
212CE7752B03CB6F001F70DD /* CancellableApiTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7712B03CB6E001F70DD /* CancellableApiTask.swift */; };
19+
212CE7762B03CB6F001F70DD /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 212CE7722B03CB6E001F70DD /* Settings.bundle */; };
20+
212CE7782B03CBCA001F70DD /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212CE7772B03CBCA001F70DD /* MainViewController.swift */; };
1021
2136DD4A274B9E74007B9FC9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2136DD49274B9E74007B9FC9 /* AppDelegate.swift */; };
1122
2136DD4C274B9E74007B9FC9 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2136DD4B274B9E74007B9FC9 /* SceneDelegate.swift */; };
12-
2136DD4E274B9E74007B9FC9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2136DD4D274B9E74007B9FC9 /* ViewController.swift */; };
1323
2136DD51274B9E74007B9FC9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2136DD4F274B9E74007B9FC9 /* Main.storyboard */; };
1424
2136DD53274B9E77007B9FC9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2136DD52274B9E77007B9FC9 /* Assets.xcassets */; };
1525
2136DD56274B9E77007B9FC9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2136DD54274B9E77007B9FC9 /* LaunchScreen.storyboard */; };
1626
21A2E574275E5D4A00ED880F /* ApiVideoUploader in Frameworks */ = {isa = PBXBuildFile; productRef = 21A2E573275E5D4A00ED880F /* ApiVideoUploader */; };
17-
C70E513C27A9719900B31115 /* UploaderManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C70E513B27A9719900B31115 /* UploaderManager.swift */; };
1827
/* End PBXBuildFile section */
1928

2029
/* Begin PBXFileReference section */
30+
212CE7392B03CB20001F70DD /* Contents.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = Contents.json; path = Assets.xcassets/Contents.json; sourceTree = "<group>"; };
31+
212CE7662B03CB5A001F70DD /* AsyncApiUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsyncApiUtils.swift; sourceTree = "<group>"; };
32+
212CE7672B03CB5A001F70DD /* AlertUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertUtils.swift; sourceTree = "<group>"; };
33+
212CE7682B03CB5A001F70DD /* SettingsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsManager.swift; sourceTree = "<group>"; };
34+
212CE7692B03CB5A001F70DD /* UIColorExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIColorExtensions.swift; sourceTree = "<group>"; };
35+
212CE76F2B03CB6E001F70DD /* ClientAppError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClientAppError.swift; sourceTree = "<group>"; };
36+
212CE7702B03CB6E001F70DD /* TaskManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskManager.swift; sourceTree = "<group>"; };
37+
212CE7712B03CB6E001F70DD /* CancellableApiTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CancellableApiTask.swift; sourceTree = "<group>"; };
38+
212CE7722B03CB6E001F70DD /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
39+
212CE7772B03CBCA001F70DD /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
2140
2136DD46274B9E74007B9FC9 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
2241
2136DD49274B9E74007B9FC9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2342
2136DD4B274B9E74007B9FC9 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
24-
2136DD4D274B9E74007B9FC9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
2543
2136DD50274B9E74007B9FC9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2644
2136DD52274B9E77007B9FC9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2745
2136DD55274B9E77007B9FC9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2846
2136DD57274B9E77007B9FC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2947
21A2E572275E5D3300ED880F /* swift5-uploader */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "swift5-uploader"; path = ..; sourceTree = "<group>"; };
30-
C70E513B27A9719900B31115 /* UploaderManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploaderManager.swift; sourceTree = "<group>"; };
3148
/* End PBXFileReference section */
3249

3350
/* Begin PBXFrameworksBuildPhase section */
@@ -36,12 +53,34 @@
3653
buildActionMask = 2147483647;
3754
files = (
3855
21A2E574275E5D4A00ED880F /* ApiVideoUploader in Frameworks */,
56+
212CE7122B03CABA001F70DD /* InAppSettingsKit in Frameworks */,
3957
);
4058
runOnlyForDeploymentPostprocessing = 0;
4159
};
4260
/* End PBXFrameworksBuildPhase section */
4361

4462
/* Begin PBXGroup section */
63+
212CE7652B03CB5A001F70DD /* Utils */ = {
64+
isa = PBXGroup;
65+
children = (
66+
212CE7662B03CB5A001F70DD /* AsyncApiUtils.swift */,
67+
212CE7672B03CB5A001F70DD /* AlertUtils.swift */,
68+
212CE7682B03CB5A001F70DD /* SettingsManager.swift */,
69+
212CE7692B03CB5A001F70DD /* UIColorExtensions.swift */,
70+
);
71+
path = Utils;
72+
sourceTree = "<group>";
73+
};
74+
212CE76E2B03CB6E001F70DD /* Models */ = {
75+
isa = PBXGroup;
76+
children = (
77+
212CE76F2B03CB6E001F70DD /* ClientAppError.swift */,
78+
212CE7702B03CB6E001F70DD /* TaskManager.swift */,
79+
212CE7712B03CB6E001F70DD /* CancellableApiTask.swift */,
80+
);
81+
path = Models;
82+
sourceTree = "<group>";
83+
};
4584
2136DD3D274B9E74007B9FC9 = {
4685
isa = PBXGroup;
4786
children = (
@@ -63,14 +102,17 @@
63102
2136DD48274B9E74007B9FC9 /* Example */ = {
64103
isa = PBXGroup;
65104
children = (
105+
212CE7772B03CBCA001F70DD /* MainViewController.swift */,
106+
212CE76E2B03CB6E001F70DD /* Models */,
107+
212CE7722B03CB6E001F70DD /* Settings.bundle */,
108+
212CE7652B03CB5A001F70DD /* Utils */,
109+
212CE7392B03CB20001F70DD /* Contents.json */,
66110
2136DD49274B9E74007B9FC9 /* AppDelegate.swift */,
67111
2136DD4B274B9E74007B9FC9 /* SceneDelegate.swift */,
68-
2136DD4D274B9E74007B9FC9 /* ViewController.swift */,
69112
2136DD4F274B9E74007B9FC9 /* Main.storyboard */,
70113
2136DD52274B9E77007B9FC9 /* Assets.xcassets */,
71114
2136DD54274B9E77007B9FC9 /* LaunchScreen.storyboard */,
72115
2136DD57274B9E77007B9FC9 /* Info.plist */,
73-
C70E513B27A9719900B31115 /* UploaderManager.swift */,
74116
);
75117
path = Example;
76118
sourceTree = "<group>";
@@ -108,6 +150,7 @@
108150
name = Example;
109151
packageProductDependencies = (
110152
21A2E573275E5D4A00ED880F /* ApiVideoUploader */,
153+
212CE7112B03CABA001F70DD /* InAppSettingsKit */,
111154
);
112155
productName = Example;
113156
productReference = 2136DD46274B9E74007B9FC9 /* Example.app */;
@@ -137,6 +180,9 @@
137180
Base,
138181
);
139182
mainGroup = 2136DD3D274B9E74007B9FC9;
183+
packageReferences = (
184+
212CE7102B03CABA001F70DD /* XCRemoteSwiftPackageReference "InAppSettingsKit" */,
185+
);
140186
productRefGroup = 2136DD47274B9E74007B9FC9 /* Products */;
141187
projectDirPath = "";
142188
projectRoot = "";
@@ -153,7 +199,9 @@
153199
files = (
154200
2136DD56274B9E77007B9FC9 /* LaunchScreen.storyboard in Resources */,
155201
2136DD53274B9E77007B9FC9 /* Assets.xcassets in Resources */,
202+
212CE7762B03CB6F001F70DD /* Settings.bundle in Resources */,
156203
2136DD51274B9E74007B9FC9 /* Main.storyboard in Resources */,
204+
212CE7502B03CB21001F70DD /* Contents.json in Resources */,
157205
);
158206
runOnlyForDeploymentPostprocessing = 0;
159207
};
@@ -164,10 +212,16 @@
164212
isa = PBXSourcesBuildPhase;
165213
buildActionMask = 2147483647;
166214
files = (
167-
2136DD4E274B9E74007B9FC9 /* ViewController.swift in Sources */,
215+
212CE76B2B03CB5B001F70DD /* AlertUtils.swift in Sources */,
216+
212CE76C2B03CB5B001F70DD /* SettingsManager.swift in Sources */,
217+
212CE7742B03CB6F001F70DD /* TaskManager.swift in Sources */,
168218
2136DD4A274B9E74007B9FC9 /* AppDelegate.swift in Sources */,
219+
212CE76D2B03CB5B001F70DD /* UIColorExtensions.swift in Sources */,
220+
212CE76A2B03CB5B001F70DD /* AsyncApiUtils.swift in Sources */,
221+
212CE7732B03CB6F001F70DD /* ClientAppError.swift in Sources */,
222+
212CE7752B03CB6F001F70DD /* CancellableApiTask.swift in Sources */,
169223
2136DD4C274B9E74007B9FC9 /* SceneDelegate.swift in Sources */,
170-
C70E513C27A9719900B31115 /* UploaderManager.swift in Sources */,
224+
212CE7782B03CBCA001F70DD /* MainViewController.swift in Sources */,
171225
);
172226
runOnlyForDeploymentPostprocessing = 0;
173227
};
@@ -316,7 +370,7 @@
316370
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
317371
CODE_SIGN_STYLE = Automatic;
318372
CURRENT_PROJECT_VERSION = 1;
319-
DEVELOPMENT_TEAM = VY3VXRC7P4;
373+
DEVELOPMENT_TEAM = GBC36KP98K;
320374
GENERATE_INFOPLIST_FILE = YES;
321375
INFOPLIST_FILE = Example/Info.plist;
322376
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -344,7 +398,7 @@
344398
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
345399
CODE_SIGN_STYLE = Automatic;
346400
CURRENT_PROJECT_VERSION = 1;
347-
DEVELOPMENT_TEAM = VY3VXRC7P4;
401+
DEVELOPMENT_TEAM = GBC36KP98K;
348402
GENERATE_INFOPLIST_FILE = YES;
349403
INFOPLIST_FILE = Example/Info.plist;
350404
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -388,7 +442,23 @@
388442
};
389443
/* End XCConfigurationList section */
390444

445+
/* Begin XCRemoteSwiftPackageReference section */
446+
212CE7102B03CABA001F70DD /* XCRemoteSwiftPackageReference "InAppSettingsKit" */ = {
447+
isa = XCRemoteSwiftPackageReference;
448+
repositoryURL = "https://github.com/futuretap/InAppSettingsKit.git";
449+
requirement = {
450+
kind = upToNextMajorVersion;
451+
minimumVersion = 3.4.2;
452+
};
453+
};
454+
/* End XCRemoteSwiftPackageReference section */
455+
391456
/* Begin XCSwiftPackageProductDependency section */
457+
212CE7112B03CABA001F70DD /* InAppSettingsKit */ = {
458+
isa = XCSwiftPackageProductDependency;
459+
package = 212CE7102B03CABA001F70DD /* XCRemoteSwiftPackageReference "InAppSettingsKit" */;
460+
productName = InAppSettingsKit;
461+
};
392462
21A2E573275E5D4A00ED880F /* ApiVideoUploader */ = {
393463
isa = XCSwiftPackageProductDependency;
394464
productName = ApiVideoUploader;

Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 29 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Example/AppDelegate.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,22 @@ import UIKit
77

88
@main
99
class AppDelegate: UIResponder, UIApplicationDelegate {
10-
11-
12-
13-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
10+
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1411
// Override point for customization after application launch.
1512
return true
1613
}
1714

1815
// MARK: UISceneSession Lifecycle
1916

20-
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
17+
func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration {
2118
// Called when a new scene session is being created.
2219
// Use this method to select a configuration to create the new scene with.
2320
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
2421
}
2522

26-
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
23+
func application(_: UIApplication, didDiscardSceneSessions _: Set<UISceneSession>) {
2724
// Called when the user discards a scene session.
2825
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
2926
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
3027
}
31-
32-
3328
}
34-
173 KB
Loading
7.31 KB
Loading
7.31 KB
Loading
10.1 KB
Loading

0 commit comments

Comments
 (0)