Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How We Tamed Swift Syntax: the Open Source Style Guide

7,027 views

Published on

Recently, we’ve developed our first open source Swift app, with a few folks involved, and most of them new to Swift. Outlining our own Swift style guide so that we don’t get lost in our own work was a must and we wanted to share it.
Slides by Radek Szeja, iOS Dev at @netguru.
More about the guide: https://netguru.co/blog/swift-style-guide-open-source

Published in: Mobile
  • Be the first to comment

How We Tamed Swift Syntax: the Open Source Style Guide

  1. 1. STYLE%GUIDE @r.szeja /netguru/swi+,stye,guide
  2. 2. COMMON%STACK @r.szeja Experience Improvement Knowledge Stability Maintenance Pleasant&Syntax Experiments
  3. 3. COMMON%STACK @r.szeja AUTO&LAYOUT Objective-C / Swift USER&AUTHENTICATION NETWORKING UNIT&TESTS DATA&PERSISTENCE OTHERS
  4. 4. AUTO%LAYOUT @r.szeja PureLayout Masonry ObjecLveMC SwiN SnapKit PureLayout Cartography
  5. 5. AUTO%LAYOUT @r.szeja Very&autoMlayout’ish Claimed&to&be&engineered&&for&performance Syntax PureLayout Masonry Nice&ObjecLveMC&syntax Bugfix&only&state&M&use&SnapKit&instead Powerful Syntax Compromise&between&best&syntax&and&flexibility Looks&a&bit&complicated Verbose&syntax Powerful You&may&already&know&it
  6. 6. AUTO%LAYOUT @r.szeja Syntax PureLayout SnapKit ImperaLve&programming&only&! WriVen&in&SwiN Syntax&as&in&Masonry Syntax Very&autoMlayout’ish Claimed&to&be&engineered&&for&performance Compromise&between&best&syntax&and&flexibility Looks&a&bit&complicated Verbose&syntax Powerful ImperaLve&programming&in&SwiN PreVy&flexible
  7. 7. AUTO%LAYOUT @r.szeja Nice&declaraLve&syntax Very&easy&to&use Flexible Syntax NaLve&SwiN&of&course Had&some&problems&in&Roomguru&M&can’t&remind&specifics Cartography Nice&support&(4&issues&M&enhancements/help&M&&open,&75&closed)
  8. 8. USER%AUTH @r.szeja Not&well&known,&but&support&is&here Our&own&thing Very&good&maintenance&" Devise auth0&lock No&mobile&SDK&etc. Backend&soluLon
  9. 9. NETWORKING @r.szeja May&have&bugs Well&maintained May&lack&some&specific&features AFNetworking&has&not&so&good&success/failure&response&handling People&usually&wrap&them&anyway +1&dependency& AFNetworking%/%Alamofire Probably&well&known Both&wraps&NSURLSession
  10. 10. NETWORKING @r.szeja Flexible Easy&to&use Has&every&feature&that&may&be&needed Probably&not&that&well&known Easy&to&wrap&with&custom&classes No&dependency&needed NSURLSession
  11. 11. GO%% FOR%% @r.szeja NSURLSession
  12. 12. UNIT%TESTS @r.szeja Specta&/&Expecta ObjecLveMC SwiN Quick&/&Nimble =
  13. 13. UNIT%TESTS @r.szeja OHHTTPStubs Mocking&HTTP&Responses Nocilla A&bit&messy&syntax Works&with&SwiN We&know&how&to&use&it Nice&DSL Works&with&SwiN Stubbing&with&regex
  14. 14. DATA%PERSISTENCE @r.szeja Performs&well Many&informaLon&on&how&to&use&it CoreData Realm Realm&is&openMsourced Claimed&to&be&faster&than&raw&SQLite Internal&C++&Core&not&openMsourced&yet Advanced&and&full&of&features Mature Promising&&&young&M&0.93.1 Seems&to&be&easy&to&use 117&issues&on&GH,&but&665&closed!What&doesn’t&mean&great ThreadMsafety&problems&M&hard&to&do&it&right Tons&of&boilerplate SQLite&based Missing&some&features&M&NoLficaLons&&&KVO NSDate&truncated&to&seconds&# LimitaLons&on&name&length&&&NSData&sizeAlways&makes&some&problems
  15. 15. OTHER @r.szeja Timepiece CryptoSwiN KeychainAccess SwiNyJSON SwiNyUserDefaults Async SwiNRecord NSDate EncrypLon Keychain JSON GCD CoreData NSUserDefaults DateTools RNCryptor UICKeyChainStore ??? M&/&??? M MagicalRecord ValidaLon NGRValidator NGRValidator
  16. 16. THANKS @r.szeja 18.05%9%2.06.2015

×