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

Опубликовано: 24 Декабрь 2022
на канале: Code Cat
2,329
71

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. 🔥🔥🔥🔥🔥

🔗Click on the link to subscribe: https://www.youtube.com/c/codecat?sub...

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

Video links mentioned

1. Don't define everything as string:    • Don't use string everywhere | Swift h...  

2. Manual decoding:    • Decode JSON manually in Swift using D...  

3. JSON Parsing (Coding keys):    • Decodable in swift | JsonDecoder in s...  


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

Github: https://github.com/codecat15/Youtube-...
-----------------------------------------------------------------------------------------------------------------------
############################################

Connect with me on social media
Instagram: codecat15
📧: codecat15@gmail.com
🐦:   / codecat15  
Facebook:   / code.cat.792  
Github: https://github.com/codecat15

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

#swiftApiTutorial #swiftTutorial #iostutorial


На этой странице сайта вы можете посмотреть видео онлайн Parse string field JSON API response to the right data type | Hindi Tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Code Cat 24 Декабрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 2,329 раз и оно понравилось 71 зрителям. Приятного просмотра!