Is there a specific way to append DispatchWorkItems to a DispatchQueue instead of re declaring them in code?
问题 I have several Dispatch work items to execute on a queue i don't want to redeclare the codes, i want to pass them to an array or list of DispatchWorkItems and then inject it to a dispatch queue is there any way to achieve this ? func executeDispatchWorkItem(url: String, completion : @escaping (Result<String,Error>)-> Void,beganHandler : @escaping (String)-> Void){ do { beganHandler("\(url) Began to execute ") let content = try String(contentsOf:URL(string: url)!) completion(.success(content))