Guest User

Untitled

a guest
Dec 12th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. protocol AppModelRequest {
  2. func execute(model: SpecificAppModel)
  3. }
  4.  
  5. protocol AppModel: AnyObject {
  6. func perform(_ request: AppModelRequest)
  7. }
  8.  
  9. class SpecificAppModel: AppModel {
  10. private let queue = DispatchQueue(label: "AppModelQueue")
  11. public func perform(_ request: AppModelRequest) {
  12. queue.async {
  13. request.execute(model: self)
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment