Swift 5 introduced a decent version of string interpolation with SE-228 and updated the old version of the ExpressibleByStringInterpolation protocol that has been deprecated since Swift 3. The new version of this protocol allows us to write powerful extensions to existing types that define how objects interact when used within string interpolation. While developing apps …
debug
Using Custom debug descriptions to improve debugging
Custom debug descriptions can help you debug your own custom objects, structs, errors, and other types. Whenever you print out an object you might end up with basic information that doesn’t really help you solve your issue. Printing out a struct shows you all the values while you might only be interested in one of …
Printing data requests using a custom URLProtocol
Almost all apps contain some kind of data requests. Printing data requests could sometimes be handy for debugging purposes. This can be done fairly easy by using a custom URLProtocol. Creating a custom URLProtocol A custom URLProtocol is needed to print out the data requests. A custom implementation of URLProtocol including the canInit method is …