title: How are Swift convenience constructors in extensions mapped to Kotlin?
body: <p>How do I call this Swift extension convenience constructor from Kotlin?</p>
  <pre class="lang-swift prettyprint-override"><code>public extension UIView {
    convenience init(svgData: Data, parser: SVGParser? = nil, completion: ((SVGLayer) -&gt; ())? = nil) {
    ...
  </code></pre>
  <p>According to the <a href="https://kotlinlang.org/docs/native-objc-interop.html#initializers" rel="nofollow noreferrer">Interop documentation</a>, i was expecting that this should work:</p>
  <pre class="lang-kotlin prettyprint-override"><code>create(svgData = data, parser = null, completion = null)
  </code></pre>
  <p>However, it doesn't compile (<code>Unresolved reference: create</code>) and it it seems like this approach would pollute the global namespace quite a bit. On the other hand, I can't really see a &quot;canonical&quot; mapping to some companinon object...</p>
  <p>p.s. I have read that static extension functions are possible via the companion object in Kotlin, but <code>UIView.Companion.create(...)</code> doesn't seem to work either.</p>
  <p>p.p.s.: As somebody had pointed out that the Kotlin mapping is based on ObjC (now deleted): perhaps this is relevant: <a href="https://stackoverflow.com/questions/36570564/is-it-possible-to-call-swift-convenience-initializer-in-objective-c/55515137">Is it possible to call Swift convenience initializer in Objective-C</a> (didn't help me to figure out the mapping though)</p>