Skip to content

Instantly share code, notes, and snippets.

View enisinanaj's full-sized avatar
🎯
Focusing

Eni Sinanaj enisinanaj

🎯
Focusing
View GitHub Profile
@enisinanaj
enisinanaj / BackgroundTransferSample.swift
Created April 4, 2019 14:48 — forked from toddhopkinson/BackgroundTransferSample.swift
Upload Very Large Files In Background on iOS - Alamofire.upload multipart in background
// You have a very very large video file you need to upload to a server while your app is backgrounded.
// Solve by using URLSession background functionality. I will here use Alamofire to enable multipart upload.
class Networking {
static let sharedInstance = Networking()
public var sessionManager: Alamofire.SessionManager // most of your web service clients will call through sessionManager
public var backgroundSessionManager: Alamofire.SessionManager // your web services you intend to keep running when the system backgrounds your app will use this
private init() {
self.sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default)
self.backgroundSessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.background(withIdentifier: "com.lava.app.backgroundtransfer"))
@enisinanaj
enisinanaj / API.md
Created March 4, 2016 14:09 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: