{"id":16685423,"url":"https://github.com/iamrsalman/dots","last_synced_at":"2025-10-16T13:21:03.933Z","repository":{"id":56908674,"uuid":"87134462","full_name":"iAmrSalman/Dots","owner":"iAmrSalman","description":"Lightweight Concurrent Networking Framework","archived":false,"fork":false,"pushed_at":"2018-04-08T23:34:20.000Z","size":132,"stargazers_count":38,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T03:51:27.529Z","etag":null,"topics":["carthage","cocoapods","concurrency","iamrsalman","ios","macos","networking","swift","swift-package-manager","tvos","watchos","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iAmrSalman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-04T00:42:57.000Z","updated_at":"2024-02-20T17:52:51.000Z","dependencies_parsed_at":"2022-08-21T03:50:21.559Z","dependency_job_id":null,"html_url":"https://github.com/iAmrSalman/Dots","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAmrSalman%2FDots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAmrSalman%2FDots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAmrSalman%2FDots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iAmrSalman%2FDots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iAmrSalman","download_url":"https://codeload.github.com/iAmrSalman/Dots/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244849276,"owners_count":20520679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","concurrency","iamrsalman","ios","macos","networking","swift","swift-package-manager","tvos","watchos","xcode"],"created_at":"2024-10-12T14:47:15.504Z","updated_at":"2025-10-06T23:53:05.260Z","avatar_url":"https://github.com/iAmrSalman.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dots\n\n[![CI Status](http://img.shields.io/travis/iAmrSalman/Dots.svg?style=flat)](https://travis-ci.org/iAmrSalman/Dots)\n[![Version](https://img.shields.io/cocoapods/v/Dots.svg?style=flat)](http://cocoapods.org/pods/Dots)\n[![License](https://img.shields.io/cocoapods/l/Dots.svg?style=flat)](http://cocoapods.org/pods/Dots)\n[![Platform](https://img.shields.io/cocoapods/p/Dots.svg?style=flat)](http://cocoapods.org/pods/Dots)\n\n![banner](https://user-images.githubusercontent.com/10261166/38473777-8ec657f2-3b95-11e8-9aa0-a07065d65ce2.png)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+\n- Xcode 8.0+\n- Swift 4.0+\n\n## Installation\n\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\n\u003e CocoaPods 1.1+ is required to build StorageManager.\n\nTo integrate StorageManager into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'Dots'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate StorageManager into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"iAmrSalman/Dots\" ~\u003e 0.5.0\n```\n\nRun `carthage update` to build the framework and drag the built `Dots.framework` into your Xcode project.\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but StorageManager does support its use on supported platforms. \n\nOnce you have your Swift package set up, adding StorageManager as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/iAmrSalman/Dots.git\", from: \"0.5.0\")\n]\n```\n\n## Usage\n\n### Making a Request\n\n```swift\nimport Dots\n\nDots.defualt.request(\"\u003cURL\u003e\") { (dot: Dot) in\n    \n  print(dot.response) // HTTP URL response\n  print(dot.data)     // server data\n  print(dot.error)    // Errors from request processing\n  print(dot.json)     // JSON dictionary [String: Any]\n\n}\n```\n\n### HTTP Methods\n\nThe `HTTPMethod` enumeration lists the HTTP methods:\n\n```swift\npublic enum HTTPMethod: String {\n  case options = \"OPTIONS\"\n  case get     = \"GET\"\n  case head    = \"HEAD\"\n  case post    = \"POST\"\n  case put     = \"PUT\"\n  case patch   = \"PATCH\"\n  case delete  = \"DELETE\"\n  case trace   = \"TRACE\"\n  case connect = \"CONNECT\"\n}\n```\n\nThese values can be passed as the `method` argument to the `request` Function:\n\n```swift\nDots.defualt.request(\"\u003cURL\u003e\") // method defaults to `.get`\nDots.defualt.request(\"\u003cURL\u003e\", method: .post)\nDots.defualt.request(\"\u003cURL\u003e\", method: .put)\nDots.defualt.request(\"\u003cURL\u003e\", method: .delete)\n```\n\nThe `request` method parameter defaults to `.get`.\n\n### Parameter Encoding\n\n#### GET Request With URL-Encoded Parameters\n\n```swift\nlet parameters: Parameters = [\"foo\": \"bar\"]\n\nDots.defualt.request(\"\u003cURL\u003e\", parameters: parameters) // defaults url encoding\nDots.defualt.request(\"\u003cURL\u003e\", parameters: parameters, encoding: .url)\n\n// \u003cURL\u003e?foo=bar\n```\n\n#### POST Request With URL-Encoded Parameters\n\n```swift\nlet parameters: Parameters = [\n  \"foo\": \"bar\",\n  \"baz\": [\"a\", 1],\n  \"qux\": [\n    \"x\": 1,\n    \"y\": 2,\n    \"z\": 3\n  ]\n]\n\nDots.defualt.request(\"\u003cURL\u003e\", method: .post, parameters: parameters) // defaults url encoding\nDots.defualt.request(\"\u003cURL\u003e\", method: .post, parameters: parameters, encoding: .url)\n\n//httpHeader: Content-Type: application/x-www-form-urlencoded; charset=utf-8\n\n// HTTP body: foo=bar\u0026baz[]=a\u0026baz[]=1\u0026qux[x]=1\u0026qux[y]=2\u0026qux[z]=3\n\n```\n\n#### POST Request With JSON-Encoded Parameters\n\n```swift\nlet parameters: Parameters = [\n  \"foo\": [1,2,3],\n  \"bar\": [\n    \"baz\": \"qux\"\n  ]\n]\n\nDots.defualt.request(\"\u003cURL\u003e\", method: .post, parameters: parameters, encoding: .json)\n\n//HTTP header: Content-Type: application/json\n\n// HTTP body: {\"foo\": [1, 2, 3], \"bar\": {\"baz\": \"qux\"}}\n\n```\n\n### HTTP Headers\n\nAdding 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`.\n\n```swift\nlet headers: HTTPHeaders = [\n  \"Authorization\": \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n  \"Accept\": \"application/json\"\n]\n\nDots.defualt.request(\"\u003cURL\u003e\", headers: headers)\n```\n\n### Concurrency\n\nChoosing between Asynchronous and Synchronous is supported\n\n```swift\nDots.defualt.request(\"\u003cURL\u003e\", concurrency: .async) // concurrency defaults to `.async`\nDots.defualt.request(\"\u003cURL\u003e\", concurrency: .sync)\n```\n\n### Maximum concurrent requests\n\nCustomizing Maximum concurrent requests executing simultaneously is supported.\n\nThe 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.\n\n```swift\nlet customDots = Dots(maxConcurrentOperation: \u003cInt\u003e)\ncustomDots.request(\"\u003cURL\u003e\") \n```\n\n### Extensions\n\n#### UIImageView\n\n```swift\nimageView.setImage(withURL: \"\u003cURL\u003e\")\n```\n\n## Author\n\nAmr Salman, iamrsalman@gmail.com\n\n## License\n\nDots is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrsalman%2Fdots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamrsalman%2Fdots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrsalman%2Fdots/lists"}