Parse JSON in Swift without Codable [Arrays and Dictionaries]

Since Swift 4, the recommended way to parse JSON data is to use the Codable protocols with the JSONEncoder and JSONDecoder classes.

However, this method requires creating Swift model types that match the JSON data structure you need to decode.

Sometimes, you might want to avoid creating extra Swift types if you only need to read some of the information in the JSON data locally.

Date decoding strategies in Swift [with Examples]

The Date type is a Codable type in Swift. However, dates are not straightforward to decode, like other types conforming to the Codable protocol, because the default format used by JSONDecoder is not standard in JSON.

Dates can be encoded using different formats in JSON data. To handle all these formats, the JSONDecoder class has a  dateDecodingStrategy property, which can be configured with several decoding strategies according to the date format you must decode.

MVVM in SwiftUI for a Better Architecture [with Example]

Since the introduction of SwiftUI, the MVVM pattern has experienced a renaissance. Many developers believe this particular pattern aligns well with the SwiftUI data flow.

MVVM  incorporates good ideas but also introduces problems due to varying interpretations of the pattern and its perceived rigidity.

In this article, we’ll explore how MVVM fits into SwiftUI, how to leverage its advantages, and how to navigate its challenges.