( swiftName: string, explicitObjcName?: string | null )
| 158 | * `explicitObjcName`.) |
| 159 | */ |
| 160 | export function objcAccessorsForSwiftProperty( |
| 161 | swiftName: string, |
| 162 | explicitObjcName?: string | null |
| 163 | ): { getter: string; setter: string } | null { |
| 164 | if (!swiftName) return null; |
| 165 | // The override syntax `@objc(customGetterName)` re-points the GETTER only; |
| 166 | // the setter still follows the `setX:` rule but is keyed off the override. |
| 167 | // (`@objc(getX:setY:)` is not currently supported — that's a rarer |
| 168 | // shape; can extend later if a real codebase needs it.) |
| 169 | const getter = explicitObjcName ?? swiftName; |
| 170 | return { |
| 171 | getter, |
| 172 | setter: `set${capFirst(getter)}:`, |
| 173 | }; |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Reverse: from an ObjC selector, return the candidate Swift base names |
no test coverage detected