Post

Replies

Boosts

Views

Activity

I don't see TestFlight build in Appstore Connect
Hi, I managed to successfully distribute app on appstoreconnect, but I doesn't see that build under TestFlight builds. I'm using XCode Version 15.0 (15A240d). What can be the problem, I tried to change version from 1.3.1. to 1.3.2. for the first load of appstoreconnect I was able to see 1.3.2. section, but not build, after reloading that 1.3.2. section disappeared.
8
5
2.1k
Sep ’23
Update polyline when user change current location
I created a map that show routes and directions from current location to the destination, I want to achieve following: I want to always change beginning of polyline on the current location, I want to always recalculate if user lost their first path. This is my code: struct MapView: UIViewRepresentable { typealias UIViewType = MKMapView @Binding var directions: [String] func makeCoordinator() -> MapViewCoordinator { return MapViewCoordinator() } func makeUIView(context: Context) -> MKMapView { let mapView = MKMapView() mapView.delegate = context.coordinator mapView.showsUserLocation = true let region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 43.58393, longitude: 19.52201), span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01)) mapView.setRegion(region, animated: true) let locationManager = CLLocationManager() locationManager.requestWhenInUseAuthorization() if CLLocationManager.locationServicesEnabled() { locationManager.delegate = context.coordinator locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.startUpdatingLocation() } // Prijepolje let p2 = MKPlacemark(coordinate: CLLocationCoordinate2D(latitude: 43.000000, longitude: -75.000000)) let request = MKDirections.Request() request.source = MKMapItem.forCurrentLocation() request.destination = MKMapItem(placemark: p2) request.transportType = .automobile let directions = MKDirections(request: request) directions.calculate { response, error in guard let route = response?.routes.first else { return } mapView.addAnnotations([p2]) mapView.addOverlay(route.polyline) mapView.setVisibleMapRect(route.polyline.boundingMapRect, edgePadding: UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20), animated: true) self.directions = route.steps.map { $0.instructions }.filter { !$0.isEmpty } } return mapView } func updateUIView(_ uiView: MKMapView, context: Context) { } class MapViewCoordinator: NSObject, MKMapViewDelegate, CLLocationManagerDelegate { func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer { let renderer = MKPolylineRenderer(overlay: overlay) renderer.strokeColor = .blue renderer.lineWidth = 5 return renderer } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { if let location = locations.last { // Do something with the updated location if needed } } } } This is my current behaviour I'm using Xcode 14.2, and iPhone 11.
2
0
659
Jul ’23
Print amount from single member instance on dynamic view
Hi, I am new here, and I hope that you guys will help me to find solution. What I need: I have SingleMember View, which containt just @State var text: String = "" TextField("Amount", text:$text) I` have MainView which contains VStack{ ForEach(0..<3) { SingleMember() } Button("Print all values"){ //action } } What should I insert in button to get all three amount values?
2
0
480
Jun ’23