Skip to content

Commit

Permalink
Merge pull request #828 from Esri/v.next
Browse files Browse the repository at this point in the history
Merge `v.next` into `main`
  • Loading branch information
dfeinzimer authored Aug 1, 2024
2 parents 79f67ba + 98fec29 commit 27259c3
Show file tree
Hide file tree
Showing 305 changed files with 11,801 additions and 2,862 deletions.
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ opt_in_rules:
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- sorted_imports
- static_operator
- toggle_bool
- trailing_closure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
88AD13712834355000500B2E /* Sources */,
88AD13722834355000500B2E /* Frameworks */,
88AD13732834355000500B2E /* Resources */,
8AA526702BCF1887007D28B1 /* Lint Sources */,
);
buildRules = (
);
Expand All @@ -132,7 +133,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1320;
LastUpgradeCheck = 1320;
LastUpgradeCheck = 1530;
TargetAttributes = {
88AD13742834355000500B2E = {
CreatedOnToolsVersion = 13.2.1;
Expand Down Expand Up @@ -169,6 +170,28 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
8AA526702BCF1887007D28B1 /* Lint Sources */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Lint Sources";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint --config ../.swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
88AD13712834355000500B2E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -225,6 +248,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -239,7 +263,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -286,6 +310,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -294,7 +319,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -314,6 +339,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"AuthenticationExample/Preview Content\"";
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = AuthenticationExample/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand All @@ -325,13 +351,14 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 200.4.0;
MARKETING_VERSION = 200.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -347,6 +374,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"AuthenticationExample/Preview Content\"";
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = AuthenticationExample/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand All @@ -358,13 +386,14 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 200.4.0;
MARKETING_VERSION = 200.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.esri.Authentication;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
29 changes: 11 additions & 18 deletions AuthenticationExample/AuthenticationExample/AuthenticationApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGISToolkit
import ArcGIS
import ArcGISToolkit
import SwiftUI

@main
struct AuthenticationApp: App {
@ObservedObject var authenticator: Authenticator
@State var isSettingUp = true
@StateObject private var authenticator = Authenticator(
// If you want to use OAuth, uncomment this code:
// oAuthUserConfigurations: [.arcgisDotCom]
)

init() {
// Create an authenticator.
authenticator = Authenticator(
// If you want to use OAuth, uncomment this code:
//oAuthUserConfigurations: [.arcgisDotCom]
)
// Sets authenticator as ArcGIS and Network challenge handlers to handle authentication
// challenges.
ArcGISEnvironment.authenticationManager.handleChallenges(using: authenticator)
}
@State private var isSettingUp = true

var body: some SwiftUI.Scene {
WindowGroup {
Expand All @@ -48,9 +41,9 @@ struct AuthenticationApp: App {
// - Integrated Windows Authentication (IWA)
// - Client Certificate (PKI)
.authenticator(authenticator)
.environmentObject(authenticator)
.task {
isSettingUp = true
ArcGISEnvironment.authenticationManager.handleChallenges(using: authenticator)
// Here we setup credential stores to be persistent, which means that it will
// synchronize with the keychain for storing credentials.
// It also means that a user can sign in without having to be prompted for
Expand All @@ -63,8 +56,8 @@ struct AuthenticationApp: App {
}
}

// If you want to use OAuth, you can uncomment this code:
//private extension OAuthUserConfiguration {
private extension OAuthUserConfiguration {
// If you want to use OAuth, uncomment this code:
// static let arcgisDotCom = OAuthUserConfiguration(
// portalURL: .portal,
// clientID: "<#Your client ID goes here#>",
Expand All @@ -73,7 +66,7 @@ struct AuthenticationApp: App {
// // The scheme of the redirect URL is also specified in the Info.plist file.
// redirectURL: URL(string: "authexample://auth")!
// )
//}
}

extension URL {
// If you want to use your own portal, provide your own URL here:
Expand Down
9 changes: 4 additions & 5 deletions AuthenticationExample/AuthenticationExample/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import SwiftUI

/// The view that is displayed after successfully signing in.
struct HomeView: View {
/// The portal that the user is signed in to.
@State var portal: Portal?
@State private var portal: Portal?

/// A Boolean value indicating whether the profile view should be presented.
@State var showProfile = false
@State private var showProfile = false

var body: some View {
if let portal = portal {
NavigationView{
NavigationStack {
WebMapsView(portal: portal)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Expand All @@ -42,7 +42,6 @@ struct HomeView: View {
}
}
}
.navigationViewStyle(.stack)
} else {
SignInView(portal: $portal)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import SwiftUI

/// A view that loads a `LoadableImage` and displays it.
/// While the image is loading a progress view is displayed.
/// If there is an error displaying the image a red exclamation circle is displayed.
@MainActor
struct LoadableImageView: View {
/// The loadable image to display.
let loadableImage: LoadableImage

/// The result of loading the image.
@State var result: Result<UIImage, Error>? = nil
@State private var result: Result<UIImage, Error>?

var body: some View {
Group {
Expand All @@ -38,7 +39,8 @@ struct LoadableImageView: View {
Image(uiImage: image)
.resizable()
}
}.task {
}
.task {
result = await Result {
try await loadableImage.load()
return loadableImage.image ?? UIImage()
Expand Down
6 changes: 3 additions & 3 deletions AuthenticationExample/AuthenticationExample/MapItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import SwiftUI

/// A view that displays a map.
@MainActor
struct MapItemView: View {
/// The map that is to be displayed.
let map: Map

/// The result of loading the map.
@State var loadResult: Result<Void, Error>?
@State private var loadResult: Result<Void, Error>?

var body: some View {
VStack {
Expand All @@ -43,4 +44,3 @@ struct MapItemView: View {
}
}
}

7 changes: 4 additions & 3 deletions AuthenticationExample/AuthenticationExample/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import ArcGISToolkit
import SwiftUI

/// A view that displays the profile of a user.
@MainActor
struct ProfileView: View {
/// The portal that the user is signed in to.
@State var portal: Portal
let portal: Portal

/// A Boolean indicating whether the user is signing out.
@State var isSigningOut: Bool = false
@State private var isSigningOut = false

/// The closure to call once the user has signed out.
var signOutAction: () -> Void
Expand Down
11 changes: 6 additions & 5 deletions AuthenticationExample/AuthenticationExample/SignInView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import ArcGISToolkit
import CryptoKit
import SwiftUI

/// A view that allows the user to sign in to a portal.
struct SignInView: View {
@MainActor
struct SignInView: View {
/// The error that occurred during an attempt to sign in.
@State var error: Error?
@State private var error: Error?

/// A Boolean value indicating if the user is currently signing in.
@State var isSigningIn: Bool = false
@State private var isSigningIn = false

/// The portal that the user successfully signed in to.
@Binding var portal: Portal?
Expand All @@ -34,7 +35,7 @@ struct SignInView: View {
/// credential did not have a username.
/// - If the property is non-nil and non-empty, then it contains the previously used and
/// persisted username.
@State var lastSignedInUser: String?
@State private var lastSignedInUser: String?

var body: some View {
VStack {
Expand Down
4 changes: 2 additions & 2 deletions AuthenticationExample/AuthenticationExample/UserView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import SwiftUI

/// A view that displays details of a portal user.
struct UserView: View {
/// The user to display the details for.
@State var user: PortalUser
let user: PortalUser

var body: some View {
VStack {
Expand Down
6 changes: 3 additions & 3 deletions AuthenticationExample/AuthenticationExample/WebMapsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import SwiftUI
import ArcGIS
import SwiftUI

/// A view that displays the web maps of a portal.
struct WebMapsView: View {
/// The portal from which the web maps can be fetched.
var portal: Portal

/// A Boolean value indicating whether the featured content is being loaded.
@State var isLoading = true
@State private var isLoading = true

/// The web map portal items.
@State var webMapItems = [PortalItem]()
@State private var webMapItems = [PortalItem]()

var body: some View {
VStack {
Expand Down
Loading

0 comments on commit 27259c3

Please sign in to comment.