In Swift enums are much more powerful than we got used to in other languages. One of the features that makes them more interesting to use is associated values - values that each instance of enum case can carry along with it. We can not have stored properties in the enum, so associated values is basically the only way to store additional data with enum value. Creating an enum value with associated value has a similar semantics as a method call. The difference is - we can not define defaults for parameters which represent associated values.
I think adding default implementations to protocols should be considered very very carefully. The default needs to be something that is consistent and is the default for most cases, so if someone forgets to implement it (because the compiler won’t complain), it’s most likely not a big deal.
My perspective on comments comes from two facts: 1) Comments don’t compile. 2) Comments are usually a subdued color in your syntax highlighter. Because they don’t compile and because they fade away from sight, it’s very easy to ignore them as you make changes to the code. If you make changes and don’t update the comments, you end up with a comment that doesn’t accurately reflect the content of code.
One thing I’ve noticed recently in my code-base is that I tend to default to guard vs if. In fact, whenever I write an if statement, I facepalm myself and change it to a guard without thinking much.
Making a table view header that automatically adjusts its height to allow its contents to fit should not be so hard. Unfortunately it is a problem that has been with us for a number of years which means much of the advice on how to do it is out of date. This is what works for me for both iOS 9 and iOS 10.
In this talk you’ll discover what Mixins & Traits are, and how they can help you solve some interesting problems and make your architecture more flexible. Using some concrete examples, we’ll see also how these can be used in everyday challenges.
at OedoRubyKaigi 06
Talk at Ruby conference, but it looks useful for Swift developer!
A command line tool for cleaning unused resources in Xcode.
A Swift library to interact with GPIO/SPI/PWM on Linux/ARM boards (RaspberryPi, BeagleBone, CHIP, etc…)
Set of easy to use debugging tools for iOS developers & QA engineers.
I’ve recently found myself reflecting a lot on being a distributed team and the nature of a company where the team works from remote locations to accomplish our work.
Get 1 email when an issue or PR closes (instead of getting a million emails by subscribing)
Building apps with acquisition in mind, calculating your app’s valuation, and what to expect in a sale.
Every Swift developer who has migrated code bases from Swift 1.x to 2.x, or even the more tedious 2.x to 3.x knows the pain of migrating to new Swift versions.
I found the filter function in Xcode console.
Have a lovely week <3