Post

Replies

Boosts

Views

Activity

Reply to How do I display a value in a label (the value keeps changing/updating)
@claude31 I feel like the problem is not knowing where I should insert your code, so here is my entire code, and you determine which line I should put your code at (this is in the viewController btw): import MapKit import UIKit import CoreLocation import UserNotifications class ViewController: UIViewController, CLLocationManagerDelegate {     @IBOutlet var mapView: MKMapView!     let manager = CLLocationManager()     override func viewDidLoad() {         super.viewDidLoad()         // Do any additional setup after loading the view.     }     override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated)         manager.desiredAccuracy = kCLLocationAccuracyBest         manager.delegate = self         manager.requestWhenInUseAuthorization()         manager.startUpdatingLocation()     }     func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {         if let location = locations.first{             manager.stopUpdatingLocation()             render(location)         }         func render(_ location: CLLocation){             let coordinate = CLLocationCoordinate2D(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude)             let span = MKCoordinateSpan (latitudeDelta: 0.1, longitudeDelta: 0.1)             let region = MKCoordinateRegion(center: coordinate, span: span)             mapView.setRegion(region, animated: true)             mapView.showsUserLocation = true             let pin = MKPointAnnotation()             pin.coordinate = coordinate             pin.title = "your home"             pin.subtitle = "Location"             mapView.addAnnotation(pin)             func userDistance(from point: MKPointAnnotation) -> Double? {                 guard let userLocation = mapView.userLocation.location else {                     return nil // User location unknown!                 }                 let pointLocation = CLLocation(                     latitude:  point.coordinate.latitude,                     longitude: point.coordinate.longitude                 )                 //hello                                  var value = userLocation.distance(from: pointLocation)                 return value             }         }     }     @IBAction func Button(_ sender: UIButton) {         UIApplication.shared.open(URL(string: "https://www.gps-coordinates.net")! as URL, options: [:], completionHandler: nil)     } }
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to How to fix languages in App Store
Excuse me sir. I am struggling and I would really appreciate a reply @Developer Tools Engineer My app goes off of pre-order in 7 hours, and I have no idea if this is going to work or not.
Replies
Boosts
Views
Activity
Aug ’24
Reply to How to fix languages in App Store
this is what I have right now
Replies
Boosts
Views
Activity
Aug ’24
Reply to Please help me with error object cannot be nil (key: kCLConnectionMessageNameKey)"
Hi eskimo! I actually fixed the error by using breapoints. Here's how I did it: First I went to the breakpoint menu and clicked add, then I added an exception break point and other stuff. i easily located the issue after that
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to HELP ME ASAP
yeah, autocorrect deleted it
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Security input before you can put your iPhone off
Ok, first of all, that's the dumbest idea on the planet. Had your daughter been more responsible and kept the phone in her pocket instead, this wouldn't have happened. Next, you should have probably enabled two-step verification on her iCloud account, so the guy who stole it couldn't have got in.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Why are there two iPhones showing up in my Xcode simulator?
I don't really understand what you are saying, but I think if you just close one of the simulators, the problem should be solved. If that doesn't solve it, please send a screenshot.
Replies
Boosts
Views
Activity
Jul ’21
Reply to Remove IPAD screenshot option
How do I update ONLY IPHONE screenshot instead of need to update IPAD screenshot as well? I don't understand the question, could you please be more specific on what your app is trying to do?
Replies
Boosts
Views
Activity
Jul ’21
Reply to How do I display a value in a label (the value keeps changing/updating)
@Claude31, the button in this project has nothing to do with the label I made displaying the live distance from a pinned spot. And in your code, the label doesn't show anything, so please tell me how to fix this
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to How do I display a value in a label (the value keeps changing/updating)
@claude31 I feel like the problem is not knowing where I should insert your code, so here is my entire code, and you determine which line I should put your code at (this is in the viewController btw): import MapKit import UIKit import CoreLocation import UserNotifications class ViewController: UIViewController, CLLocationManagerDelegate {     @IBOutlet var mapView: MKMapView!     let manager = CLLocationManager()     override func viewDidLoad() {         super.viewDidLoad()         // Do any additional setup after loading the view.     }     override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated)         manager.desiredAccuracy = kCLLocationAccuracyBest         manager.delegate = self         manager.requestWhenInUseAuthorization()         manager.startUpdatingLocation()     }     func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {         if let location = locations.first{             manager.stopUpdatingLocation()             render(location)         }         func render(_ location: CLLocation){             let coordinate = CLLocationCoordinate2D(latitude: location.coordinate.latitude, longitude: location.coordinate.longitude)             let span = MKCoordinateSpan (latitudeDelta: 0.1, longitudeDelta: 0.1)             let region = MKCoordinateRegion(center: coordinate, span: span)             mapView.setRegion(region, animated: true)             mapView.showsUserLocation = true             let pin = MKPointAnnotation()             pin.coordinate = coordinate             pin.title = "your home"             pin.subtitle = "Location"             mapView.addAnnotation(pin)             func userDistance(from point: MKPointAnnotation) -> Double? {                 guard let userLocation = mapView.userLocation.location else {                     return nil // User location unknown!                 }                 let pointLocation = CLLocation(                     latitude:  point.coordinate.latitude,                     longitude: point.coordinate.longitude                 )                 //hello                                  var value = userLocation.distance(from: pointLocation)                 return value             }         }     }     @IBAction func Button(_ sender: UIButton) {         UIApplication.shared.open(URL(string: "https://www.gps-coordinates.net")! as URL, options: [:], completionHandler: nil)     } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’21