Blog about Swift: Tips and ideas to start your own

How to start your own Swift blog? It’s a question I get asked more and more. I’ve given some tips already in my interview with hackingwithswift.com, but it’s not as good as writing a dedicated post to help you start up your own blog. May 2nd, 2015 I wrote my very first blog post. At … 

 

Fileprivate vs private in Swift: The differences explained

Fileprivate and private are part of the access control modifiers in Swift. These keywords, together with internal, public, and open, make it possible to restrict access to parts of your code from code in other source files and modules. The private access level is the lowest and most restrictive level whereas open access is the … 

 

Required keyword usage in Swift classes and structs

The required keyword in Swift can be used in front of initializers in Swift. Its usage is simple and it’s a small use-case, but the usage of the keyword can easily be understood in the wrong way. Required initializers Some think that the required keyword makes only that initializer available when creating a class. Instead, … 

 

Alamofire vs URLSession: a comparison for networking in Swift

Alamofire and URLSession both help you to make network requests in Swift. The URLSession API is part of the foundation framework, whereas Alamofire needs to be added as an external dependency. Many developers doubt whether it’s needed to include an extra dependency on something basic like networking in Swift. In the end, it’s perfectly doable to implement a networking layer … 

 

For loop, for each, while, and repeat. Iterating in Swift

For loop, for each, and repeat are examples of control flow statements in Swift. Although most of them look similar, there are differences. Let’s go over them. For loop and collections The for loop might be the most well-known method for iteration over all programming languages. It’s also known as the for-in loop in Swift. For-In … 

 

If case, fallthrough, equatable, and enums in Swift

If case, guard case, fallthrough, and the CaseIteratable protocol. These are all terms which could sound familiar if you’ve worked a lot with enums in Swift. An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code. Let’s go over them in … 

 

Memory leaks prevention using an autoreleasepool in unit tests

Memory leaks often happen without notice. Although best practices like using a weak reference to self inside closures help a lot, it’s often not enough to prevent you from finding a certain memory peak during the development of a project. We can use memory graph debugging or Xcode Instruments to help find and fix leaked … 

 

SwiftLee 2018 in review: Top Swift Development blog posts

With 2019 coming closer it’s time to review SwiftLee in 2018 and list the top swift development blog posts of this year. The best thing about this all is that I can say that I’ve reached thousands of fellow Swift developers and possibly inspired or taught them with something they didn’t know yet. A weekly …