Post

Replies

Boosts

Views

Activity

Reply to Taking user input in MapKit
You have not said what platform you are developing for, but let's assume iOS (or iPadOS, but the same principles apply to macOS). If you are serious about using MapKit, and want to go beyond very basic mapping functions... ...then handle your map using UIKit, not SwiftUI. Mapping in SwiftUI is still lacking a lot of features which you may need, and if you start off using SwiftUI, then run into it's limits, you may have to begin again. I love SwiftUI, but it's mapping is too weak. On macOS I use Cocoa (NSViewController) for maps, wrapped in an NSViewControllerRepresentable. I found problems when using NSViewRepresentable, so I don't use that. (On iOS, the equivalent to NSViewControllerRepresentable is UIViewControllerRepresentable.) If anyone disagrees with this, then I would love to hear their better solutions!
Dec ’21
Reply to iOS Simulator Download
From Xcode: Window > Devices and Simulators > Simulators On the left is a list of installed Simulators Each Simulator can be marked as "Show as run destination" At the bottom-left is a "+" icon, to add new simulators Simulator name Device Type OS Version OS Version > Download more simulator runtimes... I see available Simulators going back to iOS 11.4 Having said all that, my most recent Simulator is iOS 15.0, so perhaps that's all we get in XCode 13.1 (13A1030d)?
Dec ’21
Reply to Bluetooth Explorer Crashes when Scanning for BLE devices
What is "Bluetooth Explorer"? Where did you get it from? What device are you running it on (iPhone, iPad, Mac...)? Is it perhaps the macOS app, "Bluetooth Explorer", from the Mac App Store... ...the one whose first two reviews say: "Terrible - I want my money back" "Terrible doesnt do anything" ...and then ten more bad reviews Is it that? If so, I suggest that you contact the app developer, Chris Vallis, via their link on the App Store, and raise your problem with them. Be careful though, because the "Support" links uses insecure http, and looks dodgy.
Dec ’21
Reply to Using NSUserName & NSFullUserName return Mobile and Mobile User
The behavior of NSUserName and NSFullUserName are platform-specific, as they return the details of the logged-in user. On macOS, where the user logs in, they behave as expected. On iOS, there is no login, so there is no logged-in user (so no user name). On iOS, there is no publicly-available API to return the user name. You will have to ask the user to input their name.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Tracking different videos on multiple Images
At a first glance, you are force-unwrapping "shot1" and "shot2", which is dangerous. You should check that they are non-nil, before using them. And perhaps add some simple error-logging, like this: if imageAnchor.referenceImage.name == "shot1Image" { if let shot1 = planeNode.childNode(withName: "shot1", recursively: false) { shot1.geometry?.firstMaterial?.diffuse.contents = videoScene1 videoNode1.play() } else { print("Error: couldn't get shot1") } } else { if let shot2 = planeNode.childNode(withName: "shot2", recursively: false) { shot2.geometry?.firstMaterial?.diffuse.contents = videoScene2 videoNode2.play() } else { print("Error: couldn't get shot1") } } Then if it turns out that shot1 or shot2 are nil, you need to figure out why.
Topic: Spatial Computing SubTopic: ARKit Tags:
Dec ’21
Reply to HStack Alignments
It would be better if you also supplied a screenshot, and explained how it is different to what you expect. The HStacks are aligned to the center. How is this different to what you are expecting? Extra padding on which view, in which direction? Bonus tip: To see the view sizes, before and after padding, try: .background(Color.yellow) .padding() .background(Color.green)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Xcode runs app show blank screen
Launch.storyboard Should definitely not be your Initial View Controller This is shown very briefly on app launch, while the app's initial view is prepared Table View Controller In Main.Storyboard, this is your Initial View Controller If it is showing as a blank screen, then that is down to your code e.g. the Table View has no rows, or the row content is empty If you share the code for your Table View Controller, it should be possible to see the problem.
Dec ’21