Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protocol AppModelRequest {
- func execute(model: SpecificAppModel)
- }
- protocol AppModel: AnyObject {
- func perform(_ request: AppModelRequest)
- }
- class SpecificAppModel: AppModel {
- private let queue = DispatchQueue(label: "AppModelQueue")
- public func perform(_ request: AppModelRequest) {
- queue.async {
- request.execute(model: self)
- }
- }
- }
Add Comment
Please, Sign In to add comment