1. Do not reinvent
the wheel
Make use of Cocoa libraries
and ready components
Mateusz Klimczak
2. Agenda
! Overview of the most popular Cocoa
libraries and ready components
! When to use ready components?
! CocoaPods – an easy way to organise
your components
! Let’s create our own Pod
! Use Gemfile to control the CocoaPods
version
! Discussion
3. ! Probably the most popular iOS library
! Main features:
! Encapsulates the common patterns of
communicating with a web application over
HTPP: GET, POST, PUT, DELETE, etc.
! Easy request serialisation
! Since 2.0 version support for caching
downloaded images (both in-memory and disk
caching)
! Network reachability manager
4. ReactiveCocoa
! Objective-C framework inspired by
Functional Reactive Programming
! Provides APIs for composing and
transforming streams of values
! Instead of using mutable variables RAC
provides signals that capture present and
future values
! Widely discussed on last meeting
6. ! Amazing tool for crash reporting with
support for both iOS and Android
! Provides detailed statistics about crashes
! Recently integrated into Twitter’s Fabric.IO
– mobile platform for mobile analytics,
app distribution and reporting
! Allows integration with Trello&BitBucket
! Live example!
7. CocoaLumberjack
! Logging framework for Mac and iOS
! Faster than NSLog
! Main features:
! Send logs over the network
! Use multiple loggers to log simultaneously to
many places (file, console, database)
! Define different log levels per logger
(e.g. log verbose to console, but briefly to
log server)
8. MagicalRecord
! Inspired by RoR Active Record Fetching
! Active Record is an approach to accessing
data in database
! Database table is wrapped into a class
! Object instance is tied to a single row in the
database table
! The wrapper class implements properties for
each column in the table
! Allows clear, simple, one-line fetches from
CoreData
9. FXKeychain
! Lightweight wrapper around the Apple
keychain API
! Exposes the commonly used functionality
while hiding complexity of underlying APIs
10. RHAddressBook
! Library for interfacing with the iOS
AddressBook
! All contact attributes on various objects
(Person, Group) are exposed as properties
– no more dealing with CF methods
11. TPKeyboardAvoiding
! Universal solution for moving text fields out
of the keyboard in iOS
! Uses UIScrollView/UITableView subclasses
that handles everything for you
12. PaymentKit
! Library providing utility methods for dealing
with credit card payments:
! Credit card number validation&formatting
! Expiration validation
! Credit card type checking
! Credit card providers icons fetching
! Ready to use UI components for to input
card data
14. XMLDictionary
! Library for parsing and generating XMLs
! Allows parsing XML received from server to
NSDictionary and vice versa
15. TSMessages
! Provides an easy to use class to show little
notification views on the top of the screen
16. MSDynamicsDrawerViewController
! Container view controller
that manages the
presentation of a single
view controller overlaid
over drawer view
controllers
! Supports swipe to open
and close the drawer
20. When to use ready
components?
! We want to save some time (it’s not
always worth it – to be continued)
! Library/component is still developed and
preferably have more than 1 contributor
! We don’t need a full control of the code
! We don’t need to provide a high-level
security
! If it is a UI component, we don’t have to
create highly customised interface
21. ! Dependency manager for Swift and
Objective-C project
! According to the http://rubygems.org
currently there are over 1.1 million downloads
of CocoaPods (it doesn’t mean that there are
that many users)
! http://cocoapods.org sites are generating
180k visits per month
! You can try the demo project of the Pod
without integrating it into your project
22. ! It’s easy to get started
! Installation:
! gem install cocoapods
! Create Podfile
! pod init
! Add pods references to your Podfile
! Run command:
! pod install
! Use .xcworkspace instead of .xcodeproj
23. ! Life example – let’s create our own Pod!
! Instructions:
http://guides.cocoapods.org/making/
making-a-cocoapod.html
24. Gemfile
! Use Gemfile to keep the same version of
CocoaPods for everyone in team
! Gemfile should specify the required version
of CocoaPods
! Install pods using:
! bundle exec pod install
25. Discussion!
! What libraries do you most often use?
! When do you prefer to write your own
code?
! Your experiences!