My Swift code property is defined as follows: ```@...
# ios
m
My Swift code property is defined as follows:
Copy code
@objc public var isSmartEqualizerEnabled: Bool = false
Which generates the Obj-C header as:
Copy code
@property (nonatomic) BOOL isSmartEqualizerEnabled;
However my KNM cinterop generates separate getters and setts for instance:
Copy code
@kotlin.commonizer.ObjCCallable
public open expect fun isSmartEqualizerEnabled(): kotlin.Boolean { /* compiled code */ }

@kotlin.commonizer.ObjCCallable
public open expect fun setIsSmartEqualizerEnabled(isSmartEqualizerEnabled: kotlin.Boolean): kotlin.Unit { /* compiled code */ }
Is it possible to configure knp to generate direct property access?
a
In Obj-C, there is no such thing as property on binary level. 2 methods used instead. KMM generates header that contains 3 items: getter, setter and property itself (that wraps getter and setter methods), so such expression should be available:
Copy code
yourObject.isSmartEqualizerEnabled = true
m
@Andrei Salavei thanks, so for me the header only contains 2 items - the getter and setter.
a
Just wondering, do you have access to properties from UIKit/Foundation frameworks in Kotlin iOS target? Something like:
Copy code
val url = NSURL(string = "<https://google.com/search>")
val isSearch = url.path == "search"
Btw, did you try just using
isSmartEqualizerEnabled
as a property. What says compiler?
m
appears so: