Apple still needs to Update Swift Playgrounds App to Swift 6 and iPadOS 18 APIs.
And it is about time!
Post
Replies
Boosts
Views
Activity
It is particularly important to them to drive all navigation from state as described here:
https://swiftpackageindex.com/pointfreeco/swiftui-navigation/main/documentation/swiftuinavigation/whatisnavigation#State-driven-navigation
Have you considered the navigation library from the people at point.free?
https://github.com/pointfreeco/swiftui-navigation
They have corresponding videos about the subject
https://www.pointfree.co/collections/swiftui/navigation
some of them are free:
https://www.pointfree.co/episodes/free
Leave the @preconcurrency attribute in and ignore the warning (for now). I heard it is a bug in some version if the compiler betas.
Have you tried the same with Xcode 16.0 Release Candidate (Sep 9th)? It should aready have a newer compiler than Xcode 16.1 (Aug 12th).
This works in my code:
try await PHPhotoLibrary.shared().performChanges{@Sendable in
...
}
but be sure to only capture sendable values in the closure.
If someone later finds this, the following worked for me
performChanges{@Sendable in ... }
I had the same problem again later with PHImageManager.requestAVAsset{}, the solution is the same.
I had a similar problem in recording video from the camera. I had to add the AVCaptureMovieFileOutput to the capture session right after setting up the AVCaptureDevice. When the user pressed the record button at a later time it worked without black frames.
But when I did set up the AVCaptureMovieFileOutput only after the user pressed record I got black frames at the start of the recorded movie.
Does anyone know what is the problem here?
This is „expected behaviour“: https://samwize.com/2024/05/08/do-not-init-state-externally-in-swiftui-view/
This still does not seem to work in iPadOS 18 beta 1. What am I doing wrong?
Perhaps I misunderstand your question, but the way I see it:
There is nothing „silly“ about this behaviour, because the "background" is part of and encoded into the video. Is there even a standard for "transparent video“? How should the video player know which part of the video you consider "background".
If you meant to remove the "black bars" of letterboxed widescreen videos they may also be part of the video or if not, make sure you size the video player to the correct aspect ratio to prevent it from padding your video. (I have not tested this).
Adiitionally: Don't confuse running the body with "view creation". Running the body does not really show anything yet.
Have a look at the following article: https://www.massicotte.org/isolation-intuition about Swift Isolation Intuition.
Perhaps it will help you understand where Swift runs your code.
Have a look at the Perception package from the point.free guys. It is a backport of the Observation tools to earlier OSs:
https://github.com/pointfreeco/swift-perception
This was finally fixed in the release candidate of 17.4. Thank you!
I think, the only way to do this is to create a new (empty) .swiftpm package and copy the files/coded across.