Posts

Post not yet marked as solved
0 Replies
266 Views
Hello I'm working on a SwiftUI map app and I'm having some issue with coordinates management. Here is the full explanation: My goal Having a Map view on a macOS app created with SwiftUI, which needs both a toolbar and a no status bar, I wants to be able to clic on the map to add an annotation at a user's chosen location. My issue The sample code I use works if I have no toolbar and status bar. When I have them, there is an offset in coordinates that I don't understand how to solve. Sample code Here is a code with the issue, if you run it you will see mis placed X marker. So, how can I fix the following sample code to have accurate management of the mouse location when adding an annotation in that context? import SwiftUI import MapKit struct MyPoint: Identifiable { var id = UUID() var name: String var location: CLLocationCoordinate2D } struct ContentView: View { @State var points: [MyPoint] = [MyPoint]() @State var status: String = "" var body: some View { VStack(spacing:0){ MapReader { mapReader in Map { ForEach(points) { point in Annotation(point.name, coordinate: point.location) { Text("╳") .font(.largeTitle) .bold(true) .foregroundStyle(.red) } } } .mapControlVisibility(.visible) .mapStyle(.imagery) .mapControls({ MapCompass() MapUserLocationButton() MapScaleView() }) .onContinuousHover(coordinateSpace: .local, perform: { phase in switch phase { case .active(let cGPoint): if let coordinates = mapReader.convert(cGPoint, from: .local) { status = "screen \(cGPoint.x), \(cGPoint.y) - loc \(coordinates.latitude), \(coordinates.longitude)" } else { status = "" } case .ended: status = "" } }) .onTapGesture(coordinateSpace: .local, perform: { screenCoord in if let location = mapReader.convert(screenCoord, from: .local) { points.append(.init(name: "screen click: \(screenCoord.x), \(screenCoord.y)\nloc \(location.latitude), \(location.longitude)", location: location)) } }) .toolbar { Text("A toolbar is needed") } } Text(status) .frame(maxWidth: .infinity) .background(.red) .foregroundColor(.white) } } }
Posted
by ygini.
Last updated
.
Post not yet marked as solved
1 Replies
624 Views
Hello I'm trying to make one of our internal app compliant with App Store rules for public release. The app is a custom Firefox launcher, that will be used to easily manage Firefox profile. Which mean part of the code will start Firefox with specifics args. And that's the part that does not fit well in the sandbox. What's the correct way to refactor the following code to be sandbox compatible?      let command = Process()     command.executableURL = URL(fileURLWithPath: "/usr/bin/open")     command.arguments = ["-n", "-a", "/Applications/Firefox.app", "--args", "--no-remote", "-P", name]     try? command.run() Right now with this code, Firefox open, but behave improperly, like if it was started from my own sandbox and could not load the selected profile. If I switch to NSWorkspace, the behavior is the same.
Posted
by ygini.
Last updated
.
Post not yet marked as solved
0 Replies
905 Views
Hello Now that macOS 11 and iOS 14 support PIN for FIDO2 token, would it be possible to allow it from WKWebView? We are using a native client for some federated services where we would like to allow end user to have the full password less experience with FIDO2 and token. As far as we seen with beta 1 it does not work out of box with WKWebView even if it does work with Safari. What should we do? Is it supported?
Posted
by ygini.
Last updated
.
Post not yet marked as solved
0 Replies
328 Views
Hello, I'm not sure if it's the right place to ask for that but how could we ask to have our DTK be added to our Apple Business Manager? Considering the change in the login process as well as the support for PIN with FIDO2 we would like to test our full deployment solution from the ground up: Setup Assistant with custom authentication using FIDO2 authentication as well as bootstrap package installed during deployment and run before and after first login. Thanks for your help
Posted
by ygini.
Last updated
.
Post not yet marked as solved
1 Replies
2.4k Views
Hello,I'm trying to craft a really specific beavior with SwiftUI: implementing a dynamic ordering of HStack/VStack.That's something really easy to do with UIKit but I can't figure out how I can do that with SwiftUI.The context is simple, I'm writing a navigation app for pilots, and the goal is to make the app usable with one hand in a bumpy environment. That mean fixed iPad on the dash, and all active conrols available from a unique lower corner (so the palm can be maintained by the corner itself).And the goal is to have one settings to set the app to be used from the lower left or right concern depending of the dash setup.Any idea how I can do that with SwiftUI?
Posted
by ygini.
Last updated
.
Post not yet marked as solved
0 Replies
402 Views
Hello,I'm trying to use Catalyst capabiities to run an iPad app on macOS 10.15 beta 19A526h and I get an issue with full screen support as well as window custom sizing.The app always keep the iOS ratio…Here is an example: https://i.postimg.cc/G2YjHYRk/Screenshot-2019-08-14-at-18-55-09-2.pngDo you've an idea why? I keep looking at the storyboard for specific constraints but I can't find anything.Thanks a lot
Posted
by ygini.
Last updated
.
Post not yet marked as solved
1 Replies
518 Views
Hello,Could you recommend me a good documentation to handle complex overlay shape with MapKit?I'm trying to draw airspace overley who can contain mix of lines and curves like that https://pbs.twimg.com/media/EBoPaiVXYAAygXW?format=jpg&name=largeIn the airspace definition I have geographic coordinates of the center of the circle, the radius, and the start and end point for the line.I don't really see how I can convert those data to an overlay shape.If you've recommended doc or sample code for such a scenario, I'm interested.Thanks
Posted
by ygini.
Last updated
.