Swift Around the Web


Coding


Apple News


Other Cool Stuff

In Case You Missed It

Videos


Books

Swift Evolution

Swift Package Manager

ο£ΏWATCH

Swift Code

  • SwiftyStoreKit - Lightweight In App Purchases Swift framework for iOS 8.0+ and OSX 9.0+
  • Gifu - High-performance animated GIF support for iOS in Swift
  • TypedDefaults - TypedDefaults is a utility library to type-safely use NSUserDefaults. context tweet
  • Sensitive - Fresh look at work with gestures in Swift.
  • NumberMorphView - A label view for displaying numbers which can transition or animate using a technique called number tweening or number morphing.
  • SwiftImageProcessing - This project demonstrates how to do pixel operations in swift.

Swift ThoughtsSwift Thoughts

The NPM left-pad saga is a good reminder to be mindful of which (and how many) external libraries you use in your projects. This is especially true for Swift.

There are a lot of open-source libraries in Swift that provide a list of functions or utilities from other languages, such as Ruby or Haskell for example. Instead of installing the entire library, I tend to just copy / paste (and maybe modify if needed) only the functionality I need - especially if it's only a function or two. And of course I add a link to the library in the comments of my code to look through it later if needed!

Another bigger issue with Swift libraries is that they might not be updated to the version of Swift you need when you're updating your own project! I spent over a day trying to fix older open source Swift code that I really wanted to use only to end up just writing my own solution.

One way to monitor this is by looking into the how active the contributions to the libraries are. For example, based on previous commits, I am very confident that Quick will be updated with the latest Swift version the day that that version comes out! I also have more confidence that a project will be actively maintained when it's backed by a bigger company, such as IBM (of course we all know from Facebook's shut down of Parse that that might fail as well, but I think smaller one-person open source projects are more likely to fail / stop developing).

Finally, if you're working in a larger company and / or have a serious production app, it's good to keep your own copy of the external libraries in case the author decides to delete the original as happened in NPM's case!

NatashaTheRobot