Hi
I reviewed this post:
How to change navigation title color in swiftUI
This seems to work fine if the intention is to apply the title color across an application. I would like to apply a different text title color selectively depending on the View being shown. And in some instances revert back to the color depending on the light and dark themes.
Same result occurs using a viewmodifier or simply using onAppear and onDisappear with the title color is applied to all views. And if you do modify it in onDisappear, when you navigate back to another view which changes the color onAppear it has the same color as the previous view.
The only way I've found this to work is using UIViewControllerRepresentable and handling the viewWillAppear and viewWillDisappear something like this:
NavigationBarView(
viewWillAppear: { nav in
nav.navigationBar.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
},
viewWillDisappear: { nav in
nav.navigationBar.largeTitleTextAttributes = nil
}
)
Has anyone been successful in getting a different title text color to apply to different views using a modifier or onAppear and onDisappear?
Appreciate any guidance.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi, upgraded to Xcode Version 16.3 (16E140) today and now Playground can't execute JSON decoding. The code below is taken from Apple's own JSONDecoder example:
struct GroceryProduct: Codable {
var name: String
var points: Int
var description: String?
}
let json = """
{
"name": "Durian",
"points": 600,
"description": "A fruit with a distinctive scent."
}
""".data(using: .utf8)!
let decoder = JSONDecoder()
let product = try decoder.decode(GroceryProduct.self, from: json)
print(product.name) // Prints "Durian"
This use to work in the previous Xcode version. Now I get this error:
The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'.
This file doesn't exist in the location. I've restarted Xcode and the Mac, same error.
Any thoughts?
Hi
I'm developing an app that autofills Passkeys. The app allows the user to authenticate to their IdP to obtain an access token. Using the token the app fetches from <server>/attestation/options.
The app will generate a Passkey credential using a home-grown module - the extension has no involvement, neither does ASAuthorizationSecurityKeyPublicKeyCredentialProvider. I can confirm the passkey does get created.
Next the credential is posted to <server>/attestation/results with the response JSON being parsed and used to create a ASPasskeyCredentialIdentity - a sample of the response JSON is attached.
Here is my save function:
static func save(authenticator: AuthenticatorInfo) async throws {
guard let credentialID = Data(base64URLEncoded: authenticator.attributes.credentialId) else {
throw AuthenticatorError.invalidEncoding("Credential ID is not a valid Base64URL string.")
}
guard let userHandle = authenticator.userId.data(using: .utf8) else {
throw AuthenticatorError.invalidEncoding("User handle is not a valid UTF-8 string.")
}
let identity = ASPasskeyCredentialIdentity(
relyingPartyIdentifier: authenticator.attributes.rpId,
userName: authenticator.userId, // This is what the user sees in the UI
credentialID: credentialID,
userHandle: userHandle,
recordIdentifier: authenticator.id
)
try await ASCredentialIdentityStore.shared.saveCredentialIdentities([identity])
}
Although no error occurs, I don't get any identities returned when I call this method:
let identities = await ASCredentialIdentityStore.shared.credentialIdentities(
forService: nil,
credentialIdentityTypes: [.passkey]
)
Here is the Info.plist in the Extension:
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>ASCredentialProviderExtensionCapabilities</key>
<dict>
<key>ProvidesPasskeys</key>
<true/>
</dict>
<key>ASCredentialProviderExtensionShowsConfigurationUI</key>
<true/>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.authentication-services-credential-provider-ui</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).CredentialProviderViewController</string>
</dict>
</dict>
</plist>
The entitlements are valid and the app and extension both support the same group.
I'm stumped as to why the identity is not getting saved. Any ideas and not getting retrieved.
attestationResult.json
Hi
I've built an SSO extension for my app. Now I would like to update the authsrv:login.myhost.com with additional associated domains generated by the MDM.
The video here at 9:10 mark references the MDM associated domain ApplicationAttributes for iOS as the way to go.
https://developer.apple.com/videos/play/tech-talks/301/
Is it just a matter of including:
com.apple.developer.associated-domains.mdm-managed=YES in the entitlement file for both the app and the extension and having the MDM push down something like this in the profile?
<dict>
<key>AssociatedDomains</key>
<array>
<string>authsrv:login.myhost2.com</string>
</array>
</dict>
Appreciate any guidance.