Search code examples
iosobjective-cswiftsmartfoxserver

Objective-C code has property called "extension" which is keyword in Swift. How to set that property?


I am using SmartFoxServer iOS client API.

There is this property I need to set from Objective-C

@property (strong) RoomExtension *extension;

Unfortunately extension is keyword in Swift. I am trying to find some workaround to set the property as there is no constructor working with it.

Any suggestions will be great. I can, of course, move the whole thing to Objective-C side.


Solution

  • As described in the documentation Naming Constants and Variables, you can surround the name with the backtick character. For example:

    let `extension` = "something"