Parse string field JSON API response to the right data type | Hindi Tutorial

preview_player
Показать описание
Sometimes API developers return JSON response where every field is of the type string and to parse string JSON API response iOS developers create a api response model where every property is declared of the type string and that's a bad approach as it does more harm than good.

In this video we will explore how we can parse string JSON API response in Swift by setting the right data type

Given are the content of the video

0:00 introduction
0:16 problem statement
1:38 convincing the api devs
2:40 coding keys and decodable init function
3:09 code walkthrough
4:41 parsing string field json
5:22 setting the right data type
6:40 decodable init function
8:08 manual mapping
9:55 date manual mapping
11:09 mapping result
11:47 use of force unwrapping (crash operator)
13:49 trade-offs of manual mapping
14:45 concrete solution
15:00 subscribe like and share

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✅ Subscribe to the channel and stay ahead of everyone by following the right way for writing clean code in swift. 🔥🔥🔥🔥🔥

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Video links mentioned

-----------------------------------------------------------------------------------------------------------------------
📥 Download the source code from

-----------------------------------------------------------------------------------------------------------------------
############################################

Connect with me on social media
Instagram: codecat15

###########################################

#swiftApiTutorial #swiftTutorial #iostutorial
Рекомендации по теме
Комментарии
Автор

What if there time also coming along with date but what we need is only date.. is it required to have formatter with same format.. are we supposed to format it once again using other date formatter to get only date

hritiksharma
Автор

Your all videos are very informative.. Thanks 🎉

rachitsharma
Автор

Very much informative Ravi.. Great Tutorial as always

shivanshkumar
Автор

your explanations are good i stumbled acroos your channel today is their a possibility that you explain in English

programming
Автор

Without any exceptions this video is very useful.

cwansu
Автор

1 question here,
We are getting all details in string and casting it to particular datatype that should not be good approach because casting means we are not getting actual value ... and it is giving me optional value as well while casting right ?
So what is suggestion here ?

rachitsharma
Автор

sir need a video on existing projects,
Being a fresher I got a job, and I have to work on project, so many new things are there like finding particular view and ...

maqsdiadam
Автор

very useful video, can you plz share your editor theme and the font name plz?

abanoubashraf
Автор

Hi Sir, can you make a video on how can we use the Amazon product api ..

ankit
Автор

Ravi what if I don’t use coding key and make it direct Int(id) ?

BrorBall
Автор

Can we restrict to take screenshot in iOS app?

avijitnagare
Автор

brother I saw your json parsing playlist and it is 4 years old is that still valid today? pls answer me

RajveerSinghMann-sp
Автор

As always, very informative video, just one thing to ask, can't we make every model property to optional, to avoid crash of force unwrapping?

bhojakparth
Автор

Nice and informative video.
Can you create a video for handling day light saving, regional date, UTC date and what will be the ideal way for handling date inside app Or back end??

manojkumardas
Автор

Sir please make a video on fetch token(authentication) through jwt and then get data from Api after authentication

softtechmishrajiios
Автор

API is Hitting but it wants token what should i do

abdullahhafeez
Автор

Hello bhaiya, can you please make one video about chatGPT.
Is chatGPT is going to end developers job

tajhassan
join shbcf.ru