Nick, your teaching style suits my brain perfectly. Really enjoying the videos and learning loads. Thanks a bunch bro.
@josephdeweese20063 жыл бұрын
I agree. excellent
@siddharthkamaria Жыл бұрын
You can convert snake_case to camelCase by setting the JSONDecoder's property -- `decoder.keyDecodingStrategy = .convertFromSnakeCase` No need to write out all the CodingKeys manually. Happy coding :)
@hao-bz Жыл бұрын
Exactly. I just implemented that in my viewmodel using .convertFromSnakeCase. worked like a charm !
@nevemra5 Жыл бұрын
It’s not boring, it’s very interesting and informative. As always, thank you Nick!
@spradohak2 жыл бұрын
Thank you for the great tutorial Nick, Just wanted to point out a trick regarding the Codingkeys , the "quicktype tool" you mentioned has an option called Exxplicit CodingKey values in codable types which is the third one in the options. just note that you need to disable the first option "Plain types only" and it will provide you with all the codingKeys for your properties. Hope this help.
@samarghourab55452 жыл бұрын
The API is now under Products -> Crypto API -> Explore Docs
@harshavardhan5882 Жыл бұрын
Paid one right now
@hao-bz Жыл бұрын
@@harshavardhan5882 you can still use the free version but is limited to 20-30 api calls per minute
@ReloadingBakchodi3 ай бұрын
now it's paid one 😭
@karaokedeconstruction3 жыл бұрын
Awesome video, I was having trouble getting JSON converted to models in previous practice but this video clearly explained what to do.
@elaidzhashchukin7268 Жыл бұрын
Thank you so much for doing this and all other videos !!! I liked the music btw :))
@CayenneHQ2 жыл бұрын
very helpful/instructive. Subbed w/ notifs on!
@SwiftfulThinking2 жыл бұрын
Welcome Nico!
@literallyshane43062 жыл бұрын
Another great video, I have been binging on these past few days, really helpful thank you! Quick question - why didn't you use the 'plain types' toggle on QuickType to generate the coding keys?
@RelaxMusic-eg9gq2 жыл бұрын
Absolutely not boring
@SwiftfulThinking2 жыл бұрын
😂😂🤕
@philippegden98263 жыл бұрын
Quick query - why didn't you use a mutating function to update currentHoldings? Thanks for this series - I'm learning everyday.
@SwiftfulThinking3 жыл бұрын
Hey Philip, great question honestly. We could have used a mutating function here and it would have worked. However, we would have had to change the constants from "let" to "var". I prefer to keep Models with "let" constants so that the struct is considered an 'Immutable Struct'. This is a technique based on Uncle Bob's Clean Code which essentially makes all of the items inside the struct constants, so that they purposely can't be mutated. Then, if we want to update the struct, we will create a new Struct with updated data (as we are doing here). This helps to keep our code in sync, so we know that the Struct never gets mutated anywhere in the app, other than our update function. You can read some more about this here: medium.com/swift-programming/immutable-models-swift-29973170c08c
@joywu1 Жыл бұрын
I found at 10:21" change from class to struct, but didn't mention why. I guess is class will happen error CoinModel no init. but I don't know why
@MegaNerevarАй бұрын
I would recommend learning reference type vs value type. Class vs struct.
@harshavardhan5882 Жыл бұрын
Api is not Free right Now
@Khl81223 жыл бұрын
Should you define a struct called something like CoinHolding which is composed of CoinModel and cuurentHoldingAmount: Double? (similar to sparlinelineIn7D) ? struct CoinHolding : Identifiable, Codable { //might need to do something to make CoinHolding conform to Identifiable let coinModel: CoinModel? let currentHoldingAmount: Double? }
@SwiftfulThinking3 жыл бұрын
Hi Kevin, I don't think we need to make an entire struct for this variable. The computed variable I used should be efficient.
@ProgramJerol7 ай бұрын
The API is now paid sadly
@sampadaagarwal56752 ай бұрын
is there any ither api which i can use at this place
@ΑνδρέαςΓκόγκος-θ5σ3 жыл бұрын
excellent video as always
@notorioustofu3482Ай бұрын
For anyone following along and storing this in a Github repo, please remove your API key from the pasted comments before you push up your code
@MineRala-bn4ep7 ай бұрын
Hello, holdings are coming to 0. Where do you set it? Where are you calling updateHolding(amount: )?
@光莒2 жыл бұрын
Hello, I'm very enjoy this video and this is super helpful for me, especially how to deal with complex json data~ I just wondering about what different if we used ''mutating func updateHolding(amount:Int){currentHolding = amount}' or the function 'updateHolding' in this video? thanks~ this series video is really wonderful!! I can't wait for more videos you make~~
@SwiftfulThinking2 жыл бұрын
It doesn’t make much of a difference in this situation. I explain it in detail here: kzbin.info/www/bejne/Y3uvlqGJibB4maM
@hashcat57212 жыл бұрын
8:14 It is better to use xCode -> Settings -> TextEditing -> Code folding ribbon
@rasheed1andrew3 жыл бұрын
Within my project, I created 3 different models. 1 of the models had properties that was of type of another model. I also created properties that were of types of an array of another model. Everything worked fine but when it was time to access this models in the ui, I ran into problems with the ones in an array. Is there a way to access the models in the array or do I set up the array in the view model? Im definite it will work the other way around but I just wanted to know if there was a way to make the first setup work.
@CayenneHQ2 жыл бұрын
hey I wanted to code an app that sent a notification every time a wallet made a txn, do you have an idea of where I could start?
@jemmytech54742 жыл бұрын
Sir when I click on execute, then I don’t see the response details- the json coinModel? Please help me
@NavdeepSingh-ut8md5 ай бұрын
Hi, nick can you provide alternate of this api, ? This is not free now.
@mhmtkrnlk2 жыл бұрын
Hey nick do you have any particular reason why you make CoinModel class but not a struct ?
@spradohak2 жыл бұрын
he changed it to struct later on, I guess after the first two properties.
@lidders Жыл бұрын
I was confused too but there’s a sneaky edit at 10:08 back to a struct
@jamshidbekhaydarov218 ай бұрын
❤❤❤
@张湘雄3 жыл бұрын
This video is great.
@SwiftfulThinking3 жыл бұрын
Thanks you!
@muza7002 күн бұрын
instead of writing long enum CodingKeys: String, CodingKey { ... }, let decoder = JSONDecoder() decoder.keyDecodingStrategy = .convertFromSnakeCase that is it
@penguinwolf01252 жыл бұрын
Very good job! But I think you are mixing DTO, BO and VO objects. I know you do that for simplified code for newbies but they will learn the half of job. I like the way you teach, it just a comment.
@prashantsinghchauhan9442 жыл бұрын
Coin gecko api is no longer available:(
@SwiftfulThinking2 жыл бұрын
I believe they made the free api limited to 50/calls per minute. If you don’t refresh the canvas that often, you should still be fine to complete the course 😕
@prashantsinghchauhan9442 жыл бұрын
@@SwiftfulThinking thanks for your quick reply and it was helpful. Please create more content nick like fireball chat and verification, I would love to see you cover all that content 😍😍 Lots of love from 🇮🇳 🧡🙏🏼
@Nunny253 жыл бұрын
ufff ..done
@ameliasaomarcos3 жыл бұрын
Nice
@SwiftfulThinking3 жыл бұрын
Thanks vaisabehh 🥳
@knowledgeispower495310 ай бұрын
😇
@nazargorevyi1697 Жыл бұрын
Pls post a new API, current no longer free
@SwiftfulThinking Жыл бұрын
I believe they still have a free API it is just rate limited now (www.coingecko.com/en/api/documentation). If you disable the SwiftUI previews, it will likely trigger less often.
@bobbletopia6 ай бұрын
@@SwiftfulThinking Hi Nick. Thanks for all you do! Just wondering if there's an API you'd recommend, since CoinGecko seems to charge now?
@davehall60012 жыл бұрын
CoinGecko is no long 100% free. It has 4 subscription structures. The starter is free but only allow 50calls/minute.