Post

Replies

Boosts

Views

Activity

Reply to iPad app now crashing on Mac. layoutSubtreeIfNeeded ?
I found the issues adding .alert(isPresented: $showAlert) { Alert( causes the app to crash when running on Mac Emulator for iPad everything worked fine until I copied that piece of code over from my project. struct ContentView: View { var body: some View { NavigationStack(path: $path) { ZStack(alignment: .bottom) { HStack { TabView( selection: $currentTab.onUpdate {} ) { FriendsView() .tabItem { Label("Follow", systemImage: "person.3.fill") } .tag(TabPages.FriendTab) .buttonStyle(.plain) } } VStack { Spacer().frame(minHeight: UIScreen.main.bounds.size.height * 0.70) Text("Test") Spacer().frame(minHeight: UIScreen.main.bounds.size.height * 0.15) } } } .toolbar(.hidden) // // The Alert Will cause a crash on Mac emulator // .alert(isPresented: $showAlert) { Alert( title: Text("Problem"), message: Text(badMessage), dismissButton: .default(Text("Dismiss"), action: { fatalError("An error occurred. Exiting the app.") }) ) }
2w
Reply to How can I get the current screen orientation?
Not sure this is what you want, maybe it can help private func setupOrientationNotification() { cancellableOrientation = NotificationCenter.default .publisher(for: UIDevice.orientationDidChangeNotification) .compactMap { _ in UIDevice.current.orientation } .sink { newOrientation in if newOrientation == .faceUp || newOrientation == .faceDown { // do nothing } else { self.orientation = newOrientation orientation = newOrientation } } } private var cancellableOrientation: AnyCancellable? = nil @Published var orientation I wrote (copied) this months ago, don't ask me to explain it.
3w
Reply to App crashes at launch on missing symbol AVPlayerView... except on first launch
I just had the exact same problem. I have not tried to run my iPhone App on the Mac for a month, but today I tried to for testing and it failed. It worked fine a month ago. In the last month I have updated the Mac OS to 15.1.1 (24B91) and I am using XCode Version 16.1 (16B40) deployment target is IOS 17.1 The iPhone has the latest Beta OS installed, but I am not using any new API in my code. I am not using any video players in my app. dyld[83622]: Symbol not found: OBJC_CLASS$_AVPlayerView Referenced from: <7D70BC8F-8276-33E5-964D-86BD04CC082F> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport.dylib Expected in: /System/iOSSupport/System/Library/Frameworks/AVKit.framework/Versions/A/AVKit Type: stdio Any help would be appreciated. I don't even know where to begin to debug/fix this
3w