Codable Protocol with Any Type

Get Started

Any type Codable error

Let’s start with example ✍️

AnyCodable with types
AnyCodable with Enocde & Decode methods
Error type

How to use AnyCodable?

Use of AnyCodable
Access of AnyCodable
Type cast from Any to Primitive type

Complete code of AnyCodable





A programmer, mobile photographer. ,

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Deep Inside Views, State and Performance in SwiftUI

Xcode show “Failed to prepare device for development.” error handling

‘Missing package product <package name>’ error handling

SwiftUI: Understanding Declarative Programming

The Case Against Immutable Objects in Swift

Update Your App Screenshots on the Apple App Store. 透過App Store Connect 更新App在apple store的預覽圖

Using View Model Protocols in SwiftUI? You’re Doing it Wrong.

Run simulator iOS 14 on Xcode 11.3

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sanzeev Gautam

Sanzeev Gautam

A programmer, mobile photographer. ,

More from Medium

What is Swift Language and advantages and disadvantages?

Is Swift the Objective Choice now?

Swift + Combine: Getting Started

apple/swift-evolution 上關於 guard 的有趣討論