AutoGenerateProtocolDelegate.swifttemplate 664 B

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