hi, I made an interface for VPN applications for iOS, and I just need to make a connection to the protocol, I wanted to use wireguard, but I can’t do it, what can you suggest me?
Post
Replies
Boosts
Views
Activity
'consume' applied to value that the compiler does not support. This is a compiler bug. Please file a bug with a small example of the bug.
public func requestTopicsAndSubTopics() async throws -> (topics: [Topic], subTopics: [String: [SubTopic]]) {
var subTopics = [String: [SubTopic]]()
let topics = try await getTopics().sorted { $0.index < $1.index }
try await withThrowingTaskGroup(of: ([SubTopic], String).self) { [weak self] group in
guard let self else { return }
for topic in topics {
guard let topicId = topic.id else { throw Error.missingId }
group.addTask {
let subTopics = try await self.getSubtopics(topicId: topicId).sorted { $0.name < $1.name }
return (consume subTopics, topicId)
}
}
for try await (resultedSubTopics, topicId) in group {
subTopics.updateValue(resultedSubTopics, forKey: topicId)
}
}
return (consume topics, consume subTopics)
}