I would like to modify the content of a published LocationNode upon been clicked by the user. But unfortunately:
func hitTest(_ point: CGPoint, options: [SCNHitTestOption : Any]? = nil) -> [SCNHitTestResult]
returns an SCNNode array from which it is impossible to retrieve the original LocationNode being inserted in order to be able to modify it.
Of course the solution would be to either insert the SCNNode corresponding to the inserted LocationNode in a custom class or conversely insert the identifier of the custom object as a tag of the LocationNode, in order to solve the issue. But both options seem impossible to implement.
May anyone help me?
Explore the art and science of app design. Discuss user interface (UI) design principles, user experience (UX) best practices, and share design resources and inspiration.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Below is the sample css code where I render a web page in my webview screens fonts became too small after 18.4 and its so hard to read when I launch my app . Any workarounds to address this issue
.sg-labels-canvas {
font-size: 15px;
display: flex;
flex-direction: column;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Roboto, sans-serif;
font-style: normal;
}
support destinations have no Apple Watch, I tried delete the watch App target and recreate watch App for Existing app, but if is unuseful
Hi,
I have a view that should do the following:
Set up and confirm a passcode upon account creation.
Verify passcode if signing in.
Reset passcode if prompted.
With the code below, functions 1 and 2 are working. However, I'm having an issue with function 3. I am able to declare the reset UserDefault on a previous view so that the proper logic occurs, which is to read in the input, and then confirm it. However, it is not working as intended. In this code here:
else if reset {
UserDefaults.standard.set(passcode, forKey: "new-passcode")
UserDefaults.standard.set(false, forKey: "reset-passcode")
passcode = ""
}
I store the new passcode, set reset to false, and clear the passcode so it can be entered again to confirm. The code does not run as intended however. The title does not change and I'm unsure if it is actually storing the passcode. And, when re-entering, it does not change the view as it should by setting view = .someView. I'm assuming there is just flaw in my logic but I'm not sure how to resolve this. Below is the full code. Please let me know if any further clarification is needed.
struct EnterPasscode: View {
@State var title = ""
@State var passcode = ""
@State var message = ""
@State var buttonState = false
@Binding var view: Views
var body: some View {
Group {
Spacer()
.frame(height: 50)
Text(title)
.font(.system(size: 36))
.multilineTextAlignment(.center)
.frame(height: 50)
Spacer()
if passcode != "" {
Text("\(passcode)")
.font(.system(size: 24))
.frame(height: 25)
} else {
Spacer()
.frame(height: 25)
}
Spacer()
.frame(height: 50)
PasscodeKeypad(passcode: $passcode)
Spacer()
if message != "" {
Text(message)
.frame(height: 25)
.foregroundStyle(Color.red)
} else {
Spacer()
.frame(height: 25)
}
Spacer()
WideButton(text: "Continue", buttonFunction: .functional, openView: .enterPasscode, view: .constant(.enterPasscode), buttonState: $buttonState)
.onChange(of: buttonState) { oldState, newState in
if buttonState {
let passcodeSet = UserDefaults.standard.bool(forKey: "passcode-set")
let storedPasscode = UserDefaults.standard.string(forKey: "passcode")
let reset = UserDefaults.standard.bool(forKey: "passcode-reset")
let newPasscode = UserDefaults.standard.string(forKey: "new-passcode")
print(reset)
if passcode.count == 4 {
if storedPasscode == nil {
if newPasscode == nil {
UserDefaults.standard.set(passcode, forKey: "new-passcode")
passcode = ""
} else if passcode == newPasscode {
UserDefaults.standard.set(passcode, forKey: "passcode")
UserDefaults.standard.set(true, forKey: "passcode-set")
view = .someView
}
} else if reset {
UserDefaults.standard.set(passcode, forKey: "new-passcode")
UserDefaults.standard.set(false, forKey: "reset-passcode")
passcode = ""
} else if newPasscode != nil {
if passcode == newPasscode {
UserDefaults.standard.set(passcode, forKey: "passcode")
view = .someView
}
}
}
checkPasscodeStatus()
buttonState = false
}
}
Spacer()
if !UserDefaults.standard.bool(forKey: "passcode-reset") && UserDefaults.standard.bool(forKey: "passcode-set") {
Button(action: {
view = .verifyPhone
}) {
Text("Forgot passcode?")
.foregroundStyle(.black)
}
}
Spacer()
.frame(height: 25)
}
.onAppear() {
checkPasscodeStatus()
}
.frame(width: UIScreen.main.bounds.width - 50)
}
func checkPasscodeStatus() {
let passcodeSet = UserDefaults.standard.bool(forKey: "passcode-set")
let storedPasscode = UserDefaults.standard.string(forKey: "passcode")
let reset = UserDefaults.standard.bool(forKey: "passcode-reset")
if reset {
title = "Enter new passcode"
} else if passcodeSet {
title = "Enter Passcode"
} else if storedPasscode != nil && storedPasscode != "" {
title = "Confirm Passcode"
} else {
title = "Select a 4 Digit Passcode"
}
}
}
struct WideButton: View {
@State var text: String
@State var buttonFunction: ButtonType
@State var openView: Views?
@Binding var view: Views
@Binding var buttonState: Bool
var body: some View {
Button(action: {
buttonPressed()
}, label: {
ZStack {
RoundedRectangle(cornerRadius: 5)
.fill(Color.black)
.frame(width: UIScreen.main.bounds.width - 50, height: 50)
Text(text)
.foregroundColor(.white)
}
})
}
func buttonPressed() {
switch buttonFunction {
case .openView: view = openView!
case .functional: buttonState = true
}
}
}
enum ButtonType {
case openView
case functional
}
So…I am hitting a wall here and could use some guidance towards best practice.
I’ve developed an app in Xcode/SwiftUI that renders just fine on the iPhone - text, images, buttons, frames…everything is nicely centered on the screen or scrolls where and when I want.
The iPad though…not so much. I’m having issues with tops and bottoms being cut off in scrollviews. These are just straight up text screens too - the ones with other elements/controls…they’re rendering fine.
I’ve tried a mix of geometry, vstack, scrollview, padding, spacers…the lot of it. Nothing I seem to do works - the views do not want to fill and fit properly.
And, of course, the issue becomes worse the moment you flip the iPad into landscape view. Or use the 13” models.
I’d imagine others are battling these issues as well and found solutions, so I decided to hit up the brain trust.
When we are going to have a real analog clock option on the lock screen. If an apple watch can do it surely its not that difficult. For someone who uses a clock to tell what time it isn't as opposed to what time it is, i’m constantly having to convert a digital image where the image of hands on a dial is so much easier. Surely this isnt because someone has forgotten how to read a clock
In Carplay, is it possible to update the navigation title and also add right tab bar items? Couldn't find these details in the documentation. Please suggest
I am an iOS app developer and I have a question regarding the implementation of an exit button in an iOS app. I remember reading in the past that Apple does not recommend this practice, but I couldn’t find any explicit policy on this matter in the current Human Interface Guidelines.
Could you please clarify whether it is acceptable to implement an exit button in an iOS app according to the latest guidelines? Any references or official documentation would be greatly appreciated.
Hi,
I would like to make an educational app for helping my students to learn about malaria diagnosis and need to put some animal icon.
In the tabview, is it possible to use system images like monkey, bird, mouse. I cannot see these animals in SF symbol list.
Hello there,
I have a couple of question about Apple Pay guidelines:
• if we offer Apple Pay payment method in our app, can we disable the selection (I mean the method selection NOT the Payment button!) IF certain condition happens? E.g. the user cannot select apple pay payment method because our basket is not ready yet.
• Are we forced to move the apple pay payment method on the top of our selection? E.g. Cards, Cash On Delivery, Coupon, Apple Pay --> Apple Pay, Cards, Cash On Delivery, Coupon
One last technical question:
• when we start the payment process we are gonna create the request and present the sheet BUT we have to call our backend for pre-authorization, is it allowed?
@objc private func applePayButtonTapped(sender: UIButton) {
// TODO: Is it allowed?
// We need to ask to our backend a pre-authorization and THEN procced with Apple Pay flow
// but this could be done ONLY after the user TAP on BUY with APPLE PAY and BEFORE
// paymentAuthorizationViewController is called.
// Are we compliant to do that?
if PKPaymentAuthorizationViewController.canMakePayments(usingNetworks: FakeData.paymentInfo()) {
let request = PKPaymentRequest()
request.blablabla = blabla
let authorizationViewController = PKPaymentAuthorizationViewController(paymentRequest: request)
if let viewController = authorizationViewController {
viewController.delegate = self
present(viewController, animated: true, completion: nil)
}
}
}
Thanks in advance :)
When I create a tab group for the sidebar on iPad, the title and disclosure triangle act like a single control. Every time I tap the section title, the disclosure triangle for that section activates and hides or exposes that section's children and actions.
I want the section title to behave like Photos, where tapping a section title just displays its view controller, and the disclosure triangle is a separate control that must be tapped to hide and show children and actions.
I did not see any delegate methods that would let me control this behavior. Is this supported?
Hi there,
I'm working on a product which needs to pair with an iOS device (only iPad and iPhone) via Bluetooth. I already have the device pairing and operating fully with android or Windows hosts and have implemented BLE. Obviously, iOS isn't as simple as those for pairing. The product type is not listed under the MFi accessories.
The question I have is what hardware and or firmware needs does the product needs to fulfil in order to pair/bond fully. I've seen some devices have a MFi security chip, some need to be manufactured in a MFi approved facility, I've no idea on the firmware requirements. We're starting the process of joining the MFi program too. So:
Do I need the security chip?
Where is the pairing process documented?
Can I use BLE or do I need to use classic Bluetooth or core Bluetooth?
Any help would be greatly appreciated because I'm kind of lost.
Thanks, Louis
My application suddenly started crashing on launch when I target "My Mac - designed for iPad." But only after the first build from scratch, which runs once. All subsequent runs crash with:
dyld[90869]: Symbol not found: _OBJC_CLASS_$_AVPlayerView
Referenced from: <D566512D-CAB4-3EA6-9B87-DBD15C6E71B3> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport.dylib
Expected in: <4C34313C-03AD-32EB-8722-8A77C64AB959> /System/iOSSupport/System/Library/Frameworks/AVKit.framework/Versions/A/AVKit
I don't use AVPlayerView anywhere in my application. A file-contents search of the entire source tree doesn't turn it up either. The application doesn't even get to the point of instantiating the app object, so none of my code is involved.
If I switch the target to my iPhone, it will build and run repeatedly. If I then switch back to "My Mac," it will build and run once... and then crash every time.
Further research shows that this only happens in Debug builds.
This is a major issue right now because iOS 18 broke authentication certificates (thus HTTPS), so anyone writing or debugging an app that needs network functionality must use HTTP on localhost. In my case, I'm dead in the water because I can't debug on my local machine.
Has anyone seen something like this before? I can find no reference to anything like it.
Will the draw (animation) functionality of SF Symbols be available when symbols are cut/pasted into a Keynote presentation? Better yet, will the draw tools from SF Symbols 7 be available in Keynote for objects created in Keynote?
Hi all — I wanted to share an idea I recently submitted through Feedback Assistant that I think could improve safety and usability for drivers using CarPlay:
Add an option to overlay live weather radar (rain, snow, storms, etc.) directly onto CarPlay Maps while navigating. Similar to how traffic conditions are shown now, this would allow drivers to visually track incoming weather in real time without switching apps or relying on separate devices.
Why this matters:
• Enhances driver safety by increasing situational awareness
• Helps with trip planning and route adjustments around severe weather
• Reduces distractions by integrating everything into one screen
• Useful for everyday drivers, long-haul travelers, and first responders
I submitted this via Feedback Assistant, but I’d love to know what others think. If you also see value in this feature, consider submitting your own version via Feedback Assistant so Apple sees there’s interest.
Let’s push for smarter, safer navigation — thanks for reading!
Bonjour,
Je me permet d'écrire un message car je rencontre un souci avec la vue canvas j'ai le message d'erreur suivant " CrashReportError: XCPreviewAgent crashed because Adjust.framework is missing" je ne sais pas trop comment identifié le problème j'utilise pod
En vous remerciant par avance
Hi, I'm trying to create a visualization using charts for vision pro. I want to create a line chart that connects pair of points on a donut chart. So i'm trying to draw the lines radially but it seems that the line chart always has only the bottom left corner of the view as origin. How can I tranform the origin to center of the view?
hi, i have an objc ipad application that use xib with zooming for adapt to the screen (until ios18) but with ipad os 26 will be displayed wrong
Hi there
I have developed an offline algorithm for calculating tides, which works based on the built-in database of tidal stations in some regions. The algorithm works correctly and the results match the real data.
I would like to receive and add moon data from Weather Kit to the algorithm for performance improvement experiments. What requirements do I need to apply to the application so that I can use data from Weather Kit in my algorithm ?