S Link
Swift Around the Web
Swift 3 Access Controls
On switching to Swift 3.0, I have been using fileprivate
everywhere and completely forgot that private
still exists. Love @kharrison's clear explanation on the difference between the two:
"The problem is that the
private
access level restricts access to the property to the enclosing class declaration. The extension is not allowed access even though it is in the same source file. The solution is to switch the access level tofileprivate
."
Option Sets in Swift
Great explanation of Option Sets, which I find a bit confusing, especially this:
"Note that the compiler doesnβt automatically assign ascending powers of two to the options you provide; it is your responsibility to do this correctly so that each option represents a single bit of the rawValue. If you assigned consecutive integers (1, 2, 3, β¦) to the options, itβd be impossible to distinguish between .swimming (which would have the value 3) and [.running, .cycling] (which would be 1 + 2)."
Coding
Introducing the Realm Mobile Platform: Realtime Sync Plus Fully Open Source Database
This is exactly what I wanted Parse to become before it shut down. Love the "offline-first" mentality. Super excited about the potential and really hope it won't be bought and shut down any time soon!
Protocol Buffers in your Kitura Apps
Last week, I included a link to Apple's newest open source library Swift Protobuf. I haven't ever heard of a protobuf buffer before, but it's supposed to be a type-safe JSON alternative. Looks amazing!
This week, I'm super excited to see an actual example of Swift Protobuf in action, especially with the server-side Swift combination!
Design
Product Design for Sustainability
I haven't thought of adding sustainability as a metric for mobile apps. Pretty fascinating article on the tiny design changes popular apps can make for a big π impact.
Other Cool Stuff
SpaceX Interplanetary Transport System
Take me ππ»π!!!!!! That said, I do hope we don't go and destroy another planet... Some good points on the subject here.
Videos
Lessons Learned Rewriting Instagramβs Feed
@_ryannystrom's try! Swift NYC talk is out! Ryan discusses the pain of diffing in collection views, π code, and how the Instagram team rewrote their feed from the ground up. Oh, and he introduces the amazing fully Swift-compatible IGListKit for the first time. Looking forward to seeing it open source soon!
Swift Evolution
SE-0143: Conditional conformances
I'm super excited about the implementation of the Generics Manifesto in Swift 4. Super cool to start seeing the proposals in review πππ
Swift Code
- IoniconsKit - Use ionicons as UIImage / UIFont in your projects with Swifty manners.
- BentoMap - Map Clustering for Swift. Blog post here.
- tmdiff - Performs a command-line text diff on a file and its time machine ancestor
- SwiftInitializerGenerator - Xcode 8 Source Code Extension to Generate Swift Initializers
- PlaygroundBookGenerator - Ruby scripts that can generate a whole Swift Playgrounds for iPad book from a Markdown file
- Expression - A Mac and iOS library for evaluating numeric expressions at runtime
Other Platforms
Porting the Swift Runtime to Android: The How
This is not something I would even know how to approach, but @modocache breaks it down and makes it so simple, I can actually understand what's going on!
"The Swift compiler is a program that simply translates Swift source code into an intermediate representation, called LLVM IR. LLVM is a program that translates LLVM IR into assembly code. Assembly code is a slightly more readable version of the 0βs and 1βs that are used to represent machine instructions. LLVM can generate assembly for many different platforms, including Android, PS4, and Windows.
Swift already generates LLVM IR, and LLVM can already turn IR into assembly code for Android. The pull request I sent to βportβ the Swift runtime to Android merely added a few command line options, as well as some glue code to get it to build."
Swift Thoughts
Last week, I've been looking into restructuring Notifications for iOS 10 optimization. One thing I forgot about from WWDC was Notification Extensions - when you 3D Touch a notification, it expands to show much richer content potentially. I've tried it with the notifications I receive, and none of them have this implemented. Definitely something to play with!
In other news, Swift is on π₯!!