Latest 0.3.5
License MIT
Platforms ios 10.0
Frameworks UIKit

CI Status
Swift 3.1 compatible


To run the example project, clone the repo, and run pod install from the Example directory first.


  • iOS 10.0+
  • Xcode 8.0+
  • Swift 3.0+


Dots is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Dots"


Making a Request

import Dots

Dots.defualt.request("<URL>") { (dot: Dot) in

  print(dot.response) // HTTP URL response
  print(     // server data
  print(dot.error)    // Errors from request processing
  print(dot.json)     // JSON dictionary [String: Any]


HTTP Methods

The HTTPMethod enumeration lists the HTTP methods:

public enum HTTPMethod: String {
case options = "OPTIONS"
case get     = "GET"
case head    = "HEAD"
case post    = "POST"
case put     = "PUT"
case patch   = "PATCH"
case delete  = "DELETE"
case trace   = "TRACE"
case connect = "CONNECT"

These values can be passed as the method argument to the request Function:

Dots.defualt.request("<URL>") // method defaults to `.get`
Dots.defualt.request("<URL>", method: .post)
Dots.defualt.request("<URL>", method: .put)
Dots.defualt.request("<URL>", method: .delete)

The request method parameter defaults to .get.

Request With URL-Encoded Parameters

let parameters: Parameters = ["foo": "bar"]

// All three of these calls are equivalent
Dots.defualt.request("<URL>", parameters: parameters)

// <URL>?foo=bar

HTTP Headers

Adding a custom HTTP header to a Request is supported directly in the global request method. This makes it easy to attach HTTP headers to a Request.

let headers: HTTPHeaders = [
  "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
  "Accept": "application/json"

Dots.defualt.request("<URL>", headers: headers)


Choosing between Asynchronous and Synchronous is supported

Dots.defualt.request("<URL>", concurrency: .async) // concurrency defaults to `.async`
Dots.defualt.request("<URL>", concurrency: .sync)

Maximum concurrent requests

Customizing Maximum concurrent requests executing simultaneously is supported.

The defualt is checking if device is on cellular connection, maximum concurrent requests is restricted to 2, while Wi-Fi is executing up to 6 simultaneous requests.

let customDots = Dots(maxConcurrentOperation: <Int>)




imageView.setImage(withURL: "<URL>")


Amr Salman, [email protected]


Dots is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "Dots",
    "version": "0.3.5",
    "summary": "Lightweight iOS Concurrent Networking Framework.",
    "description": "Lightweight iOS Concurrent Networking Framework that will make developing your Apps easire and faster",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Amr Salman": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.3.5"
    "social_media_url": "https:[email protected]",
    "platforms": {
        "ios": "10.0"
    "source_files": "Dots/Classes/**/*",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This