Skip to content

julianshen/das-quadrat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Das Quadrat

Das Quadrat is Foursquare API wrapper written in Swift.

###Features

  • Supports iOS and OSX.
  • Covers all API endpoints.
  • Authorization process implemented for both platforms.
  • Native authorization on iOS.
  • Image downloader/uploader.
  • Image cache.
  • Supports multiple accounts.

###Installation

#####As Embedded framework (iOS 8.0+)

  1. Add Das Quadrat as a submodule. git submodule add git@github.com:Constantine-Fry/das-quadrat.git
  2. Drag-and-drop Quadrat.xcodeproj into your project. The project has two targets: Quadrat.framework for OSX project, QuadratTouch.framework for iOS projects.
  3. Add new target in "Build Phases" -> "Target Dependencies".
  4. Click the + button at the top left of the panel and choose "New copy files phase".
  • Rename the new phase to "Copy Frameworks".
  • Set the "Destination" to "Frameworks".
  1. Add Quadrat framework to this phase.
  2. Here is the image to visualise the result.
  3. Read wiki for details.

You can add source code files directly into your project to support iOS 7.0.

###Usage

#####Setup session

let client = Client(clientID:       "FOO.................FOO",
   					clientSecret:   "BAR.................BAR",
    				redirectURL:    "testapp123://foursquare")
var configuration = Configuration(client:client)
Session.setupSharedSessionWithConfiguration(configuration)

let session = Session.sharedSession()

#####Search request

var parameters = [Parameter.query:"Burgers"]
parameters += self.location.parameters()
let searchTask = session.venues.search(parameters) {
    (result) -> Void in
    if let response = result.response {
		self.venues = response["venues"] as [JSONParameters]?
		self.tableView.reloadData()
    }
}
searchTask.start()

#####Multi request

let task1 = self.quadratSession.users.get()
let task2 = self.quadratSession.users.friends(userId: "self", parameters: nil)

let multiTask = self.quadratSession.multi.get([task1, task2]){
	(responses) -> Void in
	println(responses)
}
multiTask.start()

###Requirements

Swift 1.2 / iOS 8.0+ / Mac OS X 10.9+

###License

The BSD 2-Clause License. See License.txt for details.

=========== Bonn, December 2014.

About

A Swift wrapper for Foursquare API. iOS and OSX.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 99.3%
  • C++ 0.7%