How to Show User's Location - Swift 4.2 - Xcode 10

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024
  • This is part 1 of a 3 part series on MapKit. In this first tutorial we'll walk through getting location permissions, showing the users location on a MapKit view, and updating that user's location as they move. This tutorial is in Xcode 10 (beta) and Swift 4.2.
    Part 2 will be about reverse geocoding an address and part 3 will be getting directions from the users location to that address.
    Source Code:
    www.dropbox.co...
    iOS Dev Courses:
    seanallen.teac...
    Twitter:
    Sean Allen - / seanallen_dev
    Hired.com:
    hired.com/x/1n01g
    Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
    Paul Hudson's Hacking With Swift:
    gumroad.com/a/...
    Donny Wals - Combine:
    gumroad.com/a/...
    Mark Moeyken’s SwiftUI Books:
    www.bigmountainstudio.com/swiftui-views-book/fzc51
    Objc.io Books (Thinking in SwiftUI & Advanced Swift):
    gumroad.com/a/...
    Ray Wenderlich Books:
    store.raywende...
    #swift #softwaredeveloper #iosdeveloper

Комментарии • 310

  • @seanallen
    @seanallen  4 года назад +4

    Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - ruclips.net/video/MSIe2y6Fee8/видео.html

  • @hoxorious
    @hoxorious 5 лет назад +2

    I have recently got a MacBook Pro for iOS development and I was worried about a good tutorial. But now that I found your videos, I'm so happy that I can learn what I need painlessly.
    Thanks for your awesome contents! ❤✌👍

  • @Felip38rito
    @Felip38rito 4 года назад +1

    Amazing tutorial! 2 years after and I'm back here to learn how to use the mapkit for an app I'm working in. Thank you Sean! :D

    • @seanallen
      @seanallen  4 года назад

      It's the gift that keeps on giving 😀

  • @MortalKombatant
    @MortalKombatant 6 лет назад +19

    The best and fastest man to teach the ios

    • @seanallen
      @seanallen  6 лет назад +1

      Thanks for the kind words 👍

  • @NPCTE23
    @NPCTE23 6 лет назад +2

    I’ve been wondering for the past 3 days about learning more about MapKit and here you are with a video!!! 😭

  • @Jay-sq1gi
    @Jay-sq1gi 4 года назад +2

    extremely simple and not overly complicated, thank you, good sir. I have been looking for someone to explain it like you have and man you saved me hours!

  • @daveborchard2019
    @daveborchard2019 5 лет назад +3

    Thanks for creating the tutorial! I’m a beginner, so I’m not ready for that level tutorial yet. But it does give me a sense of how things are done with more complex programming in my future.
    Have you considered creating a low cost course for beginners to teach them the best way to do iOS programming in your opinion? If you already have a low cost beginner swift programming course, please let me know whee to find it.
    You have an interesting life story about how you invested in yourself to learn iOS programming to improve your future. You not only improved your own future, but now you have the ability to improve other people’s futures, by sharing your knowledge!

    • @seanallen
      @seanallen  5 лет назад +3

      Happy to hear you found some value in the video, even though you weren't quite ready for it yet. I will be releasing a course in 2019, so stay tuned. Working on it after the holidays.

  • @decreer4567
    @decreer4567 6 лет назад +1

    Right when I needed to learn about this API to make a project to show off for an internship, you posted this. Thanks a ton man.

    • @seanallen
      @seanallen  6 лет назад +1

      Great timing! Happy to hear it helped 👍

  • @TheFirzoknadeem1
    @TheFirzoknadeem1 4 года назад +1

    I've seen a lot of tutorials on iOS but Sean is the best one out there. Thank you!

    • @seanallen
      @seanallen  4 года назад +1

      Thanks Firzok! Glad you liked it 😀

  • @jaewooko4527
    @jaewooko4527 5 лет назад +1

    Thanks for great tutorial. I am trying to restart my coding at age of 45.. This is great encouragement for my professional hobby..

    • @seanallen
      @seanallen  5 лет назад

      That's awesome to hear. I didn't start my coding career till i was 33. Best of luck!

  • @MrHSIE
    @MrHSIE 5 лет назад +2

    Very interesting Sean. Thanks for a comprehensive explanation.
    I am very very new to this and to see functions and rules being explained so clearly and with some common sence, syntax explanations made understanding Swift protocols so much easier to grasp.

    • @seanallen
      @seanallen  5 лет назад

      Happy to help Steve! Glad you enjoy my teaching style. 😀

  • @kokodoug90
    @kokodoug90 5 лет назад +2

    Love the way you explain it. Will watch more of your videos for sure!

  • @marmercadal6832
    @marmercadal6832 5 лет назад +1

    I would like to say that was a Very informal lesson. I was fully engaged in the lesson and walked away with all the necessary information plus Some. Keep up the awesome work!

    • @seanallen
      @seanallen  5 лет назад

      Glad you liked it, Mar! I have a bunch more videos that are very similar 😀

  • @AiSoftwareSolutions
    @AiSoftwareSolutions 4 года назад +1

    Dude you are the bomb! Thank you so much for the knowledge!! Better than any university class I could take!! The learning never ends.

    • @seanallen
      @seanallen  4 года назад

      Happy to help, Kyle!

  • @ShankarKumar-iw2to
    @ShankarKumar-iw2to 6 лет назад +1

    Just awesome as always, excited for next parts to come

    • @seanallen
      @seanallen  6 лет назад

      Thanks Shankar👍. Stay tuned.

  • @shingetzu88
    @shingetzu88 6 лет назад +1

    Short and sweet. Thanks Sean!!! This was a good refresher and some new ways (for me) of doing some stuff (checkLocationAuthorization). Can I request that you include searching for nearby places (cafe, restaurant, shops, etc) in the 2nd or 3rd part of the series? Thank you.

    • @seanallen
      @seanallen  6 лет назад +1

      I've already got most of parts 2 and 3 built out. Maybe that could be a part 4

  • @daviddevlin7321
    @daviddevlin7321 4 года назад

    Absolutely Brilliant! Great pace, no lost time, very thorough with code that works! Thank you!

  • @Omeir34
    @Omeir34 6 лет назад +1

    Great explanation as always Sean. Its been a long time since a tutorial.

    • @seanallen
      @seanallen  6 лет назад +1

      Thanks Omair. Trying to get back to doing more tutorials. Just gotta find the time.

  • @kingchavez152
    @kingchavez152 4 года назад +1

    Hi there, great tutorial but I have a question. When I simulate my device it does not ask me to enable location services. I get no pop ups like you did. Any idea why? Thank you.

    • @atrevi19
      @atrevi19 4 года назад

      I'm getting the same issue, I don't know why. Were you able to figure it out?

    • @Bene1in
      @Bene1in 2 года назад

      I got this because missed "case .notDetermined:". When I put there "locationManager.requestWhenInUseAuthorization()" - popup appeared.

  • @Shqtucke
    @Shqtucke 6 лет назад +2

    I really enjoy your videos!!! You are truly one of the best!!! Thanks!

    • @seanallen
      @seanallen  6 лет назад

      Thanks for the kind words, Shawn. I appreciate that!

  • @josemiguelchouriogonzalez6096
    @josemiguelchouriogonzalez6096 6 лет назад +1

    Great explanation Sean. Keep doing this great job of providing useful content for all of us. You are the man...

    • @seanallen
      @seanallen  6 лет назад

      Glad to hear you got value from the tutorial. More on the way 👍

  • @arturgarcia3576
    @arturgarcia3576 3 года назад +4

    hello, I have a question as I get this message 'authorizationStatus()' was deprecated in iOS 14.0 what should I do?

  • @RohinBajaj
    @RohinBajaj 6 лет назад +5

    Hey whoever is reading this have a great day and keep being beautiful and inspiring

  • @sachindz
    @sachindz 6 лет назад +1

    super helpful. Awesome tutorial man. Please make a video of integrating google maps into iOS apps too.

    • @seanallen
      @seanallen  6 лет назад

      Glad you enjoyed it, Sachin!

  • @brianp.6237
    @brianp.6237 4 года назад +2

    BROOOOOOOO THIS VIDEO IS 🔥 🔥 🔥 your explanation is so thorough thank you for these videos. Please keep up the great work sir!!!!!

    • @seanallen
      @seanallen  4 года назад +1

      Glad you liked it, Brian!

    • @brianp.6237
      @brianp.6237 4 года назад

      Sean do you only specialize in developing using swift and Xcode only? Do you develop in other languages too? Do you do freelance work?

    • @seanallen
      @seanallen  4 года назад

      I specialize in only Xcode and Swift. I used to do freelance work but have since stopped to build my own business and producst.

  • @tedpeters2264
    @tedpeters2264 5 лет назад +1

    Hey Sean, I dig this video. By far the most helpful i've come across. I am having a problem with the app initializing the "checkLocationServices()" func. It worked once and show my location perfectly. Then it stopped when i uploaded to my personal device. Ive re ran the code and even created other files and used your source code directly and now ive exceeded the amount of app certificates i can make in seven days. I am green to IOS and would really like to get this down. I think xcode is the future of IDE's, If theres any advice you have I would appreciate it alot and take it seriously. If not, thanks for making a legit and clear tutorial. Also your personality is good for this, i usually feel like im falling asleep during coding tutorials.

    • @seanallen
      @seanallen  5 лет назад

      Glad you enjoyed the tutorial 👍. I've never come across this issue, so I'm not sure. I'd have to dig into the project and do some debugging to see what's going on.

    • @tedpeters2264
      @tedpeters2264 5 лет назад +1

      I’ll message you privately through your link in the comments. I’m in Bali till January and recently lost my wallet on the bart so it might be a while before I have a way to pay online for anything and I may figure it out before then. I’ve been using western union to counter the problem while I’m out here since it happened right before I left. Thanks for the reply. One more question tho, do you know any solid ways to find good mentors?

    • @seanallen
      @seanallen  5 лет назад

      For mentors, I'd start following a bunch of iOS developers on Twitter and start interacting. Once you find someone you enjoy, maybe ask them? I did a video about the importance of networking on Twitter as a developer here: ruclips.net/video/QH79tyspt-w/видео.html

    • @tedpeters2264
      @tedpeters2264 5 лет назад +1

      Thank you, @@seanallen. I also debugged and found the problem. I had my method written too far down. It was past the object initialization.

  • @milobanks9407
    @milobanks9407 5 лет назад +4

    Better code for 11:39. let region = MKCoordinateRegion.init(center: location, span: MKCoordinateSpan.init(latitudeDelta: 10000, longitudeDelta: 10000))

    • @garlandt1795
      @garlandt1795 5 лет назад

      minute 16:58 what did you do in line 77?

  • @ken0bey401
    @ken0bey401 3 года назад +2

    If you get the message 'authorizationStatus()' was deprecated in iOS 14.0 for me it worked to write:
    let manager = CLLocationManager
    switch manager.authorizationStatus

    • @euridic1
      @euridic1 3 года назад

      For me the same

    • @okar45
      @okar45 3 года назад

      It does not work for me. Am I doing it wrong? I've been looking for an hour!
      func checkLocationAuthorization() {
      let manager = CLLocationManager
      switch manager.authorizationStatus {
      case .authorizedWhenInUse:
      // do map
      break
      case .denied:
      // show how to turn it on
      break
      case .notDetermined:
      locationManager.requestWhenInUseAuthorization()
      case .restricted:
      // show them they cant
      break
      case .authorizedAlways:
      // do map
      break

  • @omarmk3420
    @omarmk3420 5 лет назад +1

    Amazing explanation and concise, definitely looking for new content!

    • @seanallen
      @seanallen  5 лет назад

      Thanks for the kind words... more in the way...

  • @natelee8671
    @natelee8671 6 лет назад +2

    BTW: I love the wrap-up part!

  • @lukassbeataddicts
    @lukassbeataddicts 3 года назад

    13 dislikes from Android guys. Brilliant tutorial, you should be a teacher.

  • @siddhbamb3276
    @siddhbamb3276 5 лет назад +2

    Thanks for the great video! A quick question: for some reason, my zoom just doesn't work, and I have the exact same code you used in the video. I'm using xCode 11 Beta. Do you have any idea of what the problem might be? Thank you!

  • @julianjanisch2826
    @julianjanisch2826 5 лет назад +1

    Thanks for the great video! But are your locationmanager-delegate methodes invoked when changing the location? Because mine weren't until I added the locationManager.startUpdatingLocation() call in the locationManager-setup.

  • @SandeepSingh-lg7bq
    @SandeepSingh-lg7bq 6 лет назад +1

    Nice tutorial with proper explanation, when you are uploading the rest 2 videos.

    • @seanallen
      @seanallen  6 лет назад +1

      Thanks. Part 2 was released a couple days ago: ruclips.net/video/2wxE8byc2FQ/видео.html
      Part 3 will be released later this week.

    • @SandeepSingh-lg7bq
      @SandeepSingh-lg7bq 6 лет назад

      Thanks you much for nice tutorial, please keep it up. It is really helpful.

  • @atalayasa2772
    @atalayasa2772 6 лет назад +1

    Great explanation thank you wish new ones are coming

  • @wilko4085
    @wilko4085 6 лет назад +3

    Hi
    Im having an error and from what i can see i haven't missed anything from your video.
    in both functions (locationManager and centreViewOnUserLocation) its with this line: let region = MKCoordinateRegion.init(center: center, latitudinalMeters: regionInMeters, longitudinalMeters: regionInMeters)
    i get the error on both lines saying: Cannot invoke 'MKCoordinateRegion.Type.init' with an argument list of type '(center: CLLocationCoordinate2D, latitudinalMeters: Double, longitudinalMeters: Double)'
    and the "init" part is highlighted.
    Many Thanks

    • @seanallen
      @seanallen  6 лет назад +2

      That is because the .init version of MKCoordinateRegion has been updated in Swift 4.2. This tutorial was made with Xcode 10 and Swift 4.2 (which will be released in a couple weeks). If you're still using Xcode 9 and Swift 4.1, start typing MKCoordinateRegionMake and you should get an auto complete for a function that takes in distance using meters. Let me know if that works.

    • @wilko4085
      @wilko4085 6 лет назад +1

      Hi
      I see that explains a lot. I found an alternative way around it, i did this:
      let span = MKCoordinateSpanMake(0.01, 0.01)
      let region = MKCoordinateRegion(center: center, span: span)
      achieved the same result.
      Many Thanks for the response.

    • @MortalKombatant
      @MortalKombatant 6 лет назад +2

      let region = MKCoordinateRegionMakeWithDistance(location, 10000, 10000)
      it worked

  • @natelee8671
    @natelee8671 6 лет назад +1

    Nice detailed tutorial! One of a kind!

  • @muscleman6473
    @muscleman6473 5 лет назад +4

    hi i used your source code files, and was unable to get my location on my computer when running the app on the simulator. Do you know how i would be able to hsow my own location? thanks

    • @seanallen
      @seanallen  5 лет назад +1

      Try running the app on your device and that should work. The simulator defaults to Apple HQ

  • @phileepe
    @phileepe 4 года назад

    This is awesome! Curious...for the didUpdateLocations part...I'm curious..is there a way to call the centerViewOnUserLocation function here so that whenever a user moves/their location updates, we reuse the code we already wrote/call our own custom function to re-center the view on the new user location? Rather than rewriting the region = MKCoordinateRegion.init line, and a new version of the center/location declaration as well. Or maybe I'm misunderstanding this, and the didUpdateLocations built-in function actually powers the centerViewOnUserLocation function that we built because it sets the locationManager.location property that we call in centerViewOnUserLocation?

  • @alanpacheco-wright8648
    @alanpacheco-wright8648 4 года назад +1

    Great tutorial! Got a question though, when I change the location in the simulator to Freeway Drive the map doesn't follow the user's location blue dot. I've double checked the code and it's the same as your video, but its different to the code you uploaded which is missing "let center..." from the extension. What am I doing wrong? Thanks

  • @wilko4085
    @wilko4085 6 лет назад +1

    First time seen your videos. Great clear explanations.

    • @seanallen
      @seanallen  6 лет назад +1

      Thanks Steven. Happy to have you on the channel!

  • @sisball8
    @sisball8 4 года назад

    Concise and straight to the point, well done. Does core location also provide sharing all users location like Waze or Find My Friends?

    • @seanallen
      @seanallen  4 года назад

      Glad you liked it, James. I'm not sure... I've never implemented that functionality.

  • @penchalreddyv3136
    @penchalreddyv3136 4 года назад

    Hey @Sean Allen ! I got awesome learning through this tutorial. Even though it was fast, I could match with it and understood well.

    • @seanallen
      @seanallen  4 года назад

      Glad to hear you enjoyed it 😀

  • @adeadegoke4925
    @adeadegoke4925 5 лет назад +2

    Hi @SeanAllen, Great tutorial. And thank you for making this one. At 1.20, you were setting the MapView 'delegate'? What is a delegate? And why do you need to set it to the ViewController?

    • @seanallen
      @seanallen  5 лет назад +2

      Delegates are quite a large topic. I did a video talking all about them here: ruclips.net/video/DBWu6TnhLeY/видео.html. Hopefully that helps.

  • @ToEazyF0rLazy
    @ToEazyF0rLazy 5 лет назад +1

    Hey when I run it the simulator just says stuck in the white screen and this error comes up MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.Any help or suggestion?

    • @seanallen
      @seanallen  5 лет назад

      Never seen that before... I have a link to download the source code in the description. Have you tried downloading that and running it? And then compare my code to yours?

  • @genebogdanovich
    @genebogdanovich 5 лет назад

    Thank you, Sean. That really helped with my little student project.

  • @MrMaj-cl5mb
    @MrMaj-cl5mb 5 лет назад +2

    Hello!
    I am not able to see the blue dot even after adding that single line code. please help me through this. thanks

    • @seanallen
      @seanallen  5 лет назад

      Did you do all the permission stuff in the code? I have my source code linked in the description. Have you downloaded that and checked against my source code?

    • @joshr9723
      @joshr9723 5 лет назад

      @@seanallen Ya same here. I ran it on my phone and it worked so it must be a bug with the simulators.

    • @joshr9723
      @joshr9723 5 лет назад +1

      @@seanallen After a little debugging, here's what I found. When run on the simulator, the location doesn't pass the if let inside the method centerViewOnUserLocation. However, when run on my personal device, the location successfully gets unwrapped which is why it works on an actual device.

    • @seanallen
      @seanallen  5 лет назад

      Thanks for the heads up. Haven't looked at that code in a while.

  • @ahmedabdelhameed6925
    @ahmedabdelhameed6925 5 лет назад +1

    great tutorial i like your style in coding keep going sean

  • @katerinasmoliy2651
    @katerinasmoliy2651 6 лет назад +1

    Really informative, high-quality stuff! Thank you, Sean!! :-)

    • @seanallen
      @seanallen  6 лет назад

      Happy to help, Oleg 👍

  • @milkycookies8035
    @milkycookies8035 3 года назад

    you been very helpful thanks a lot - but when I run the app the map dosnt move even when I change the meters size

  • @burakbilgin1559
    @burakbilgin1559 4 года назад

    thanks a lot Sean, your style is really exciting and clear for us learners. Can I ask you is there a possibility to change the device's current location programmatically without clicking debug>location>custom location? maybe with a button?

  • @edwardkunz9474
    @edwardkunz9474 4 года назад +1

    Running your source code through my simulator shows me a location somewhere in San Francisco while I am in Germany. The console says:
    User-Location[15072:589126] libMobileGestalt MobileGestalt.c:1647: Could not retrieve region info
    Using XCode 11.2

    • @rohitoznikam3735
      @rohitoznikam3735 4 года назад

      Because it's default location.
      For you'r exact location run the application into you'r device.

  • @cavinalbertbelga5090
    @cavinalbertbelga5090 6 лет назад +1

    Love all your vids man!

    • @seanallen
      @seanallen  6 лет назад

      Thanks Cavin 👍. Much appreciated.

  • @lukassbeataddicts
    @lukassbeataddicts 3 года назад

    authorisation Status was depreciated in iOS 14

  • @alexanderchoi8520
    @alexanderchoi8520 3 года назад +1

    Great video! I am wondering how you can get a user's location and share it with other devices so that other people can see your location in real time. Thank you in advance.

  • @LebenWerden
    @LebenWerden 3 года назад

    Hello Sean,
    the app only runs on my iPhone device. If I run the app on the simulator then the location poin is missing.

  • @MuhammadAli-zv5vz
    @MuhammadAli-zv5vz 6 лет назад +1

    Great video.Mapkit is not a good choice for ride sharing apps or location services becoz Mapkit have limited services .in some countries it do not show directions place info and many more .

    • @seanallen
      @seanallen  6 лет назад

      Interesting point, Muhammad. Thanks for sharing.

  • @jare9771
    @jare9771 4 года назад

    the location isn't showing up, why? I clicked the Users location on map view and I did the code. before I pressed button it wasn't working with the code, can you help please

  • @ottocodes
    @ottocodes 5 лет назад +1

    Nice video! But what is an extension and why should we use them? 🙂

  • @charlycubic1058
    @charlycubic1058 5 лет назад +1

    Thanks for explaining. That was very helpful!

    • @seanallen
      @seanallen  5 лет назад

      Glad you found it helpful, Charly!

  • @TheSatkis
    @TheSatkis 6 лет назад +3

    Great tutorial! Though, am I right that if you'd want your app to be approved by the AppStore, you would need your plist to contain all these three privacy rules? Location Always Usage Description; Location When In Use Usage Description; Location Always and When In Use Usage Description. I understand you show here just a basic functionality, so this is just a note for others.

    • @seanallen
      @seanallen  6 лет назад +2

      I'm not sure off the top of my head. I'd have to look into it. I know the current app I'm working on only using the "When in Use" one and it's approved on Test Flight. I know that's not the same as the App Store, but just a data point.

  • @denverlopes4454
    @denverlopes4454 4 года назад

    Hey Mate, So i tried changing my location but the blue dot has gone grey and doesn't blink anymore. Is there something I'm missing ??

  • @eiderarango5863
    @eiderarango5863 5 лет назад

    Great job man, thanks for these videos. I really appreciate all the effort. I was wondering how many requests per day can we perform in MapKit?

    • @seanallen
      @seanallen  5 лет назад +1

      I'm not sure on the limit to be honest.

  • @satyamdixit5916
    @satyamdixit5916 3 года назад

    blue dot is not appearing in my simulator i have tried your approach of first video and also tried your attached code

  • @uzairkazi1521
    @uzairkazi1521 3 года назад

    Every time I move the map it always jumps back to the user's location after a couple seconds. How would I change the code so when I move the map it stays where I put it? I gather it has something to do with didUpdateLocations.

  • @BuildNotNotFailed
    @BuildNotNotFailed 3 года назад

    mine always says Thread 1: "[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mapView."

  • @thejust219
    @thejust219 2 года назад

    What an amazing tutorial. Thank you so much!

  • @zuhurm9458
    @zuhurm9458 4 года назад

    Hi Sean! I have some problem in MapKit part 1. I did everything right in code, but there is not showing user location. And show this error in console( did fail with error: Error Domain=kCLErrorDomain Code=0"(null)"). Can you help with this?

  • @miko999x
    @miko999x 5 лет назад +1

    Very helpful video, thank you for your awesome work. But I have question about requesting location services: I need to know user's current location in two view controllers. What would be the best approach? currently I am checking for location services in both of them, but I think it is not good solution. Any advice? Thanks

    • @seanallen
      @seanallen  5 лет назад +1

      You only need to request permission once. If you're using location in many screens throughout your app, then it might be a good idea to create a singleton that handles your locationManager. I'm not sure if I'd do that for only two screens tho.

  • @shrimpinpat
    @shrimpinpat 4 года назад

    I'm about 10 minutes when you run the app from this point I have my code exactly as you do minus
    switch CLL part xbode tells me "switch covers unknown cases" and recommends I put
    " @unknown default:
    break
    "
    It builds fine with or without but when I try and run I get
    "Build succeeded" followed by an open to
    Thread 1
    class AppDelegate: UIResponder, UIApplicationDelegate {
    And the error is "=Thread 1: signal SIGABART"
    It won't run. I even used your code still get the issue
    21 main

  • @zzej
    @zzej 5 лет назад

    at 6:07 you make a switch statement with CLLocationManager. Why use that instead of the reference created up top 'let locationManager = CLLocationManager()'

  • @creamteddy
    @creamteddy 5 лет назад

    Im not sure what's happing with my Xcode, i have the latest version, doesn't recognise MapScreen, nor can find other of your typos? well confused animi using swift...... help?

  • @Jump_Jay
    @Jump_Jay 3 года назад

    I'm having trouble with this tutorial and it's something deeper in my simulator and I"m asking for a little help. Can/would you be willing to look at it via dropbox?

  • @crazyjoeybb
    @crazyjoeybb 4 года назад

    Out of interest can you have the map store information. For example if a business wants to show their location to other users, the map would have that location marked for everyone else to see with maybe a small image

  • @abdullahshahid6216
    @abdullahshahid6216 3 года назад

    "MobileGestalt.c:1647: Could not retrieve region info"
    This is the error I am getting, Can someone please help?

  • @laka9077
    @laka9077 4 года назад

    Thank you! Is there a way to get (the coordinates of) a new location that is some distance down a street from an initial location with the Google Maps SDK for iOS? For example, if I want to get the coordinates of a location 20 feet down the same street from some other location. Something like "newLocation = location.translateUpStreet(20)". Some things I've already tried:
    Adjusting (incrementing/decrementing between markers) the longitude or latitude doesn't guarantee that the marker is visible from the street view.
    -Making a formula to increment/decrement the address number doesn't seem like it will work either, because not all streets have a regular address number pattern.
    Thank you so much for any advice

  • @syntax9111
    @syntax9111 5 лет назад +1

    Where did that MapScreen.swift file come from? was it just a matter of changing the name and class in the regular view controller?

    • @seanallen
      @seanallen  5 лет назад

      I create a new file. File -> New -> Then named it MapScreen, and created my view controller in there.

    • @seanallen
      @seanallen  5 лет назад

      There is a link to the source code that you can download in the description.

  • @ekawong
    @ekawong 4 года назад

    Super useful! thank you for the clear explanations!

  • @balajiks5019
    @balajiks5019 5 лет назад

    Hey @Sean Allen ,
    I'm using the same code as you but in my app, it is not showing my user location. I'm in South India. I also tried in Storyboard also.

  • @calithree
    @calithree 5 лет назад +1

    Thanks Sean!

  • @dipeshpatel1968
    @dipeshpatel1968 5 лет назад +1

    thanks for creating tutorial it helped me a lot

    • @seanallen
      @seanallen  5 лет назад

      Happy to hear it helped!

  • @amadydegayediagne3234
    @amadydegayediagne3234 5 лет назад +1

    Hey Sean, thanks for the video....I am in Paris but when i run the program i have the same localisation as you in san francisco i don't know why...can you help me please ?

    • @seanallen
      @seanallen  5 лет назад +1

      If you're running on the simulator, you have to change your location in the simulator settings. If you're running on an actual device, you shouldn't have this issue.

  • @iifunnyninja8422
    @iifunnyninja8422 4 года назад

    Hey there, pretty new to coding and I followed you’re instructions(which are fantastic by the way) but when I run the simulator im not getting my correct location. its putting me in some other country(can't tell because its zoomed in) without the blue dot. Not sure what's going on but would very much appreciate it if someone responded. Thanks in advance!

  • @dannykim7822
    @dannykim7822 5 лет назад +1

    Thank you so much so helpful! but I have a question. Why my location is in San Francisco.....?

    • @seanallen
      @seanallen  5 лет назад +1

      Happy to help, Danny. If you are using the simulator, that defaults to SF. Try running it on your phone.

    • @dannykim7822
      @dannykim7822 5 лет назад +1

      @@seanallen Thank you so much!!!!

  • @creamteddy
    @creamteddy 5 лет назад +1

    im getting really annoyed with Xcode is there an update that old auto code isn't carried across, i have done every single step 5 times over and still not getting what you have?

    • @seanallen
      @seanallen  5 лет назад

      Have you tried downloading the source code that's linked in the description and see if that works? Then compare your code to mine?

    • @creamteddy
      @creamteddy 5 лет назад

      i have even copied your code exactly the same, also my app won't ask for its locations built in the privacy (info.plist) im not sure why i won't ask me to allow location in the app? what other settings does it need? @@seanallen

    • @creamteddy
      @creamteddy 5 лет назад

      @@seanallen i have even copied your code exactly the same, also my app won't ask for its locations built in the privacy (info.plist) im not sure why i won't ask me to allow location in the app? what other settings does it need?
      REPLY

  • @sukshithshetty4847
    @sukshithshetty4847 4 года назад

    func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation). when should i use this function and may I know what this function does/when it invokes??

  • @freehassan2585
    @freehassan2585 3 года назад

    Mine doesn't request when the app is launched and also prints that the info isn't set in info.plist when I have set it. Any ideas?

    • @freehassan2585
      @freehassan2585 3 года назад

      Ignore me. Stupid mistake. Thank you for the video!

  • @ishaanbansal9153
    @ishaanbansal9153 5 лет назад +2

    How come your class name was Map Screen automatically. Mine is View controller

    • @seanallen
      @seanallen  5 лет назад

      That's what I named it. It wasn't here automatically.

    • @ishaanbansal9153
      @ishaanbansal9153 5 лет назад

      @@seanallen Didn't catch that. But thanks for the response appreciate it. How can I get my actual location to show rather than San Francisco

    • @Bankai3474
      @Bankai3474 5 лет назад

      Sean Allen I was wondering the same thing but when I change it I get an issue where I get the Thread 1 SIGABRT thing and I really don’t know why.

  • @teakodo
    @teakodo 4 года назад

    Hey Sean thanks man! When I try to pan around the map, it always jumps back to the user location region. How do I allow user location updates while able to pan around the map ? Thanks

  • @gregorymoore2877
    @gregorymoore2877 5 лет назад

    Thanks for the nice video! However I think you did some extra work you didn't need to do by manually making the map follow the user. Why not just do this:
    self.mapView.userTrackingMode = MKUserTrackingModeFollow
    I'm showing Objective-C, surely it could be done in Swift. I think the movements of the map will be smoother.

    • @seanallen
      @seanallen  5 лет назад

      Thanks for pointing that out. I'll look into that!

  • @OmarMohamed-no8ms
    @OmarMohamed-no8ms 5 лет назад

    let region = MKCoordinateRegion.init(center: center, latitudinalMeters: regionInMeters, longitudinalMeters: regionInMeters)
    This line of code shows me an error that says " Cannot invoke 'MKCoordinateRegion.Type.init' with an argument list of type'(center: CLLocationCordinate2D, latitudinalMeters: Double, longitudinalMeters: Double)' "

  • @gimli0414
    @gimli0414 4 года назад

    does anyone know why I would get this error and how to fix it?
    libMobileGestalt MobileGestalt.c:1647: Could not retrieve region info

  • @Bankai3474
    @Bankai3474 5 лет назад

    Is your map screen extension in your class definition or outside of it? I seem to get an error either way.

  • @maratulbariroh2170
    @maratulbariroh2170 5 лет назад

    I get error at line 77, how can I resolve this?
    Cannot convert value of type 'CLLocation' to expected argument type 'CLLocationCoordinate2D'

    • @maratulbariroh2170
      @maratulbariroh2170 5 лет назад

      I use Xcode 10.3

    • @rohitoznikam3735
      @rohitoznikam3735 4 года назад

      MKCoordinateRegion.init(center: location, span: MKCoordinateSpan.init(latitudeDelta: 10000, longitudeDelta: 10000))

  • @thienlamminh6312
    @thienlamminh6312 6 лет назад +1

    Good job! thanks for this video.

  • @MortalKombatant
    @MortalKombatant 6 лет назад

    inside case :auth in use
    2018-08-28 11:40:14.075995+0530 MapKitDemo1[13634:5415630] [VKDefault] Tile 11.8.4 (256) in current unloaded state for 0.01 seconds - Polygons - Loading (ephemeral) (0.01 sec), Rivers - Loading (ephemeral) (0.01 sec), Roads - Loading (ephemeral) (0.01 sec), Point Labels - Loading (ephemeral) (0.01 sec), Polygon Labels - Loading (ephemeral) (0.01 sec), Road Labels - Loading (ephemeral) (0.01 sec), Resources - Unavailable (terminal) (0.34 sec), Attributes - Loading (ephemeral) (0.01 sec)
    i did'nt get the blue dot in simulator

    • @seanallen
      @seanallen  6 лет назад +1

      I haven't seen that error. Are you sure you did the permissions correctly? Did you download my source code (in the description) and try that?

    • @MortalKombatant
      @MortalKombatant 6 лет назад

      jpst.it/1n9lr
      Sir have a look in my code

  • @dec7952
    @dec7952 5 лет назад +1

    Hey Sean, is there way to get the Users current location to show in the nav bar? Like say I'm say im a certain area in Florida and I want that once the apps loads it shows the area on the map and also in the Nav bar at top? I've searched but couldn't find anything.

    • @seanallen
      @seanallen  5 лет назад

      Check out the next video in my MapKit Series about reverse geocoding location. You could get the City, State from the latitude and longitude, and then display that information wherever you like.

    • @dec7952
      @dec7952 5 лет назад +1

      Thanks Sean. I’ll check it out now

  • @dasukhera
    @dasukhera 5 лет назад

    Man uh r the savior
    Awesome
    Just wanted to know if we want other user location on our map what should be the best practice

    • @seanallen
      @seanallen  5 лет назад

      Happy to help! I'm not sure about using another users location. You'd have to have that on a server somewhere.

  • @itssauud9257
    @itssauud9257 5 лет назад

    Hi i want to build messaging app with location but dont know how to select the location. Help ?

  • @Oscar_AH
    @Oscar_AH 6 лет назад +1

    It is incredible to see the "war" between the storyboard haters and the rest of humanity. It is good to see people that respect other one's opinion

    • @akmonra
      @akmonra 5 лет назад

      Storyboards are cancer. No one in actual industry uses them.