Post

Replies

Boosts

Views

Created

Xcode 16.x project doesn’t build with (SiriKit / Widget) intent definition file + translations
If you add a (SiriKit / Widget) intent definition file to an Xcode project and then translate it into another language, the build of the iOS app only works until you close the project. As soon as you open the project again, you get the error message with the next build: Unexpected duplicate tasks A workaround for this bug is, that you convert the folder (where the intent file is located) in Xcode to a group. After that every thing works without problems. Steps to reproduce: Create a new iOS project Add a localization to the project (German for example) Add a SiriKit Intent Definition File Localize the SiriKit Intent Definition File Build the project (should work without errors) Close the project Open the project again Build the project again Expected result: The project builds without problems Current result: The project doesn’t build and returns the error: Unexpected duplicate tasks Is this a known problem? Is there a way to solve this without switching to Xcode groups (instead of folders)
3
1
910
Dec ’24
Warning in Xcode console: Couldn't read values in CFPrefsPlistSource
I have enabled an App Group in my App and the Widget Extension. I use it to share my UserDefaults. Every time the app starts I now get the following error message in the Xcode console: Couldn't read values in CFPrefsPlistSource<0x303034510> (Domain: group.XX.XXXX.XXXX, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd The shared UserDefaults itself works without problems. Any ideas how I could get rid of this warning?
1
1
3.5k
Oct ’24
TipKit: Present popover tip after sheet gets dismissed
I have created a tip with a parameter (Bool) I have tried to set it to true in a sheet which is presented modally over the view which should present the popover tip. After the sheet gets dismissed the popover tip is never presented. If I restart the app, the popover tip appears. Is there any way to trigger the presentation of a popover tip manually? I have created a little demo app to demonstrate my problem: Setup TipKit on app start: import SwiftUI import TipKit @main struct TipKitDemoApp: App { var body: some Scene { WindowGroup { ContentView() .task { try? Tips.configure() } } } } Simple tip: import Foundation import TipKit struct DemoTip: Tip { @Parameter static var enabled: Bool = false var title: Text { Text("Demo Tip") } var rules: [Rule] { [ #Rule(Self.$enabled) { $0 == true } ] } } Content view which includes the popover tip and displays the sheet where the tip can be enabled: import SwiftUI struct ContentView: View { @State private var presentDetail = false let demoTip = DemoTip() var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") .popoverTip(demoTip) Button("Present Details") { presentDetail.toggle() } } .padding() .sheet(isPresented: $presentDetail) { DetailView() } } } In the detail view the tip gets enabled, but if I dismiss this view, the tip only appears after I restart the app: import SwiftUI struct DetailView: View { @Environment(\.dismiss) private var dismiss var body: some View { Button("Enable demo tip") { DemoTip.enabled = true } Button("Dismiss") { dismiss() } } }
2
0
1.5k
Jan ’24
URL(string: "127.0.0.1:8000/test") doesn't create a valid URL anymore with Xcode 15 Beta 5
With Xcode 15.0 Beta 5 (swift-driver version: 1.87 Apple Swift version 5.9 (swiftlang-5.9.0.124.4 clang-1500.0.38.1)) I can't create a valid URL with the following String: URL(string: "127.0.0.1:8000/test") With Xcode 14.3.1 (Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)) this worked without any problems. Does anyone know if this is a bug or intentional?
1
0
1k
Aug ’23
SwiftUI + Core Data CRUD example
Hello, is there any example how to use Core Data in a modern way with SwiftUI which also includes updating an NSManagedObjectModel? In the most examples which I found only the create and update steps are described. I am interested in the update step. Where I present an edit screen. Is it better to create a @State variable for the properties of the NSManagedObjectModel or should I load the NSManagedObjectModel from an child context and edit the properties directly? Does anyone have some up to date examples or advice for me? Cheers Patrick
0
0
894
Feb ’23
Upgrade Swift Playgrounds App to iOS 16
Hi, I started developing an iOS app in Swift Playgrounds last year. Now I tried to add a NavigationStack into one of my SwiftUI views. I get the error, that NavigationStack is only available since iOS 16. If I create a new app project it is possible to use iOS 16 related features. Is there any way to upgrade existing apps to iOS 16? Like in Xcode (Deployment Target).
2
0
1.9k
Nov ’22
SwiftUI TabView with page style doesn't present dots on watchOS
Hi, I have created a TabView with TabViewStyle.page. Is there a way to present the dots on watchOS? I have written some demo watchOS project: import SwiftUI @main struct PageControllerWatchTestApp: App {     var body: some Scene         WindowGroup {             TabView {                 Color(.red)                 Color(.blue)                 Color(.orange)             }.tabViewStyle(.page)         }     } } If I try the same code on iOS the dots are presented. Is there a way to enable the dots on watchOS? I am using watchOS 9 Beta 4 with Xcode 14 Beta 4.
4
0
4.0k
Aug ’22
Xcode 16.x project doesn’t build with (SiriKit / Widget) intent definition file + translations
If you add a (SiriKit / Widget) intent definition file to an Xcode project and then translate it into another language, the build of the iOS app only works until you close the project. As soon as you open the project again, you get the error message with the next build: Unexpected duplicate tasks A workaround for this bug is, that you convert the folder (where the intent file is located) in Xcode to a group. After that every thing works without problems. Steps to reproduce: Create a new iOS project Add a localization to the project (German for example) Add a SiriKit Intent Definition File Localize the SiriKit Intent Definition File Build the project (should work without errors) Close the project Open the project again Build the project again Expected result: The project builds without problems Current result: The project doesn’t build and returns the error: Unexpected duplicate tasks Is this a known problem? Is there a way to solve this without switching to Xcode groups (instead of folders)
Replies
3
Boosts
1
Views
910
Activity
Dec ’24
Warning in Xcode console: Couldn't read values in CFPrefsPlistSource
I have enabled an App Group in my App and the Widget Extension. I use it to share my UserDefaults. Every time the app starts I now get the following error message in the Xcode console: Couldn't read values in CFPrefsPlistSource<0x303034510> (Domain: group.XX.XXXX.XXXX, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd The shared UserDefaults itself works without problems. Any ideas how I could get rid of this warning?
Replies
1
Boosts
1
Views
3.5k
Activity
Oct ’24
TipKit: Present popover tip after sheet gets dismissed
I have created a tip with a parameter (Bool) I have tried to set it to true in a sheet which is presented modally over the view which should present the popover tip. After the sheet gets dismissed the popover tip is never presented. If I restart the app, the popover tip appears. Is there any way to trigger the presentation of a popover tip manually? I have created a little demo app to demonstrate my problem: Setup TipKit on app start: import SwiftUI import TipKit @main struct TipKitDemoApp: App { var body: some Scene { WindowGroup { ContentView() .task { try? Tips.configure() } } } } Simple tip: import Foundation import TipKit struct DemoTip: Tip { @Parameter static var enabled: Bool = false var title: Text { Text("Demo Tip") } var rules: [Rule] { [ #Rule(Self.$enabled) { $0 == true } ] } } Content view which includes the popover tip and displays the sheet where the tip can be enabled: import SwiftUI struct ContentView: View { @State private var presentDetail = false let demoTip = DemoTip() var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") .popoverTip(demoTip) Button("Present Details") { presentDetail.toggle() } } .padding() .sheet(isPresented: $presentDetail) { DetailView() } } } In the detail view the tip gets enabled, but if I dismiss this view, the tip only appears after I restart the app: import SwiftUI struct DetailView: View { @Environment(\.dismiss) private var dismiss var body: some View { Button("Enable demo tip") { DemoTip.enabled = true } Button("Dismiss") { dismiss() } } }
Replies
2
Boosts
0
Views
1.5k
Activity
Jan ’24
URL(string: "127.0.0.1:8000/test") doesn't create a valid URL anymore with Xcode 15 Beta 5
With Xcode 15.0 Beta 5 (swift-driver version: 1.87 Apple Swift version 5.9 (swiftlang-5.9.0.124.4 clang-1500.0.38.1)) I can't create a valid URL with the following String: URL(string: "127.0.0.1:8000/test") With Xcode 14.3.1 (Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)) this worked without any problems. Does anyone know if this is a bug or intentional?
Replies
1
Boosts
0
Views
1k
Activity
Aug ’23
SwiftUI + Core Data CRUD example
Hello, is there any example how to use Core Data in a modern way with SwiftUI which also includes updating an NSManagedObjectModel? In the most examples which I found only the create and update steps are described. I am interested in the update step. Where I present an edit screen. Is it better to create a @State variable for the properties of the NSManagedObjectModel or should I load the NSManagedObjectModel from an child context and edit the properties directly? Does anyone have some up to date examples or advice for me? Cheers Patrick
Replies
0
Boosts
0
Views
894
Activity
Feb ’23
Upgrade Swift Playgrounds App to iOS 16
Hi, I started developing an iOS app in Swift Playgrounds last year. Now I tried to add a NavigationStack into one of my SwiftUI views. I get the error, that NavigationStack is only available since iOS 16. If I create a new app project it is possible to use iOS 16 related features. Is there any way to upgrade existing apps to iOS 16? Like in Xcode (Deployment Target).
Replies
2
Boosts
0
Views
1.9k
Activity
Nov ’22
ShareLink doesn't attach file on watchOS
I have a small text file which I would like to share via ShareLink with watchOS. If I try to share the text file via Mail oder iMessage the recipient only receives the message without the attachment. The same code works without problems on iOS. Is the is watchOS bug?
Replies
5
Boosts
1
Views
1.3k
Activity
Sep ’22
App Intent parameter type file
Hi, I started to implement my first App Intent. I have added a parameter (@Parameter). But what data type do I need do set to get a file as input?
Replies
3
Boosts
1
Views
3.1k
Activity
Aug ’22
SwiftUI TabView with page style doesn't present dots on watchOS
Hi, I have created a TabView with TabViewStyle.page. Is there a way to present the dots on watchOS? I have written some demo watchOS project: import SwiftUI @main struct PageControllerWatchTestApp: App {     var body: some Scene         WindowGroup {             TabView {                 Color(.red)                 Color(.blue)                 Color(.orange)             }.tabViewStyle(.page)         }     } } If I try the same code on iOS the dots are presented. Is there a way to enable the dots on watchOS? I am using watchOS 9 Beta 4 with Xcode 14 Beta 4.
Replies
4
Boosts
0
Views
4.0k
Activity
Aug ’22
Does the new Swift Charts support pie charts?
I now watched all 4 charts WWDC22 videos. It looks like there is no pie chart support. Do I need to build such style by myself or is there a way to implement this in the new Swift Charts framework?
Replies
4
Boosts
1
Views
2.3k
Activity
Jun ’22