Kurdtvs-Live-Kurdish-TV-Kur.../Mastodon/Template/AutoGenerateProtocolDelegat...

12 lines
664 B
Plaintext

<% for type in types.implementing["AutoGenerateProtocolDelegate"] {
guard let replaceOf = type.annotations["replaceOf"] as? String else { continue }
guard let replaceWith = type.annotations["replaceWith"] as? String else { continue }
guard let protocolToGenerate = type.annotations["protocolName"] as? String else { continue }
guard let aProtocol = types.protocols.first(where: { $0.name == protocolToGenerate }) else { continue } -%>
// sourcery:inline:<%= type.name %>.AutoGenerateProtocolDelegate
<% for method in aProtocol.methods { -%>
<%= method.name.replacingOccurrences(of: replaceOf, with: replaceWith) %>
<% } -%>
// sourcery:end
<% } %>