Same on iOS 18 Beta 7.
The "funny" thing is that it crashes on the try, the error is not catched.
...
try context.save() <<< Crash
} catch {
print(error)
}
Post
Replies
Boosts
Views
Activity
Found the issue:
I added the HKQuantityType(.dietaryWater) request in the
try await hkHealthStore.requestAuthorization(toShare: writeValues, read: readValues)
As share variable (thinking this would include the read) but it doesn't read.
If others have the same issue. Double check that 😉
Hi @HelloBlaine ,
I have the same issue. But how can I then pass parameters immediately if the $question is not allowed?
Also the sample code from the AcceleratingAppInteractionsWithAppIntents example project shows exactly that this is the way to go.
static var appShortcuts: [AppShortcut] {
/**
Records activity on a trail, such as hiking. On Apple Watch, `StartTrailActivity` creates a workout session.
Use the `$workoutStyle` parameter from the intent to allow people to ask the app to start tracking an activity by the
activity name. The system creates an App Shortcut for each possible value in the `ActivityStyle` enumeration. The complete set of
generated App Shortcuts for this intent are visible in the Shortcuts app, or by following the `ShortcutsLink` at the bottom of
`SidebarColumn`.
*/
AppShortcut(intent: StartTrailActivity(), phrases: [
"Track my \(\.$workoutStyle) in \(.applicationName)",
"Start tracking my \(\.$workoutStyle) with \(.applicationName)",
"Start a workout in \(.applicationName)",
"Start a \(.applicationName) workout"
],
shortTitle: "Start Activity",
systemImageName: "shoeprints.fill")
[....]
Same issue here. iOS 18 beta 3
I did share the data set via Airdrop to another mac (M2 Pro), running still Xcode 16 beta 2 (same CoreML version), but running on MacOS 14.5 (23F79), 32GB RAM,
It took longer but no issues and model trained.
Seems more something on MacOS, but I don't know how to investigate further.
In my case some of the widgets get completely removed for the home screen automatically at random time.
I also noticed the following in the console:
[...] systemMedium::(null)
Did some of view also get this problem of "automatically removed" widget from the OS?
I am running iOS 17.5 (also same behaviour with 17.4).
Hi all,
Same issue here. It was crashing on beta 6 and I waited for the beta 7, but still the same issue is happening.
Don't know if it helps the following stack trace.
I tried to delete the line shown and by removing it, it compiles, but, well, I can't use Swift Data!
Any updates on this?
Apple Swift version 5.9 (swiftlang-5.9.0.128.106 clang-1500.0.40.1)
2. Compiling with the current language version
3. While evaluating request TypeCheckSourceFileRequest(source_file "/Users/andreaciani/Developer/Xcode-Projects/RLScoreTracker/RLScoreTracker/Views/PackageView/PackageListViewModel.swift")
4. While evaluating request TypeCheckFunctionBodyRequest(Counterby.(file).PackageListView extension.ViewModel.createNewPackage(in:)@/Users/andreaciani/Developer/Xcode-Projects/RLScoreTracker/RLScoreTracker/Views/PackageView/PackageListViewModel.swift:31:14)
5. While type-checking statement at [/Users/andreaciani/Developer/Xcode-Projects/RLScoreTracker/RLScoreTracker/Views/PackageView/PackageListViewModel.swift:31:57 - line:36:9] RangeText="{
let package = Persistency.SWDPackage(name: "", timestamp: Date(), items: [], goal: 0.0)
// let package = SWDPackage(name: newPackageName, timestamp: Date(), items: [], goal: 0)
// context.insert(package)
// self.newPackageName = ""
"
6. While type-checking declaration 0x14485abe0 (at /Users/andreaciani/Developer/Xcode-Projects/RLScoreTracker/RLScoreTracker/Views/PackageView/PackageListViewModel.swift:32:13)
7. While evaluating request PatternBindingEntryRequest((unknown decl), 0, 0)
8. While type-checking expression at [/Users/andreaciani/Developer/Xcode-Projects/RLScoreTracker/RLScoreTracker/Views/PackageView/PackageListViewModel.swift:32:27 - line:32:99] RangeText="Persistency.SWDPackage(name: "", timestamp: Date(), items: [], goal: 0.0"
9. While type-checking-target starting at /Users/andreaciani/Developer/Xcode-Projects/RLScoreTracker/RLScoreTracker/Views/PackageView/PackageListViewModel.swift:32:39
10. While reading from module 'Persistency', builder version '5.9(5.9)/Apple Swift version 5.9 (swiftlang-5.9.0.128.106 clang-1500.0.40.1)', built from source, non-resilient, loaded from '/Users/andreaciani/Library/Developer/Xcode/DerivedData/RLScoreTracker-hahiewpmlftmcygiutlddbpypydu/Build/Products/Debug/Persistency.swiftmodule/arm64-apple-macos.swiftmodule'
11. While finishing conformance for protocol conformance to 'PersistentModel' (in module 'SwiftData') for type 'SWDPackage'
12. *** DESERIALIZATION FAILURE ***
*** If any module named here was modified in the SDK, please delete the ***
*** new swiftmodule files from the SDK and keep only swiftinterfaces. ***
module 'Persistency', builder version '5.9(5.9)/Apple Swift version 5.9 (swiftlang-5.9.0.128.106 clang-1500.0.40.1)', built from source, non-resilient, loaded from '/Users/andreaciani/Library/Developer/Xcode/DerivedData/RLScoreTracker-hahiewpmlftmcygiutlddbpypydu/Build/Products/Debug/Persistency.swiftmodule/arm64-apple-macos.swiftmodule'
serialized conformances do not match requirement signature
Same issue here
Same issue on my side 🙁
Same issue. Have you solved somehow?
Yes, that's what I did. I removed and the second error appeared.
For some reason even if I changed the cloudKitContainerIdentifier: "iCloud.my.icloud.id" the app was still using the old container.
Not sure if it's a bug on Swift Data or intended behavior.
By reverting the old container id now works.
FYI:
I was trying to use AppGroup to share data between devices.
That is no longer possible.
Either you use Watch Connectivity or iCloud.
Hi @BabyJ , thanks for your help.
SWDPackge is as simple as this:
@Model final public class SWDPackage {
public var name: String?
public var timestamp: Date = Date()
public var publicID = UUID()
public init(name: String? = nil, timestamp: Date, items: [SWDItem] = []) {
self.name = name
self.timestamp = timestamp
self.items = items
}
@Relationship(.cascade, inverse: \SWDItem.package)
public var items: [SWDItem]?
}
while for the SWDItem is the following
@Model final public class SWDItem {
public var timestamp: Date = Date()
public var name: String?
@Attribute(.unique)
public var publicID = UUID()
public var value: Double = 0.0
public init(timestamp: Date, value: Double, package: SWDPackage) {
self.timestamp = timestamp
self.value = value
self.package = package
}
@Relationship
public var package: SWDPackage?
}
I have to put the values that do not have default values as optionals (included relationships) to fulfill iCloud Sync requirements.
I tried with and without @Attribute(.unique). Same results
Yes, this is what I tried as well, but got this error:
I'm a bit confused why I get this.
PublicID is a UUID type.