iosSwiftImplTemplate function

String iosSwiftImplTemplate(
  1. String className
)

Implementation

String iosSwiftImplTemplate(String className) => '''
import Foundation

/// Native implementation of Hybrid${className}Protocol.
/// This file is yours to edit — the protocol is generated by `nitrogen generate`.
public class ${className}Impl: NSObject, Hybrid${className}Protocol {

    public func add(a: Double, b: Double) -> Double {
        return a + b
    }

    public func getGreeting(name: String) async throws -> String {
        return "Hello, \\(name)!"
    }
}
''';