Most experienced developers are familiar with using dynamic proxies. They enable us to implement an interface at runtime and decide how to execute methods dynamically as they are invoked. This is very useful to add additional functionality around existing implementations (especially from third-party libraries) as described by the Decorator Pattern. However, Kotlin coroutines introduce a new set of problems when creating dynamic proxies. We'll explore how to properly detect and dynamically invoke suspend functions declared on an interface. The Setup First, create...

With all of the resources Google and Apple have poured into their ecosystems, creating cross-platform mobile applications is easier than ever. However, you still can’t get around the fact that building a native application means developing it twice - once for iOS and once for Android. Well, now thanks to a framework called Flutter, developers can create for both platforms at the same time. ...

Many times when developing an application for a customer, the requirement surfaces to handle uploaded files. It is a problem that has been solved many times, but typically not without causing the developer headaches in the process. When dealing with uploads, one has to consider a multitude of questions: What kinds of file are allowed? How big can the files get? How many can be uploaded and where do you store the files once uploaded? It can be a mess of...

Dealing with JSON is one of those tasks that almost every developer has to perform in order to construct data models with which to populate project views. However, building and testing a good data model can be time-consuming and prone to mistakes. JSON Parsing in Swift Before Codable Prior to Swift 4, Swift's Foundation library provided native JSON parsing by way of the JSONSerialization API. Simply put, JSONSerialization would convert an API payload into a collection of dictionaries with nested arrays. However,...