Is there any way to globally prevent ObjC headers ...
# compose-ios
a
Is there any way to globally prevent ObjC headers being generated for every public class or method of the shared module (based on the compose iOS template) without having to mark everything as internal or use the
HidesFromObjC/HiddenFromObjC
annotation? As in turn off globally and have the inverse of
HiddenFromObjC
as the Swift side (in my case) only requires access to a few things from the
:shared
module.
👍 1
o
You can create an extra ios-only (e.g. iosEntryPoint) module that depends on
:shared
. You would remove cocoapods framework declaration from ":shared" and add it in
:iosEntryPoint
instead. In
:iosEntryPoint
src you declare only those functions, which you want to be exported to objC. Should not contain the composable functions __ What issue did you encounter? The aim is that no one would need to care about adding
HiddenFromObjC
. There're some issues already reported, so I'm just curious if you had something new.
With 1.4.0 and kotlin 1.8.20 there's no need to mark everything internal or HiddenFromObjC. But as I mentioned, there're still some uncovered cases which lead to UnboundSymbol error For example, one of the issues was resolved - https://github.com/JetBrains/compose-multiplatform/issues/3216#issuecomment-1570152305
a
I did think about creating an entry point module actually, I was hoping it wouldn’t come to that though 😅. I encountered 2 issues so far: 1. with moko resources, I had a font that was oddly named, resulting in a kotlin property called
Bold-Extra
, which resulted in errors in
shared.h
(the fix was to either tell moko to keep the generated
MR
class internal or rename the font file). See screenshots. 2. the exact issue you sent 😅
o
Did I get you right that you have a workaround for moko issue and you can use 1.4.7-rc01 compiler plugin to overcome the getter issue? __ Btw, adding HiddenFromObjC only to the ``bold-Extra`` property should help too. Anyway, I think the issue with the exported property name can be reported to k/native team - https://youtrack.jetbrains.com/newIssue
a
I haven’t tried the
1.4.7-rc01
compiler plugin yet but I’ll give it a try. I can’t add
HiddenFromObjC
to generated code as it’ll get overwritten, I renamed the file to make the generated Kotlin property
boldExtra
😅