What happens if you replay @ObservedObject with @StateObject in your App struct?
Post
Replies
Boosts
Views
Activity
In your first example your properties are missing the @Published annotation.
Views observing an ObservableObject only refresh on change of properties which are marked as @Published.
Did you add the Swift Collections Package to your playground as shown in the video at runtime 3 min 50 secs?
This step is different from and necessary prerequisite for import Collections.
You can alway add
#if targetEnvironment(simulator)
print("Documents Directory:\n\(URL.documentsDirectory.path())")
#endif
somewhere in the initialization of your app code and print the path to the console.
Or use the following app https://github.com/twostraws/ControlRoom for additional features the simulator should have,
including access to the documents directory and the directory where the Files App stores its data.
What about requestMediaDataWhenReady( on queue: DispatchQueue, using block: @escaping () -> Void )(see documentation)
You can use Swift Playgrounds on iPad to create real apps.
There are free eBooks from Apple for this topic: Learn to Code - Teacher Guide and many more!
For school-related questions Apples Education Community should be a great resource.
This seems to be a common problem with the App Store: You need to have already "bought" the app when the older version was still current.
See this guide ( https://www.makeuseof.com/how-to-download-older-versions-of-apps-on-older-iphone/ ) for example.
What happens if you put
@StateObject var env = EnvObj()
above your App's body declaration and pass env on to ContentView?
In your code EnvObj() my be called multiple times because body may be evaluated every time SwiftUI needs it.
This is a computed variable on the type which returns a new instance of the type using it's init().
something like
static var computedTypeProperty:String {
return "Test"
}
filed feedback with Apple: FB11722934
This should be possible by adjusting your sort condition. Instead of lValue.categoryName < rValue.categoryNameyou could write something like this:
(lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName
or
!(lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName
This is not correct code yet and I didn't validate the conditions, but I hope you get the idea.
lValue.categoryName < rValue.categoryName is the sort condition the .sort-function uses to decide in which order the elements should appear.
You can use very complex conditions or even a function deciding the order of two items by returning true or false depending on the order you want the two compared elements to appear.
Take a look at the official Swift book
This is probably due to copyright restrictions. Screenshots of protected videos are blanked.
Has anyone got this to work? A NavigationSplitView inside of a NavigationStack?
It still does not work in Xcode 14.1, iPadOS 16 Beta 2
Make sure you only access the GUI and the corresponding state from the main thread. If not, all kind of strange behaviour may occur.