Tag Archives: Alamofire

How to Create a CocoaPod in Swift


via How to Create a CocoaPod in Swift – Ray Wenderlich.

You’re probably familiar with some well-known, open-source CocoaPods such as Alamofire or MBProgressHUD. But sometimes you can’t find a a pod with the exact functionality you need, or you may want to separate a large project into smaller, reusable components.

Fortunately, it’s easy to create your own CocoaPods!

If you’ve already created a Cocoa Touch framework for your component, you’ve already done most of the hard work. If you haven’t, don’t panic as it’s really straightforward.

If you’ve only ever created classes as part of an iOS app, that’s okay too. You can easily create a new pod by pulling out classes and functionality that make sense for your particular use case.

This tutorial picks up where How to Use CocoaPods with Swift ends. If you’ve never used CocoaPods before, then that tutorial is definitely a prerequisite to this one.

Otherwise, grab yourself a hot cup of “cocoa” (sorry, couldn’t resist!) and read on! :]

Alamofire


via Alamofire – NSHipster.

Swift has hit a reset button on the iOS developer community. It’s really been something to behold for seasoned Objective-C developers.

Literally overnight, conversations shifted from namespacing and swizzling to generics and type inference. At a time of the year when Twitter would normally be abuzz with discussion about the latest APIs or speculation about upcoming hardware announcements, the discourse has been dominated by all things Swift.

A new language with new syntax and evolving conventions, Swift has captured the attention and imagination of iOS & OS X developers both old and new.

Although we still have a few months to wait before we can ship apps in Swift, there is already a proliferation of open source projects built with this new language.

One such project is Alamofire. This week, we’ll take a look at the design and implementation of Alamofire, and how it’s using the language features of Swift to those ends.

Open Source Swift – A Look At The Top Swift Repositories


via Open Source Swift – Libraries Examined | iOS Swift Tutorials by Jameson Quave.

Github, the most popular open source repository for open source software, offers a feature that let’s us view repositories by language. In this post, I want to dissect some of the most popular Swift repositories as of June 5th, 2015. So, let’s kick it off with the most starred Swift repository, Alamofire.

Thoughts On AlamoFire: Swift’s AFNetworking Implementation


via Thoughts On AlamoFire — The Traveled iOS Developer’s Guide — Medium.

The HTTP protocol is synonymous with modern development. The experienced iOS developer understands and likely works with the popular protocol on a daily basis.

Unsurprisingly, iOS apps are no different in this regard. Thousands of apps and their engineers have trusted the popular AFNetworking library with everything from communicating with servers, parsing JSON, to providing place holder images while the intended ones are still being served up.

In short — it’s a tough act to follow. This week, we’ll look at the library intended to do just that: Alamofire.

3rd Party APIs and SDKs Libraries for iOS


There are a lot of third party APIs and SDKs you might want to include in your apps. These tutorials cover a few of them and show you how to get started.

Loading UITableViewCell Images from an API


via Loading UITableViewCell Images from an API – Grok Swift.

Previously we set up a Swift app that:

  • Pulled Star Wars species data from the Star Wars API using Alamofire
  • Used custom response serializers to process the JSON into an array of Swift objects
  • Parsed some string, array, and date fields in the web service JSON
  • Displayed the results in a tableview
  • Loaded more results as the user scrolled down in the tableview
  • Passed the tableview to a detail view, using a storyboard & segue. Tapping on a row in the tableview opened a detail view displaying additional data about that Star Wars species

Today we’ll add another feature: Images of each species in the table view, getting the URLs from a web-based API then loading the images asynchronously from the URLs. We’ll have to handle table view cells getting reused while we’re trying to retrieve the images and we’ll set up a cache so we don’t have to pull down the images every time a cell gets reused. The images will get pulled from DuckDuckGo’s Instant Answers API.

Alamofire Authentication: Basic & HTTP Headers


via Alamofire Authentication: Basic & HTTP Headers – Grok Swift.

Alamofire can be used to do Basic or HTTP header auth. Demo code for building a Swift app with a REST APIs using Parse takes about 2/3 of this post. Go straight to the core code for Basic Auth orHTTP header auth.

If you’re building an app based on a REST API you’re probably going to need to authenticate at some point. You might even need to authenticate to make any REST calls at all. Today we’ll set up a simple app using Parse as a backend. Using
<href=”https: github.com=”” alamofire=”” alamofire”=””>Alamofire, we’ll set up two types of authentication: basic auth and HTTP headers.