Recently I've done a small service (available in Github) to return a switch case structure from a given enum
.
The next step is to achieve this behaviour as an Xcode code completion option when I begin typing the enumeration name.
What I want is to add a new option in this popup giving the possibility of generating a switch case with those three options.
I'm searching for documentation to make an Xcode plugin but I can't find much. My first question, and the most important is: is it possible to get the definition of a symbol while I'm typing it, to extract the data of the enum and generate the snippet?
Conversation. Xcode tip #9: Xcode has great code completion built right in, but sometimes as you scroll through the options you might find the names are too long to fit. Fortunately, you can just grab the edge of the autocomplete popup and drag it as wide as you want!
Go to Xcode > Preferences > Text Editing again. Quit out of Xcode and then relaunch Xcode. Now go to Code completion and check 'Suggest completions while typing'. Try typing library function or enum and enjoy!
P: property (IIRC Xcode favors L/V for Swift, but you see P for ObjC properties)
Pros: Xcode is the best tool for developing iOS apps in Swift: it's very well integrated with the language, the compiler and the source control (Git). You can easily start developing your first mobile app for iPhone or you can use it for huge and professional products.
You can have a look at KSImageNamed, an XCode plug-in used to add autocompletion on image name.
You can inspire yourself on its code.
KSImageNamed-Xcode
an alternative to what you are suggesting is to save it as a code snippet. it wont be dynamic like you probably want it, but if you are using the same enum over and over, it can work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With