What is JSON - JSON Parsing in Swift

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

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

  • @MediArgentum
    @MediArgentum 2 года назад +1

    I am literally watching this video while on a bus, heading to the company that contracted me to update their app and implement a functionality that requires exactly what's explained here. Talk about winging it lmao. Thanks Chris 👍

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

    I had to come back and watch this again. Why? Because people who watched this came to me for help.
    *This is a great instructional video* However, it is only one side of the same coin.
    The other side of the coin... doing something practical with the JSON data outside the scope of the completion handler. Maybe presenting the data in a tableView and *not* on a background thread. And having that data available when a user selects a tableViewCell.
    So many people have come to me because they do not know how to continue where this video leaves off.
    People are looking forward to seeing Part 2 of this. Thank you.

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

      Hello, maybe this other video will help on how to present JSON data ruclips.net/video/Yzx7ihtCGBs/видео.html
      - Francis

    • @gauntletwielder6306
      @gauntletwielder6306 4 года назад +2

      CodeWithChris - Thank you Francis. However, that specific video mostly describes what an API is. Great for anyone wanting only to know what an API is.
      Unfortunately, that video *is not* the equivalent to a Part 2 of this video. This video needs a genuine follow up to show how to retain and use the collected JSON data *outside the scope of the completion handler* Getting the data is half the objective, processing and presenting it, is the remaining half. How many apps in the App Store use print(“...”) to display data to the user? Hint: the answer rhymes with Nero.
      A genuine Part 2 to this video, would be welcomed by many people.

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

      That‘s exactly what I would need

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

    Thank you chris I am learning lot from your tutorials. ❤️Love from India🇮🇳

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

      Namaste! Much love to you as well! Keep on going! -Arthur

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

    Hello Chris, thank you for this video. I am no non programmer and this video helped to explain what JSON is so at least I can understand what my dev team says.

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

      This comment made our day. Keep on going! :) -Arthur

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

    I had to parse JSON a couple of Swift versions ago and it was such a PAIN to parse JSON back then, so happy that the Apple developers improved this, so much easier nowadays 👍

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

    Wow, that was really quick! Definitely better than dealing with JSONSerialization.

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

      Spasiba! Thanks for learning with us! -Arthur

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

    you are great man! really great. Because you make your videos touching all required points, topics, subjects while developing the target code, not just copy pasting the code.

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

      Thank you so, so much for your kindness! We appreciate you! Gives us more motivation to keep on hustling. All the best to your projects! -Arthur

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

    Thank you Chris ! It helped me in learning.

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

    Thanks Chris! You are a great instructor!

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

      And you are a great student, Dave! Appreciate you! -Arthur

  • @sujitmolleti2322
    @sujitmolleti2322 4 года назад +2

    Thank you so much, Chris! This tutorial was very well-paced and gave me the proper context of what was happening. Excited to see what you make next!

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

      Happy to help, thanks for being a supporter for 7 months+ too!
      PS: We are working and planning on so much good stuff for the rest of the year! Uuuuuuuuuh
      @AdrienVillez

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

    Excellent video ... thanks for sharing this ... learning a lot

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

      Great to hear! Thanks for watching this.
      - Kat

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

    @CodeWIthChris is there a way to edit the information on a JSON extracted file and feed it back to the orginator?

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

      "Hello, usually that would be considered as an API interaction, or maybe database.. most of the time the data is sent as JSON but you update by batch using the API
      - Francis"

  • @JusCJay
    @JusCJay 4 года назад +2

    Reddit API or RUclips API. Great tutorial!

  • @alifarhadi5704
    @alifarhadi5704 4 года назад +2

    Hey Chris thanks a lot for making these great videos, you teach stuff very well and also you say some valuable experience while you teaching such as put some breakpoint or use debug console and also make properties optional. Thanks a lot again

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

      Thanks for the feedback! We really appreciate this. 😊
      -Kat

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

    So why are you choosing to use Swift Storyboards for this demo vs SwiftUI? Is there a difference for how this is done? Thanks!

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

      Hello, there shouldn't be too much difference in codes when parsing the json, the main difference would be how to create the user interface, for now the storyboard is still the one prominently used because swiftui can only be used by ios 13 and above
      - Francis

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

    Great video, very insightful thank you! Is there anyway , you could do a series on this to go into more detail? I get the general gist but not sure I would be able to replicate on my own. A tutorial in the context of an app that displays the parsed information would be very helpful. Also have you mentioned things like "do catch try" in other videos? This was my first time hearing it and was a bit confusing.

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

      Hello, maybe this blog we made can help you better understand error catching codewithchris.com/swift-try-catch/
      - Francis

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

    you are a wonderful specimen

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

      Haha, thanks for learning with us! -Arthur

  • @oshinvats7304
    @oshinvats7304 4 года назад +2

    Hi, I know this is quite late, from when this video came out, but I was wondering where do we put the session request and everything. Chris said that we shouldn't put it in the viewcontroller. Where do we put it?

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

      Hello, i suggest putting the request in ViewWillAppear(), or a button (or asyncronous function) that will have a chance to trigger a "refresh" in your collection. and will thus update data
      - Francis

  • @SauravKumar-si6yg
    @SauravKumar-si6yg 4 года назад +2

    Hey Chris! What do I do if I am working with a api that has a dictionary inside a dictionary, inside an array, etc. I know we can use the structure code, but how do we do this if it is all nested?

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

      Hello, depends on your structure, so if you have an array inside an array its somthing like a[0][0].. or if theres a dictionary inside the array then maybe a[0]["name"], or something similar, it depends on which one is first and you just add the additional step to be able to access it
      - Francis

    • @SauravKumar-si6yg
      @SauravKumar-si6yg 4 года назад +1

      @@CodeWithChris thanks for the reply, that worked!

  • @Mahadev-x7u
    @Mahadev-x7u 4 года назад

    Good tutorial Chris, we will wait for SwiftUi as the same... your solution. Thank you

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

      Cheers, Andrej! Glad to know that you are happily learning with us. :-) -Arthur

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

    I could sure use your help setting up this dispatch API.

    • @CodeWithChris
      @CodeWithChris  2 года назад +1

      Hi, kindly post your question in our CodeCrew forum so that our tech support staff can assist you. Go here: codecrew.codewithchris.com. Thanks for learning with us! -Arthur

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

    A Shopify API would be amazing. Maybe a way to fetch products or something like that

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

      Added it to the list, thanks for suggesting!
      -Kat

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

    Hi Christ.
    It is good and easier to understand parsing Jason to Swift not swiftUI,
    I am glad to to understand the basic.
    How to creat a json file
    Menu
    I'd, name, cost, description
    as you API..
    Thanks

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

    I always love and follow your tutorials ;what is the best networking for a beginner to learn as an iOS dev ???? thanks for this video.

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

      Hello, kindly post your question on our CodeCrew forum so that our tech support can give you insights about this. Go here: codecrew.codewithchris.com. Thank you! -Arthur

  • @cityrunner-x3x
    @cityrunner-x3x 4 года назад +1

    Nice video sir, keep going.

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

    How would you go about parsing date ranges? For example, the data goes back to 1914, but I only want to extract data from 2020. What woud be the best way to do it?
    example-
    To filter the dataset to only return records containing a specified value for incident_datetime simply add a URL parameter to your URL with incident_datetime as the key and your specified value.

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

      Hello, as long as the records are in the same format then it then be fine, you might need to ""recalculate"" or cast your date records into Date format so it will be easier to handle, i suggest searching around on google there are plenty of articles that cover ordering/filtering by date
      - Francis

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

    Now that it’s done, what do you with that after your parse it?

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

      Hello, depends on you, usually after parsing you just print/present the data to the UI, or maybe do some computations with it, its all up to what your app needs
      - Francis

    • @SauravKumar-si6yg
      @SauravKumar-si6yg 4 года назад

      @@CodeWithChris Hey Francis, how exactly can we work with the data, such as making a list of the news articles like the ios news app? Do you have any blog posts or videos on that?

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

    Nice tutorial. Thanks!

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

    Very Nice. I was very frustrated first time I tried to use this API in a headlines app tutorial as several of the data values would come up nil. This explanation and data modeling was much clearer to me. Thank You. Im using Xcode 11.3.1 and don't get the nice human readable JSON format in the terminal at the print(newsFeed) statement. Also I get an error at that breakpoint when trying to 'po newsFeed' ; that I'm assuming is related to my older Xcode. Thanks Again. I learn something new with each of your video postings.

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

      Thanks for watching it! Glad to know you're learning with our tutorials.
      -Kat

  • @michaelpowers7164
    @michaelpowers7164 4 года назад +2

    Hey guys, everything in this code works except the very last line. I get this error code in regards to the follopwing. Are there any suggestions?
    error- "Variable used within its own initial value"
    This is the line of code that recieves the error "dataTask.resume() "

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

      Hello, check your ""resume()"" function, it seems that you might be settting a constant value to itself(or same named parameter) so change the parameter name to avoid the error
      - Francis

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

    A few people have asked this perhaps you know what to do? The problem is: THEN what? I have data in a URLSession response but that's asynchronous, so my app has moved on and my data is sitting somewhere I can't access. I have a bunch of data but how do I get it back to the parent? (In Javascript I'd nest the function or use await, for example.)

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

      This answered it for me. I was doing a web API call. ruclips.net/video/tdxKIPpPDAI/видео.html

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

      Hello, you can try to make an external swift file, lets say ""globalData.swift"" and declare the variables you want to use there, you can then set the values of the variables and you will be able to access those anyway in your app
      - Francis

  • @allurisirisha3940
    @allurisirisha3940 Год назад

    Hey how to get this news API for my practice? can you please mention it in description box.

  • @user-rc2nt1tb2u
    @user-rc2nt1tb2u 4 года назад +1

    .
    I'm trying to build an app that searches through the web (Using web scraping) and returns the specified data instantly (data can be updated on the website and I want it to be updated in my app as well), can that be done with JSON?

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

      Hello, yes usually JSON is the best way to share data between apps/websites/and a server
      check out our swiftyjson to handle json data codewithchris.com/swiftyjson/
      - Francis

  • @toqix6861
    @toqix6861 4 года назад +2

    Hey, The JSON parsing in my project works perfectly fine, but i have problems passing the data to my View in SwiftUI. I tried to use an observableobject, but I‘ve got problems with the initialisation. Because my variable of the type NewsFeed object has no data in it when declared.

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

      Hello, maybe there was a mismatch somewhere that made your NewsFeed object null, you can try going to our forum at codecrew.codewithchris.com so we can take a better look at your problem
      - Francis

  • @adilal-marzooq1582
    @adilal-marzooq1582 4 года назад +2

    Very nice. I would like to see an email validator API

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

      I can't post a link here because RUclips is gonna flag my comment, but Google "email validation Swift Github" and you'll find some pretty great things!

    • @adilal-marzooq1582
      @adilal-marzooq1582 4 года назад

      Adrien Villez thanks 👍🏻

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

      Thanks. 👀👍
      -Kat

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

    Hi Francis! Hi Chris!
    It would be great if you could make a tutorial explaining how to display JSON data in SwiftUI.
    There's already several tutorials out there explaining this but they all use the List container to display the data. But Lists require your struct to be Identifiable, otherwise it won't work:
    ```
    struct Todo: Codable, Identifiable {
    public var id: Int
    public var title: String
    public var completed: Bool
    }
    ```
    In this example the response object from the API has and "id" key. But what if it didn't have one? Then you cannot make it Identifiable, and therefore you cannot pass the data to a List container.
    Therefore, my question is: how do you display JSON data in Content View without using the List container?
    Thank you!

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

      Hello, maybe using swiftyJSON is the right tool for you. check out our article about it codewithchris.com/swiftyjson/.
      the usage should be similar even when on SwiftUI
      - Francis

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

    This is outside of this video, but if I hit `JOIN` will I still see ads or not? And how can I see your videos without ads (without premium RUclips)?

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

      Hey Roland, right now, it doesn't remove ads but this is a good suggestion for the RUclips membership.. i might upload the RUclips videos on my course platform and make it available ad free for people in the YT membership.

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

    I know I'm late, but would love to see a demo of google earth and/or maps API!

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

      Hello, Benjamin, can you kindly post your suggestion here: app.productstash.io/codewithchris#/ideas Thanks for learning with us! -Arthur

  • @MyDataScienceTutor
    @MyDataScienceTutor 4 года назад +2

    I just tried to run this and I'm getting an error because the site is not secure. Says "App Transport Security has blocked a cleartext HTTP () resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file." I have no idea how to tweak the Info.plist file to accommodate this. Can anyone help?

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

      Hello, you can try to add an "allows arbitrary loads" in your info.plist, or you can simply try to load your resource using "https" instead of just "http" apple is pretty strict about this
      - Francis

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

    Please upload more videos on this, also with http header

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

      Yes, there will be more videos like this! :)
      -Kat

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

    Great video! Thank you.

  • @dronesim
    @dronesim 4 года назад +2

    Spotify API would be amazing. Better yet, parsing the data and showing it in the front end

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

      Cheers, thanks for suggesting that! :-) -Arthur

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

    Great content Chris and co!! Would love to see a Facebook API in action. Looking to grab a pages info to keep up to date on that companies events (gatherings) in my application.

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

      Sounds good! It's on our list. :)
      - Kat

  • @salehal-shammari3510
    @salehal-shammari3510 4 года назад +2

    Hi, thank you very much what a great Video..
    I have a question : how to declare a dictionary in the Newsfeed.swift File, I'm trying but its not working with me ! please help me

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

      Hello, this video should help you learn about dictionaries, dont worry they will work the same
      - Francis

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

    I love this dude!

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

    can you show how to implement basic user/password authentication against an API? I got an API that does not require an API key but the credentials of my user on the platform

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

      Hello, most apps probably also has user and password functions but it may also return an API key that you can use instead for fast log-in, think of it as a UserID (primary key) of some sorts. i think its as simple as using network connections if its an API
      you can try our alamofire tutorial maybe it can help codewithchris.com/alamofire/
      check out swiftyjson as well codewithchris.com/swiftyjson/
      - Francis

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

      CodeWithChris I could solve it now on my own by using the HTTP Header attribute „authorization“

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

    After watching the video (numerous times) I built an Xcode project to mimic what you did in the video. I got it all working and then made a change were retrieving the JSON feed is being handled in a method within ViewController.swift. So now the only additional line in the viewDidLoad() method is this: getJSONFeed(). The method (getJSONFeed) is working fine and I'm able to put in a break and make sure that I did, indeed, retrieve the JSON data feed but I'm having trouble trying to figure out HOW to pass that data back from the method getJSONFeed() to viewDidLoad().
    I think I have two problems that I need help with:
    1. I have created a class property as an optional NewsFeed type: var thisNewsFeed:NewsFeed?
    I'm not sure if this is correct.
    2. I am then trying to set this variable within the getJSONFeed() method by adding self.thisNewsFeed = newsFeed. I then placed a print(self.thisNewsFeed) in the code and it properly displays the JSON data that was retrieved. However when trying to access the thisNewsFeed back in viewDidLoad(), after the call to getJSONFeed() it's NIL. I think my problem is this: how to pass data from a closure.
    here is the ViewController.swift code:
    import UIKit
    class ViewController: UIViewController {
    // Class properties
    var thisNewsFeed:NewsFeed?
    override func viewDidLoad() {
    super.viewDidLoad()
    getJsonFeed()
    // peek at value of class property after the call to getJsonFeed()
    if thisNewsFeed != nil {
    print(thisNewsFeed!)
    }
    }
    func getJsonFeed() {
    // Hit the API endpoint
    let urlString = "newsapi.org/v2/everything?q=bitcoin&from=2020-02-12&sortBy=publishedAt&apiKey=hiding_my_api_key_for_this_posting"
    let url = URL(string: urlString)
    let session = URLSession.shared
    let dataTask = session.dataTask(with: url!){ ( data, response, error) in
    // check for errors
    if error == nil && data != nil {
    do {
    // Parse JSON
    let decoder = JSONDecoder()
    let newsFeed = try decoder.decode(NewsFeed.self, from: data!)
    // now set the class property thisNewsFeed
    self.thisNewsFeed = newsFeed
    // and display it to insure it actually contains the JSON data
    print(self.thisNewsFeed!)
    }
    catch {
    print("error in JSON Parsing")
    }
    }
    }
    // Make the API Call
    dataTask.resume()
    }
    }
    Any help would be appreciated!!!

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

      Hello, i suggest moving this problem to our public forum at codecrew.codewithchris.com so we can take a better look at your project
      - Francis

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

    Hi Chris... Good Evening. This is Pradeep from India. Honestly, I have acquired most of my Swift knowledge from your tutorials. This Video is excellent and has given a lot of insights on how to use URLSession and Codable Protocol to fetch the data and parse it. Thanks a lot. On the same note, Can you suggest on what is the best way to have a Network Manager that does this job? I don't want to write the same code in every controller and want a single place where i can fetch and parse my data that returns back to my controller? Can you please point me to any of your videos that does this?

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

      Hello, maybe you can use the full stack notes app ruclips.net/p/PLMRqhzcHGw1YSKIO61XncxTPoFu81K1Mx
      or CoreData tutorial ruclips.net/p/PLMRqhzcHGw1aDYKmCuqXQ_IqpWpJlpoJ3
      - Francis

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

      @@CodeWithChris Thanks a lot.. Will check out all those 4 videos in the suggested Playlist..

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

    Hi Chris,
    If I wanted my JSON to have elements that are underlined or italicized and then save it as a NSAttributedText... how would I do that?

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

      Hello, maybe save the attributes on a different "column", so for a blogpost you have the "text/body", and the "style" which is the values for the NSAttributes
      - Francis

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

      @@CodeWithChris Thanks. I went with an HTML parser instead.

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

    Can I put struct of Article directly inside the NewsFeed.swift?

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

      Hi Kin! We are limited in the comment section to talk code and share screenshots, please jump over to our CodeCrew Support Group: bit.ly/CodeCrewCommunity so we can help you the best as we can!
      - Kat

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

    Okay so how would we then present that data in the storyboard? I've searched it up and I cant find how to actually use the data?!

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

      Hello, you can use it as the source data for a tableview/colletionview for example
      - Francis

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

    Great Video, you below part of xcode seems different from mine, how did you get to get lldb po ? why didnt print happen automatically since you had print newsfeed already in the code ?

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

      "Hello, ""lldb po"" is just a header that signifies that the data you see is coming from the debug log, so its not from the normal print log
      - Francis"

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

    I'm working with a JSON that just gives me number as headings. I can't create constants or variables as numbers in swift so what would the solution be? It's just a practice project, I've managed to get other APIs working, but I've come across a few like that, so I'm hoping for an easy solution
    Thanks

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

      Hello, it should be possible to use number as headings, may i suggest to use swiftyjson to parse your data? we have an article for it here codewithchris.com/swiftyjson/
      - Francis

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

    Chris, I was able to complete the project in this video successfully, but i get. nw_socket_handle_socket_event [C1.1:2] Socket SO_ERROR [61: Connection refused]
    when I hit a localhost api that returns a json result. Is there something special about making a request of a localhost as opposed to the news site in your video? I realize this is a super specific question, but I've exhausted my other resources. Very new to this...

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

      Hello, maybe you might need a special permission to be able to access localhost, or your localhost itself is not configured properly to accept connections.
      check the permissions along with your localhost to see the problem
      - Francis

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

    Hi Chris, first of all thanks for the videos bru!, second, i'm what are the skills needed as a junior developer to have? i mean i would like to apply for a job but aint sure about if i got enough projects and if they are big enough

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

      We released a video about that, watch this: ruclips.net/video/x9tv-bDQi5Q/видео.html :)
      - Kat

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

    Hi Chris!
    Fantastic video, very clear and I managed to adapt it to my OpenWeather API I'm using.
    Is there any chance you're doing a follow up video about how to use this data to change labels and text inside of storyboard?
    Aim for me is to make a basic weather app as a project, but having serious trouble as to how to use this data.
    Thanks again for the video!

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

      Hello, maybe you can check out our SwiftyJSON so you can see how easy it is to use the data you have read from the apis codewithchris.com/swiftyjson/
      - Francis

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

    Hey Chris, awesome video! I was wondering if you would consider parsing JSON with Text & Image into a TableView. If yes, waiting for the tutorial 🙏

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

      Hello, kindly post your question in our CodeCrew forum so that our tech support staff can assist you. Go here: codecrew.codewithchris.com. Thank you! -Arthur

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

    Chris: Any chance of getting a copy of this Xcode project to play around with? Thanks! (Great video by the way!!!!)

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

      Thank you! Unfortunately, we don't have the source code available for this project.
      -Kat

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

    I know it isn't the focus of the video but what is the best way to manage API keys in Xcode?

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

      Hello, that depends maybe you can put it in UserDefaults for quick saving and access
      - Francis

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

    Thank you Chris... Your videos are really amazing... Please make a video on NMSSH or other framework that supports SSH remote connection... Any links to such libraries or tutorial would be highly appreciated :-)

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

      Thanks for the support and suggestion! :-) -Arthur

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

    Please make video for adding image in core data

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

      Thanks for the suggestion! Check this out www.vadimbulavin.com/how-to-save-images-and-videos-to-core-data-efficiently/
      -Kat

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

    Thank you! That helped!

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

      Anytime. Thanks for learning with us! :) -Arthur

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

    Hey Chris, I wanted to find a job as IOS developer this year and I wonder should I actually learn UIKit or not?
    What you think about it?

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

      Yes!! ALL production apps by companies will be UIKit, no one other than indies are using SwiftUI because it's brand new

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

      Yup, Mikaela is right. If you intend to get an iOS development job, knowing how to use UIKit is still a requirement for most companies.
      -Kat

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

    Hi Chris! When printing the newsFeed it just says newsFeed() in the console. Do you know what the problem could be and why it doesnt print the contents of stockData?

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

      "Hello, i think you printed the class instead, maybe it was decoded wrong,, try checking your variables it needs to be exactly the same (uppercase and lowercase)
      - Francis"

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

    Love it 💚

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

    Thank you chris !

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

    do you have an example that shows how to create the json object with dictionary datatype.

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

      "Hello, try checking out results from like itunes API or something it should be similar
      - Francis"

  • @gauntletwielder6306
    @gauntletwielder6306 4 года назад +2

    Nice video. The Facebook API would be nice. Thanks. 👍🏻😀
    I have to admit, I have my own selfish motivation for that suggestion. Lol. There are billions of active FB users who use the wealth of features and services offered by FB. However, there is a glaring omission in the world of FB. It is a feature I have wanted for years... I cannot be the only one who wants it. Lol. Oh yeah... FB no longer supports their own Objective-C SDK. Thank you FB. Now I have to venture into Swift.
    I almost forgot... the feature I want to implement, uses a new dynamic approach to security by retrieving bare minimal information... only when it is needed. The code I have in mind will *NOT enumerate* through all friends and collect their info. *Bare minimum info only when needed.* I want to make and sell an app that works as advertised, not take advantage of people after they buy the app.

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

      I'll add the Facebook API to the list.
      -Kat

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

      CodeWithChris - Thank you. Much appreciated. 👍🏻😀

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

    @20:50 who teaches you to force unwrapped that "data" on line #38 ???

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

      Hello, best if you talk to our tech support staff about this: codecrew.codewithchris.com. Thank you, James! -Arthur

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

      @@CodeWithChris What I meant was that "data!" should be replaced as
      guard let validata = data else { fatalError () }
      even without any teaching / support staff help !

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

    I would like to see Vk API. How to transform time(duration) into readable format(00:00 or 00:00:00), representing time unit

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

      Thanks for the suggestion! I'll add it to the list.
      -Kat

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

      CodeWithChris, I have figured out how to do that with DateComponentsFormatter.

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

    Stupid question, but what do we do if the json starts out as an array? For instance the reddit api for comments begins with something like 1.data.children[0].replies.body
    I understand how to decode everything but the array (or dictionary?) in the beginning... I try decoding it as [ObjectThatContainsData] and that doesn't work either. On stack I've seen people mention ways to work with this using serialization, but as far as I know it's always better to use decoding right?

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

      Hello, kindly post your question in our CodeCrew forum so that our technical support staff there can assist you. Go here: codecrew.codewithchris.com. Thanks for learning with us! -Arthur

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

    Hey Chris make a video on OAuth Api

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

      It's already added on our list, don't worry! We just have a very long list of topics to cover. 😄
      -Kat

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

    hello chris i got this error "nw_protocol_get_quic_image_block_invoke dlopen libquic failed" and the parsing got thrown . Do you know any solution? im on xcode 12.4

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

      "Hello, this seems to be a common simulator issue recently, try changing to a different device
      - Francis"

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

    Sir? Is there anyvideo regarding accessing json data in a zip file and then using that data to map our UI?

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

      "Hello, i don't think its possible to directly exact the data from a ZIP file, you will need to have the data (extracted) in the proper directory so the app can access it
      if you are also interested in utilizing JSON try out our swiftyJSON tutorial maybe it can help codewithchris.com/swiftyjson/
      - Francis"

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

      @@CodeWithChris thank you very much sir, i hope your channel grows to be one of the best ❤️

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

    Thank you so much!

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

    Can you make a video on parsing data by json serialisation

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

      Thanks for your suggestion! :-) -Arthur

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

      @@CodeWithChris Thanks, eagerly waiting for it....

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

    I wrote an app that stores JSON data into UserDefaults. I wanted to add a new property to the struct. When I ran the app, the decode failed. I assume it was because I attempted to read a property that wasn't defined in the JSON. Is there an easy way to get around this? Is there a specific error code I can check for?

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

      "Hello, i don't think you can store JSON property in UserDefaults, you can probably save it as converted value (the class you made) instead, or save a local copy of the JSON file to your directory instead
      - Francis"

  • @cityrunner-x3x
    @cityrunner-x3x 4 года назад

    sir, i met with ATS block. what's wrong with me

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

      Hello, I'm not really sure what you mean, i suggest posting your error on our forum at codecrew.codewithchris.com so we can take a better look at your problem
      - Francis

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

    Hi Chris! How can I send a request or change a value in the JSON file with an action in my App?

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

      Hello, you might need to write to the file (make sure to add permissions) and you can either overwrite the entire file (to edit it), or append if you just want to add records
      - Francis

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

      CodeWithChris Thank you so much!

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

    Wonderful video! But I keep getting this error: "typeMismatch(Swift.Dictionary, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Dictionary but found an array instead.", underlyingError: nil))" and i'm not sure what to do. If you had any advice that'd be awesome, thank you.

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

      Hello, it seems you used an array which is not a "key-value" pair. you can check out this video for reference
      ruclips.net/video/mJwmGpdZQAg/видео.html
      - Francis

  • @user-ec1dn3uz5k
    @user-ec1dn3uz5k 3 года назад

    Thanks a lot Chris! This means a lot. I messaged you on Twitter haven’t heard back 😃

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

      What is it? Hope we have already responded to it by now. If it's a technical question, post it here: codecrew.codewithchris.com. Enjoy! -Arthur

    • @user-ec1dn3uz5k
      @user-ec1dn3uz5k 3 года назад

      @@CodeWithChris my question was if you have any tuts or paid courses that goes in details on UI testing, and Unit testing for UIKit ? It's so hard scavenging the web for these two topics, not enough in-depth resources. If you have any resource that can help a beginner get competent in unit or UI testing please share it with me

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

    what about a local JSON fil thats part of your project?

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

      "Hello, yes its totally fine to have a local JSON file just set the URL to be a file with path so it gets it from the local files
      You can also check out our SwiftyJSON tutorial codewithchris.com/swiftyjson/
      - Francis"

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

    Great tutorial, really enjoying it...
    however I am getting this error... i can see many people on forums getting this error after upgrading to Xcode 12, im not sure if that is the reason, yet this is the error I am getting after running your example, what does this mean?
    JSON[30212:2685228] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
    Error in JSON parsing

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

      "Hello, try changing your simulator i think some people find that it works by doing this.. or ifs really the JSON thats the problem when try checking your spelling it needs to be exactly the same (includding capitalization) when you parse JSON
      - Francis"

    • @Hesham.Sultan
      @Hesham.Sultan 3 года назад

      I fixed it by using square brackets on newsfeed --> [newsfeed].self instead of newsfeed.self . I hope this helps

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

    Thanks !

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

    Cool.
    Thx

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

    Nice video. You said usually it is not hard coded like let urlString = ".......". Will you be making a video about the other way? I tried to use an api from rapidapi.com/ , but I could not find a json example there to create a struct base on that. Can you maybe use an api from there for next lesson and show how to do that? Thank you!

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

      Hello, we used newsAPI for this lesson. you just need to look for documentation on rapidAPI on how they make their JSON data and how to call it
      - Francis

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

    can you make video on sunshine conversation api for facebook integration.

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

      Thanks for your suggestion! Can you kindly post your suggestion here: app.productstash.io/codewithchris#/ideas :-) -Arthur

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

    Would it kill you to put the code on github?

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

      "Hello, this project is just for conceptualization and to explain how to handle JSON, for most of our newer and other projects it will be available to access in our GitHub page so you should check them out there instead
      - Francis"

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

      @@CodeWithChris kk thx. Sorry, I was a little upset because I get really easily distracted and my speakers were acting weird for some reason -so it was nearly impossible to follow and I just wanted a quick copy/paste 😂

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

    hello sir can you make project on moya

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

      "Hello, sadly our channel only focuses on iOS content. Thank you for showing in the channel though, much appreciated
      - Francis"

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

    good

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

    Thanks

  • @dineshkhatri3859
    @dineshkhatri3859 2 года назад +1

    dictionary inside array [{},{},{},]

    • @CodeWithChris
      @CodeWithChris  2 года назад +1

      You don't need the final comma, ;)
      @AdrienVillez

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

    Can you please do a tutorial of using an API from one of those scooter/bike companies and displaying it on a map as I can't figure out how to implement it. Here's the GitHub page for the API I'm trying the intergrate: github.com/ubahnverleih/WoBike/blob/master/Lime.md Thanks!

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

      Hello, you can send us your requests here: cwc.to/request
      - Kat

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

    Parsing in the view controller at work and take off on the same day. 100213031291390231092329 video how to parse. 0 video how to do it in a separate layer

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

      Hello, im not sure if i quite understand your question. i suggest moving to codecrew.codewithchris.com so we can take a better look at your problem and also have the opinions of other developers in the forum
      - Francis

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

      ​@@CodeWithChris ,I don't know much English (. I mean, parsing in a view controller is a bad practice. You need to do this in a separate “net-woking” class, but no one tells how to do it

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

    Facebook API please

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

      Hello! Thanks for the suggestion, it's in our future topics list. :)
      - Kat

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

    Hi Chris, thank you so much, would love to see you demo shift4shop REST API mainly interested in how to retrieve a list of orders.
    Thank you

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

      HI Ibrahim! You can post tutorial recommendations here app.productstash.io/codewithchris#/ideas and we'll have our team take a look at it. :) - Pat

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

      Great thank you .

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

    Great video. Thanks!