louiscad
10/18/2018, 3:19 PMlet label = UILabel(frame: CGRect(x: 0, y: 0, width: 300, height: 21))
label.center = CGPoint(x: 160, y: 285)
label.textAlignment = .center
label.font = label.font.withSize(25)
label.text = CommonKt.createApplicationScreenMessage()
view.addSubview(label)
Per the Obj-C interop doc, I should be able to write val label = UILabel.create(frame: CGRect.create(x = 0, y = 0, width = 300, height = 21))
for the first line, but there's no create(…)
function in the autocomplete when using IntelliJ CE 2018.3 EAP with Kotlin 1.3.0-rc-146… Can anyone give me a hint?russhwolf
10/18/2018, 3:25 PMAnaR
10/18/2018, 3:26 PMolonho
10/18/2018, 4:53 PMval label = UILabel(CGRectMake(x = 0.0, y = 0.0, width = 300.0, height = 21.0)).apply {
center = CGPointMake(x = 160.0, y = 285.0)
textAlignment = NSTextAlignmentCenter
font = font().fontWithSize(25.0)
text = "Hello"
}
olonho
10/18/2018, 4:54 PMlouiscad
10/19/2018, 4:15 AMMake
suffix? Is this a Kotlin/Native or Obj-C convention?
Also, I wonder why the initializers overloads (that you translate to the non existing concept of extension constructors) are not exposed as operator fun invoke(…)
on the generated companion object
?olonho
10/19/2018, 4:56 AM