Search results for

swiftui

16,625 results found

Post

Replies

Boosts

Views

Activity

Reply to Combine not working in background tasks on watchOS 26
Which BackgroundTask type are you using? The SwiftUI BackgroundTask API actually works by aggregating the behavior of a number of unrelated APIs, only some of which are public or fully supported on watchOS. That makes it very difficult to talk about it in a generic way. *It doesn't help that we've used the term background task for two OTHER APIs (UIApplication.beginBackgroundTask() and the BackgroundTask framework), both of which are significantly older than the SwiftUI API. __ Kevin Elliott DTS Engineer, CoreOS/Hardware
Oct ’25
Reply to How to print WKWebView in Sequoia?
I was just about to give up and tell you to create a demo project that just opened one web view and printed it. But I thought I should try that first myself. I did and also got 2 blank pages. There are lots and lots of possible options. But in this demo app, here is how I fixed it using a Swift Storyboard document-based app: In Xcode Interface Builder, find the print menu item. Change its sent action from print: to printDocument: in NSResponder. Observe that the app now prints correctly. I tried this with your sample and got 12 pages, including the last. Nothing seems to be missing except horizontal overview inside a div in the web view, but that's a different problem. I poked around for a bit. It looks like the old XIB templates in Xcode used printDocument: as the sent action. For some reason, in the newer Storyboard templates this was changed to just print:, which doesn't seem to work. No clue about SwiftUI. I have a newer app in Swift that isn't document-based. In this app, I seem to have already
Topic: Safari & Web SubTopic: General Tags:
Oct ’25
Reply to Resubmitting for Apple review
Welcome to the forum. getting past the demo login on my app. when I press enter demo or sign in Is it SwiftUI or UIKit app ? If UIKit, have you checked the buttons are properly connected to their IBAction ? If UIKit, please show the code of the buttons if SwiftUI please show the code of the view where they are defined. I can’t enter my app to see what’s wrong with it. What do you mean ? That you cannot test beyond this demo or sign in ? You give almost no information except declaring it does not work. How could someone help ? Please read this: https://developer.apple.com/forums/thread/706527 and complete your post accordingly.
Oct ’25
Reply to Weird transparency in sidebar in iPad app
Based on the docs this should be what I really want: https://developer.apple.com/documentation/swiftui/view/backgroundextensioneffect(isenabled:) It's supposed to disable the background, but it seems to not do anything at all. The code in the commented out region is still the only that works reliably. NavigationSplitView(sidebar: { sidebarView //.background { // Color.red // .edgesIgnoringSafeArea(.all) //} }, detail: { detailView .backgroundExtensionEffect(isEnabled: false) })
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’25
Manipulation stops working when changing rooms
This post documents an issue I reported in feedback FB19610114 and see if anyone knows of a workaround. Here is a copy of the feedback. Short version Manipulation (SwiftUI OR RealityKit) fails to translate entities after changing rooms. By changing rooms, I mean a human wearing an Apple Vision Pro leaving one room and entering another room. Once this issue occurs, it impacts all apps that use these features. A device restart is the only solution I have to fix it. Feedback FB19610114 This is an odd one. I'm using the new Manipulation Component in visionOS 26. Most of the time this works well. Sometime it stops working and when it does the only way to get it working again is to reboot the headset. When this happens, I can continue to rotate and scale items, but translation no longer works. It is as if the item is stuck to a fixed point in the parent scene (window, volume, etc). When this bug occurs, it affects every app across the entire operating system that is using manipulation, including the Realit
5
0
643
Oct ’25
AppLaunchTimeoutError
Hi. I tried to launch SwiftUI preview. But I got an error AppLaunchTimeoutError I attach the diagnostics. Does anyone know how to fix this problem? memo.txt
Topic: UI Frameworks SubTopic: SwiftUI
1
0
400
Oct ’25
Bug: SwiftUI inspector doesn't update presentation detent selection on iPhone
On iPhone .inspector is presented as a sheet so you can use .presentationDetents to determine its detents. However, SwiftUI doesn't update the presentationDetents selection binding in this case. See attached minimum example of the problem - onChange will not run and print when you swipe and change the detent of the inspector sheet. import SwiftUI @main struct TestingApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State var showInspector = false @State var detent: PresentationDetent = .medium var body: some View { Button(Toggle Inspector) { showInspector.toggle() } .inspector(isPresented: $showInspector) { Text(Inspector Content) .presentationDetents([.medium, .large], selection: $detent) } .onChange(of: detent) { _, detent in print(detent) } } } #Preview { ContentView() }
7
0
287
Oct ’25
NSHostingSceneRepresentation doesn't show Window(_:id:) and UtilityWindow(_:id:) with .openWIndow(id:)
NSHostingSceneRepresentation, introduced in macOS 26, allows calling SwiftUI’s windows and other elements set in a Scene from AppKit. However, while Settings and WindowGroup set in the Scene can be invoked as expected using environment.openSettings() and environment.openWindow(id:) respectively, calling Window or WindowUtility doesn’t work. That is, the app just fails to open the desired window with the provided ID, and no error message or other feedback/crash/freeze appears. I expect that executing the openUtilityWindow(_:)action in the following code will display the UtilityWindow set in the scene. However, the window does not actually open. @main final class AppDelegate: NSObject, NSApplicationDelegate { private let scene = NSHostingSceneRepresentation { UtilityWindow(Utility Window, id: UtilityWindow) { Text(Utility Window) .scenePadding() } } func applicationWillFinishLaunching(_ notification: Notification) { NSApp.addSceneRepresentation(self.scene) } @IBAction func openUtilityWindow(_ sender: A
1
0
182
Oct ’25
How Should a Beginner Properly Start iOS Development? Seeking Advice from Experienced Developers
Hello everyone, I'm a 2nd-year Computer Science student who's excited to dive into iOS development, and I'd really appreciate some guidance from the experienced developers in this community. MY CURRENT BACKGROUND I have a solid foundation in programming fundamentals through my university coursework (data structures, algorithms, OOP concepts), and I'm familiar with general software development principles. However, iOS development is entirely new territory for me, and I want to make sure I start on the right foot. WHAT I'M LOOKING TO UNDERSTAND Learning Path & Technologies Should I start with UIKit or SwiftUI? I've heard conflicting opinions about this How important is it to learn Objective-C in 2025, or should I focus solely on Swift? Are there any foundational Apple frameworks I should prioritize learning early on? Roadmap & Structured Learning Is there a recommended roadmap or learning sequence I should follow? What skills/topics should I master before moving to more advanced concepts? Shoul
3
0
254
Oct ’25
Reply to How Should a Beginner Properly Start iOS Development? Seeking Advice from Experienced Developers
You're not the first to ask such question. Answer here may help you: https://developer.apple.com/forums/thread/797977?answerId=855247022#855247022 With all the things you want to learn, that may take you more than 6 months full time to learn and master. So you should focus first on learning basics, like using Xcode (of course), Swift language and the basics of SwiftUI and UIKit. Good material in https://developer.apple.com/pathways/.
Oct ’25
Reply to How Should a Beginner Properly Start iOS Development? Seeking Advice from Experienced Developers
I can tell you how I got into iOS development and try to answer some of your questions. I started by trying to find tutorials online, but the ones I found were either too simple or did not explain anything properly. I even bought a course at Udemy but that course also did not go into the details as much as I had hoped. I finally stumbled upon the iOS course at Stanford: https://cs193p.stanford.edu Back then it was available at iTunes U (which does not exist anymore), and included the lecture videos and the course work. I watched all the videos and, crucially, did all the course work. Doing the exercises was really essential because when you listen to the lectures it all sounds easy but when you try to do it yourself it's not so easy 😄 That course was exactly what I needed: it did not require any prior knowledge except for general programming, went into the details but explained everything. Definitely can recommend it if the videos are still made available, you will have to check. To your questions: Should I
Oct ’25
SwiftUI issue with onTap using Map using IOS 26
I have a sample that stop working on IOS 26, using the latest XCode and IOS sdk, the onTapGesture event is no longer happening. Maybe this is no longer the way to drop pins on the map. Also not working on the iPhone 17 sim or iPhone 16 max pro device upgrading to IOS 26 Thanks, any help Sample: import SwiftUI import MapKit import CoreLocation import Foundation struct Pin: Identifiable { let id = UUID() let coordinate: CLLocationCoordinate2D } struct ContentTestPinDropView: View { @State private var pins: [Pin] = [] var body: some View { MapReader { reader in Map(selection: .constant(nil)) { ForEach(pins) { pin in Marker(Pin, coordinate: pin.coordinate) } } .onTapGesture { screenPoint in if let coordinate = reader.convert(screenPoint, from: .local) { pins.append(Pin(coordinate: coordinate)) } } } } }
2
0
213
Oct ’25
Reply to What is the future of Objective-C?
Well Apple has pretty much dropped Objective-C and moved fully to Swift and SwiftUI becuase its faster and better to use. Worth learning it though. Interesting claims. When you say faster are you talking about performance or the speed in which you scratch your code? While it's obvious Apple is recommending Swift all the new AppKit API I'm aware of (or at least care about) for macOS 26.0 is available to Objective-C and I'm grateful or that. And how do you define better to use? Do you think the compiler gives better/more descriptive warning/error fixes in Swift than Objective-C? What about viewing variables in the debugger? What about compiler speed? I will continue to use Objective-C until I can't. My policy is currently this: -Any Swift only frameworks that are required (like Storekit2) must be wrapped inside its own framework or library. -All Swift code must be private API. All public API is Objective-C. -Main project remains Objective-C and continues on like Swift doesn't exist. Do I recommend this
Topic: Programming Languages SubTopic: General Tags:
Oct ’25