Post

Replies

Boosts

Views

Activity

Reply to swift: Calling "/usr/bin/defaults" returns no data
For the records: I use now the Prefrerences Utilities. The readBool code was already given by Quinn above. Here is my writeBool code: func writeBool(domain: String, key: String, value: Bool) { let appID = domain as CFString let cfKey = key as CFString let cfValue: CFPropertyList = value as CFBoolean CFPreferencesSetValue(cfKey, cfValue, appID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost) CFPreferencesSynchronize(appID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost) }
Topic: App & System Services SubTopic: General Tags:
Mar ’26
Reply to Can't run Swift App on Mojave
I did several times a clean build. My development machine is a MacBook Pro M1 on Monterey and therefore I cannot use Xcode 12 anymore. I wan to copy just the application to the older Mac and not use Xcode on that machine. The test project was also created on my development machine. Any yes: The error message is really strange.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22
Reply to Misleading error on ForEach
Many thanks.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
1w
Reply to swift: Calling "/usr/bin/defaults" returns no data
For the records: I use now the Prefrerences Utilities. The readBool code was already given by Quinn above. Here is my writeBool code: func writeBool(domain: String, key: String, value: Bool) { let appID = domain as CFString let cfKey = key as CFString let cfValue: CFPropertyList = value as CFBoolean CFPreferencesSetValue(cfKey, cfValue, appID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost) CFPreferencesSynchronize(appID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost) }
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to swift: Calling "/usr/bin/defaults" returns no data
Many thanks Quinn. I prefer plain Swift Classes and therefore I did not look at the Preferences Utilities. I will look into this and I agree that this is a much better solution than using the shell command.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to swift: Calling "/usr/bin/defaults" returns no data
Strange: In my test application I removed "Apple Sandbox" and now it works here. Using the same settings it does not work in my real app. I guess there is a wrong Xcode setting for my target. Need to investigate…
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26
Reply to Drag & Drop with view hierarchy
Finally I was able to solve this via GeometryProxy with some math. It could be hard to wrap the brain around local and global coordinates relationship.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Nov ’25
Reply to Can't run Swift App on Mojave
I did several times a clean build. My development machine is a MacBook Pro M1 on Monterey and therefore I cannot use Xcode 12 anymore. I wan to copy just the application to the older Mac and not use Xcode on that machine. The test project was also created on my development machine. Any yes: The error message is really strange.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to Send mails in background via SMTP (macOS)
Meanwhile I got it working. Now I use SwiftSMTP which works well in background. See “swift-smtp/Sources/SwiftSMTPCLI/main.swift“ for sample code how to use it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21