HiliteHttp 0.1.8-alpha

HiliteHttp 0.1.8-alpha

TestsTested
LangLanguage SwiftSwift
License Apache 2
ReleasedLast Release Feb 2017
SPMSupports SPM

Maintained by prestonwpope.



 
Depends on:
SwiftyJSON>= 0
HiliteCore~> 0.1.10-alpha
AWSS3~> 2.1.0
AWSCognito~> 2.1.0
 

HiliteHttp 0.1.8-alpha

  • By
  • Preston Pope

HiliteHttp

HiliteSDK Http module - facilitates communication with the HILITE api

Integration

Usage

import HiliteCore
import HiliteHttp

class TaskViewController: UIViewController {
  let taskAgent = TaskFeedAgent(taskService: HttpTaskService(), delegate: self)

  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    taskAgent.reloadWithOnSuccess(_ onSuccess: @escaping (Array<FeedItemAgent>)->Void, onError: @escaping (Error!)->Void) {

    let onLoaded = { (loadedFeedItems) in 
      // do something with loaded items
    }

    let onError = { (error) in
      print(error.localizedDescription)
    }

    taskAgent.reloadWithOnSuccess(onLoaded, onError: onError)
  }
}

extension TaskViewController: TasksAgentDelegate {
  func taskAgent(_ taskAgent: TaskFeedAgent, didSelectTask: Task, presentFrom: PresentFrom?) {
    // do something with selected task
  }
}