This is a pretty cool article on things you probably didn't know in Swift. Or maybe things you've seen in Swift code that gave you a "WTF does that mean?" moment. Or maybe you feel like being a hipster. Or maybe you want to be able to say, "Oh, I knew about that thing in Swift before it was cool!". Or maybe, just maybe, you love me and support me by reading my posts. So what are you waiting for? Hurry up and click the link already!
Viewing entries in
Generic Protocols, man. They. Are. Hard. Easy to create, but difficult to work with. For simple scenarios, they play well for the most part but unfortunately, the more complexity you create whilst working with them, the more you start to realize how much work needs to be done on them.
In this post, I'll walk through how to create a generic protocol, where you ***can't*** use them, and a workaround you can use to help a brotha out.
The new 3D Touch is exciting. What's even better than that is that it can provide developers with a tool to make their apps even better than before. A cut above the rest if you will. (I'm looking at you, Android.) The problem is, there are way to many links to follow and dev docs to decrypt just to incorporate it in your app. Hopefully, these three links can serve as a guide to make you the cool kid in school.
Quite often we find ourselves marking our code with TODOs, FIXMEs, and ERRORs only to find some of them forgotten about and left by the wayside. In Objective-C, it was easy to mark these tags and have them show up in the Issue Navigator but since the introduction of Swift, we haven't gotten an equivalent to compiler directives that can do the equivalent. Until now.
Since Apple came out with Swift, most of us have focused on using it to write our iOS/Mac OS X applications; it was the first instinct we had upon learning the language. Hell, it was the only instinct I had when learning the language the day it first came out. It wasn't until 7 months later that I realized it was even more powerful than it seemed, and that scripting in swift was not only possible but quite easy!