MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / objcAccessorsForSwiftProperty

Function objcAccessorsForSwiftProperty

src/resolution/swift-objc-bridge.ts:160–174  ·  view source on GitHub ↗
(
  swiftName: string,
  explicitObjcName?: string | null
)

Source from the content-addressed store, hash-verified

158 * `explicitObjcName`.)
159 */
160export 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

Callers 1

Calls 1

capFirstFunction · 0.85

Tested by

no test coverage detected