Skip to content

Commit

Permalink
SwiftUI project low version adaptation, API adaptation to iOS14
Browse files Browse the repository at this point in the history
  • Loading branch information
qinhui committed Oct 18, 2024
1 parent c8fa0ce commit 1d1cdb6
Show file tree
Hide file tree
Showing 29 changed files with 386 additions and 131 deletions.
36 changes: 24 additions & 12 deletions iOS/APIExample-OC/APIExample-OC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1571,9 +1571,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "APIExample-OC/Info.plist";
Expand All @@ -1594,6 +1596,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-oc";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand All @@ -1613,9 +1616,11 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "APIExample-OC/Info.plist";
Expand All @@ -1636,6 +1641,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-oc";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand All @@ -1651,9 +1657,11 @@
baseConfigurationReference = B653B1910F3D2DB664FFCA69 /* Pods-Agora-ScreenShare-Extension-OC.debug.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Agora-ScreenShare-Extension-OC/Info.plist";
Expand All @@ -1669,6 +1677,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-oc.Agora-ScreenShare-Extension-OC";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1680,9 +1689,11 @@
baseConfigurationReference = C4F0E8C20AFE260912A60198 /* Pods-Agora-ScreenShare-Extension-OC.release.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Agora-ScreenShare-Extension-OC/Info.plist";
Expand All @@ -1698,6 +1709,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-oc.Agora-ScreenShare-Extension-OC";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1712,10 +1724,10 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -1759,10 +1771,10 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down
42 changes: 32 additions & 10 deletions iOS/APIExample-SwiftUI/APIExample-SwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
F73B016D2CBA1AE40077B7D2 /* KeyCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9306E12CB961150085EFF9 /* KeyCenter.swift */; };
F73B016E2CBA1AED0077B7D2 /* GlobalSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9306AF2CB961150085EFF9 /* GlobalSettings.swift */; };
F73B016F2CBA1AF40077B7D2 /* SampleHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9307F42CB963B30085EFF9 /* SampleHandler.swift */; };
F73B018D2CC10E240077B7D2 /* ViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73B018C2CC10E240077B7D2 /* ViewExtensions.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -308,6 +309,7 @@
D7DAC714DCF967FD618502DC /* Pods-APIExample-SwiftUI.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIExample-SwiftUI.debug.xcconfig"; path = "Target Support Files/Pods-APIExample-SwiftUI/Pods-APIExample-SwiftUI.debug.xcconfig"; sourceTree = "<group>"; };
E633FB65347D029555FE8BDB /* Pods_APIExample_SwiftUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIExample_SwiftUI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F73B016A2CBA1AC60077B7D2 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
F73B018C2CC10E240077B7D2 /* ViewExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtensions.swift; sourceTree = "<group>"; };
F89807E42BC51A25F44D3692 /* Pods-Agora-ScreenShare-Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Agora-ScreenShare-Extension.debug.xcconfig"; path = "Target Support Files/Pods-Agora-ScreenShare-Extension/Pods-Agora-ScreenShare-Extension.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -421,6 +423,7 @@
4C9306DD2CB961150085EFF9 /* View */,
4C9306DF2CB961150085EFF9 /* ARKit */,
4C9306E12CB961150085EFF9 /* KeyCenter.swift */,
F73B018C2CC10E240077B7D2 /* ViewExtensions.swift */,
);
path = Common;
sourceTree = "<group>";
Expand Down Expand Up @@ -1152,6 +1155,7 @@
4C9307C52CB961160085EFF9 /* APIExample_SwiftUIApp.swift in Sources */,
4C9309DB2CBA91530085EFF9 /* VoiceChangerRTC.swift in Sources */,
4C9309C72CBA91530085EFF9 /* SDKRenderExample.swift in Sources */,
F73B018D2CC10E240077B7D2 /* ViewExtensions.swift in Sources */,
4C9309AB2CBA91530085EFF9 /* RawAudioDataRTC.swift in Sources */,
4C9307752CB961150085EFF9 /* AgoraPcmSourcePush.swift in Sources */,
4C9307BD2CB961160085EFF9 /* JoinChannelVideoRecorder.swift in Sources */,
Expand Down Expand Up @@ -1348,10 +1352,12 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"APIExample-SwiftUI/Preview Content\"";
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1362,14 +1368,16 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-swiftUI";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "APIExample-SwiftUI/APIExample-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand All @@ -1384,10 +1392,12 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"APIExample-SwiftUI/Preview Content\"";
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1398,14 +1408,16 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-swiftUI";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "APIExample-SwiftUI/APIExample-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand All @@ -1417,14 +1429,17 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F89807E42BC51A25F44D3692 /* Pods-Agora-ScreenShare-Extension.debug.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Agora-ScreenShare-Extension/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Agora-ScreenShare-Extension";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1433,6 +1448,8 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-swiftUI.Agora-ScreenShare-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Agora-ScreenShare-Extension/Agora-ScreenShare-Extension-Bridging-Header.h";
Expand All @@ -1445,14 +1462,17 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2FF1D082DDF2E2198DB041E4 /* Pods-Agora-ScreenShare-Extension.release.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = YS397FG5PA;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = YS397FG5PA;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Agora-ScreenShare-Extension/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Agora-ScreenShare-Extension";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -1461,6 +1481,8 @@
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "io.agora.api.examples-swiftUI.Agora-ScreenShare-Extension";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = wildcard;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Agora-ScreenShare-Extension/Agora-ScreenShare-Extension-Bridging-Header.h";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ extension AgoraClientRole {
}
}

extension AgoraAudioProfile {
extension AgoraAudioProfile: Identifiable {
public var id: Int { self.rawValue }

func description() -> String {
switch self {
case .default: return "Default".localized
Expand All @@ -93,7 +95,7 @@ extension AgoraAudioProfile {
}
}

extension AgoraAudioScenario {
extension AgoraAudioScenario: Identifiable {
func description() -> String {
switch self {
case .default: return "Default".localized
Expand All @@ -103,12 +105,16 @@ extension AgoraAudioScenario {
}
}

public var id: Int { self.rawValue }

static func allValues() -> [AgoraAudioScenario] {
return [.default, .gameStreaming]
}
}

extension AgoraEncryptionMode {
extension AgoraEncryptionMode: Identifiable {
public var id: Int { self.rawValue }

func description() -> String {
switch self {
case .AES128GCM2: return "AES128GCM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ struct PickerView: View {
}
.padding(.horizontal, 5)
.padding(.vertical, 3)
.background(.blue)
.foregroundStyle(.white)
.adaptiveBackground(.blue)
.adaptiveForegroundStyle(.white)
#if os(iOS) && swift(>=5.7)
.clipShape(.rect(cornerRadius: 5))
#else
Expand All @@ -40,8 +40,8 @@ struct PickerView: View {
}
.padding(.horizontal, 5)
.padding(.vertical, 3)
.background(.blue)
.foregroundStyle(.white)
.adaptiveBackground(.blue)
.adaptiveForegroundStyle(.white)
#if os(iOS) && swift(>=5.7)
.clipShape(.rect(cornerRadius: 5))
#else
Expand All @@ -50,7 +50,7 @@ struct PickerView: View {
}
.padding(.horizontal, 20)
.padding(.bottom, 150)
}.background(ignoresSafeAreaEdges: .bottom)
}.adaptiveBackground(ignoresSafeAreaEdges: .bottom)
}
}

Expand Down
Loading

0 comments on commit 1d1cdb6

Please sign in to comment.