Posts

Post not yet marked as solved
1 Replies
470 Views
The following type of problem has appeared. I need to flip through the video. Imagine you have, say, 3 videos, and you can scroll through them and choose which video you want to watch. For this, I decided to use a TabView with the .page style. But it turned out that it didn't work. And I found myself in a stupor. The TabView itself starts to lag, the scrolling starts to lag, the videos do not start the first time, and sometimes the control panel does not even appear on some videos, which is why it is impossible to expand the video to full screen. The code will be below, maybe someone has encountered this problem, how did he solve it, maybe there are some other options to make a similar logic? let videos: [String] = ["burpee", "squat", "step-up", "sun-salute"] var body: some View { TabView { ForEach(videos, id: \.self) { videoName in VideoPlayerView(videoName: videoName) .clipShape(RoundedRectangle(cornerRadius: 25)) } } .frame(width: 375, height: 230) } struct VideoPlayerView: View { let videoName: String var body: some View { if let videoURL = Bundle.main.url(forResource: videoName, withExtension: "mp4") { VideoPlayerWrapper(player: AVPlayer(url: videoURL)) } else { Text("No Video \(videoName)") } } } #Preview { VideoPlayerView(videoName: "squat") } struct VideoPlayerWrapper: UIViewControllerRepresentable { let player: AVPlayer func makeUIViewController(context: Context) -> AVPlayerViewController { let controller = AVPlayerViewController() controller.player = player controller.showsPlaybackControls = true return controller } func updateUIViewController(_ uiViewController: AVPlayerViewController, context: Context) {} }
Posted Last updated
.
Post marked as solved
1 Replies
742 Views
After I upgraded to Xcode version 14.0 an error appeared. When starting the simulator. objc[8958]: Class SBFCARendererImageRepresentation is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SpringBoardFoundation.framework/SpringBoardFoundation (0x1382b95a0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/PaperBoardUI.framework/PaperBoardUI (0x1385b5930). One of the two will be used. Which one is undefined. I did not attach much importance to this, I thought that it would not be in the next update, but now I have upgraded to Xcode version 14.0.1 and the error has not disappeared, I do not quite understand what is required of me to fix it.
Posted Last updated
.
Post marked as solved
1 Replies
1.1k Views
Good afternoon, perhaps after the update someone had a problem with the consumption of RAM. Regardless of whether Swift or SwiftUI simulator consumes at least 8-10 gigabytes of RAM. The usual empty project in which it says "Hello World". If I run two simulators already, then the RAM consumption goes for 20+ gigabytes. There was no such thing before the latest updates. Previously, one simulator consumed 1.5-2 gigabytes, but not 10. How to deal with it ? Derived Data was cleaned. Xcode itself was completely removed and reinstalled, currently version 14.0.1. Who has encountered this, please tell me how to solve this problem? Or is this a problem with the 14th version of Xcode itself ?
Posted Last updated
.