Advertisement
rehannali

Libraries for iOS developer

Jun 5th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. Selection Criteria
  2. Rating iOS developer libraries is a rather subjective proposition. What makes one library “better” than the next? When libraries solve such a vast range of problems and no two are alike, it’s difficult to make logical comparisons and rank them in order of best to worst.
  3.  
  4. Fortunately, CocoaPods, a popular Swift and Objective-C dependency manager, collects anonymous stats when users install packages. I scraped its statistics site to find out which open-source packages are most popular right now, rather than polling my colleagues or trying to rate them for myself, and below are the results!
  5.  
  6.  
  7. 1. AFNetworking
  8. iOS developer librariesAFNetworking is an Objective-C networking library for iOS, macOS and tvOS. It is a robust library that has been around for many years. From basic networking to advanced features such as Network Reachability and SSL Pinning, AFNetworking has it all. It is one of the most popular iOS libraries of all time with almost 50 million downloads.
  9.  
  10. AFNetworking: https://github.com/AFNetworking/AFNetworking
  11. 2. SDWebImage
  12. SDWebImage is an asynchronous image downloader with caching. It has handy UIKit categories to do things such as set a UIImageView image to an URL. While networking has become a little bit easier in Cocoa over the years, the basic task of setting an image view to an image using an URL hasn’t improved much. SDWebImage helps ease a lot of pain, so that’s why it’s so popular with iOS app developers.
  13.  
  14. SDWebImage: https://github.com/rs/SDWebImage
  15. 3. Alamofire
  16. Alamofire is AFNetworking’s successor but is written in Swift. You might be wondering why there are two different networking libraries in the upper echelon of this list, but I assume it’s due to the fact that networking libraries are just extremely useful for iOS app development. The two libraries share a similar feature set, with the main difference being the language in which they are written.
  17.  
  18. If you are starting a brand new Swift project, my recommendation is to use Alamofire so that your core networking library is consistent with your own source code. Otherwise, both AFNetworking and Alamofire are great options.
  19.  
  20. Alamofire: https://github.com/Alamofire/Alamofire
  21. 4. MBProgressHUD
  22. MBProgressHUD is another useful library that fills a big hole in UIKit. This popular iOS developer library provides a class that displays a heads-up display (HUD) with a spinner, text, or images to show loading, progress, success/failure, or any other alerts to the user. Since iOS has long lacked a native HUD component, I don’t need to tell you how helpful such features are!
  23.  
  24. MBProgressHUD: https://github.com/jdg/MBProgressHUD
  25. 5. Masonry
  26. Masonry is a lightweight framework that makes wrestling with AutoLayout much less strenuous through simpler syntax. It provides its own chainable DSL that makes AutoLayout code more concise and readable. It also provides several helper methods for common layouts that will shorten over a dozen lines of code with AutoLayout to a single line. For example, if you want to set the edges of a UITableView to the edges of its superview, you can use this: make.edges.equalTo(self);
  27.  
  28. Masonry: https://github.com/SnapKit/Masonry
  29. 6. SwiftyJSON
  30. SwiftyJSON improves your life when it comes to handling JSON in Swift. Parsing JSON with Swift can be tricky due to type casting issues that make it difficult to deserialize model object, amd it may require a bunch of nested if statements. SwiftyJSON makes all of it quite simple to do. It’s also the second-most popular Swift library.
  31.  
  32. SwiftyJSON: https://github.com/SwiftyJSON/SwiftyJSON
  33. 7. SVProgressHUD
  34. SVProgressHud is another HUD library for iOS and tvOS. The API is a bit simpler than MBProgressHUD because it creates a singleton, so you just need to call show and hide when using it. You can also customize the HUD with text, an image, or a progress indicator. Again, there is definitely a need for this when developing apps, and it is a useful alternative to MBProgressHUD.
  35.  
  36. SVProgressHUD: https://github.com/SVProgressHUD/SVProgressHUD
  37. 8. MJRefresh
  38. MJRefresh offers you an easy way to add pull-to-refresh functionality to a UITableView. Unfortunately, the standard UIRefreshControl disappoints when it comes to customization options, so MJRefresh is a great stand-in that allows you to add text, an animation or even a UIView. You can also add pull-to-refresh actions in a block or closure, making it even easier to implement than the native UIActivityIndicatorView.
  39.  
  40. MJRefresh: https://github.com/CoderMJLee/MJRefresh
  41. 9. CocoaLumberjack
  42. CocoaLumberjack is a simple but powerful logging framework for all your logging needs. If you want to do more than NSLog or print, CocoaLumberjack can help. You can do remote logging, log to a local file, write to multiple loggers, and create different log levels. Ever had to reproduce an elusive bug, or needed to get a better grasp on some user behavior? CocoaLumberjack is very helpful in these cases.
  43.  
  44. CocoaLumberJack: https://github.com/CocoaLumberjack/CocoaLumberjack
  45. 10. Realm
  46. Realm is an enticing, cross-platform alternative to Core Data when it comes to persistence. It’s easier to work with than Core Data, as well as faster, and you even get a data browser to explore Realm database files. In case you need another reason to love Realm, this popular library for iOS app development recently launched a platform to sync data between apps in real-time.
  47.  
  48. If you need to do any data persistence, I’d definitely recommend checking out Realm as an alternative to Core Data.
  49.  
  50. Realm: https://github.com/realm/realm-cocoa
  51. We even have a couple of Realm video tutorial series to help you get started with Realm!
  52.  
  53. Beginning Realm on iOS
  54. Intermediate Realm on iOS
  55. Honorable Mentions
  56. Only two out of the most popular iOS developer libraries are written in Swift! Hard to believe when you’re living, breathing, and eating Swift.
  57. Here are a couple of Swift libraries that didn’t quite make the top 10, according to the data I pulled, but are worthy of your attention.
  58.  
  59. SnapKit
  60. SnapKit is another iOS library that simplifies AutoLayout simpler, and is similar to Masonry (above). In fact, SnapKit is a successor of Masonry that happens to be written in Swift. The authors of the library recommend that if you are starting a Swift project go with SnapKit, but if you are using Objective-C then go with Masonry.
  61.  
  62. SnapKit: https://github.com/SnapKit/SnapKit
  63. Kingfisher
  64. Similar to SDWebImage above, Kingfisher is a library for downloading and caching images that is written purely in Swift. It includes extensions for UIImageView and UIButton, which makes it more obliging. You can also add a placeholder image that should show while the actual image is downloading.
  65.  
  66. Kingfisher: https://github.com/onevcat/Kingfisher
  67. Many of the leading iOS libraries continue to be written for Objective-C, but I’m seeing new Swift libraries emerging regularly. Almost daily at times. The trend is shifting toward Swift. You’re seeing so many Objective-C libraries on this list years after Swift’s release because they are tried and true and trusted in tens of thousands of apps.
  68.  
  69. As we close out 2017, these are the most popular libraries according to the number of installs.
  70.  
  71.  
  72.  
  73. You can pull the data for yourself from this link: http://metrics.cocoapods.org/api/v1/pods/Alamofire.
  74.  
  75. Just swap Alamofire with whatever library you want to query, and remember that it is case-sensitive.
  76.  
  77. You should have a good idea of the best libraries to make your iOS app development experience a little smoother. Think I missed a great library? Or want to talk about your experiences with these libraries? Let’s talk about it in the forums.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement