I have tried the codes in this page
https://developer.apple.com/forums/thread/731271?answerId=755458022#755458022
.scrollPosition(id: $dataID) is supposed to keep the current ScrollView position.
However, none of them work.
I use Xcode 15.3. Tested on iOS 17.0.1 and iOS 17.4 simulators.
The people in the page talk like it works for appending, not for prepending.
But in my tests, none of them keeps the scroll position.
The scroll view will scroll to other part, without changing the dataID.
It will update the dataId to the current value only when I scroll manually.
Post
Replies
Boosts
Views
Activity
the error message
2023-04-17 17:05:40.480808+0800 App[50867:2284976] [error] warning: dynamic accessors failed to find @property implementation for 'name' for entity 'User' while resolving selector 'setName:' on class 'Framework.User'. Did you remember to declare it @dynamic or @synthesized in the @implementation ?
the failing codes
If I uncomment the load() function below, the save() function can be executed correctly.
It doesn't matter if the load() function is executed or not.
It does matter if the codes in load() function exist.
Xcode: 14.3
macOS: 13.0.1
I cannot attach zip files here (dunno why)
but the project can be found in [https://github.com/tuist/tuist/tree/main/projects/tuist/fixtures/ios_app_with_coredata_in_static_framework]
I did a little research. The key for CoreData to work is to have User.fetchRequest() presented in the code.