Posts

You're using print() wrong!

It's likely that the first line of Swift you wrote went something like this:  print("Hello, world!") I'm telling you today that you're doing it wrong . What's wrong with print statements!? When you print in Swift, you send a text stream to an output device (i.e. the console screen).  This is extremely useful for debugging, but when used in production there are 2 major problems:  1. Security  2. Inefficiency  1. What are the security issues with print()?  When printing to the console, the output is accessible to your app's users - if a bad actor knows what she is doing, she can connect her device to a computer and read the live print statements of running apps.  As a side note - the exact same is true with your app's network calls by using Charles Proxy , so make sure not to send any sensitive data to the client! It's very easy to leave print statements for debugging forgotten about printed out in a live...

SwiftUI placeholders and SkeletonableView

This blog post is a draft. If you want me to hurry up and complete it, please email me at  jacobmartinbartlett@gmail.com  and I'll bump it up my priority list! - Talk about placeholders - Show how to use them, what they look like  - Show how to use a skeletonable view  - TODO: Make a SkeletonableView SwiftUI package to complement this blog post, allow it to have single and pull-to-refresh parameters (implemented using protocols)  public struct SkeletonableView : View { private var data: Model private var placeholder: Model @State private var timeoutRemaining: Int = 5 private let content: (Model) -> Content private let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() public init(data: Model, placeholder: Model, @ViewBuilder content: @escapi...