- Install Objective-C
- Default Features
- Buck-enabled Features
By installing Xcode, you will have full access to Objective-C.
Linux does not have Xcode. However, there are ways to compile Objective-C programs on Linux using
Objective-C’s integration into Nuclide provides you with productivity features out-of-the-box such as:
Automatic Square Bracket Completion
If you forget to put a starting bracket at the front of your target or selector, one will be inserted for you automatically if you add the ending bracket. This will work for any number of bracket levels deep.
For example, if you add an ending bracket here…
… then the beginning bracket is inserted for you automatically.
To enable this setting:
- Open the Nuclide Settings tab either by pressing
Ctrl-,on Linux) or by going to
Package | Settings View | Open.
- Select Packages from the list at the left, and search for
- Click on the Settings button for the
- Scroll down until you find
nuclide-objc, and select the Enable Automatic Square Bracket Completion checkbox.
Automatic Colon Indenting
Nuclide will automatically indent the colons (
:) associated with new method arguments to be
aligned with the arguments of that method.
If you start a
: at the beginning of the next line after the method declaration…
… it will be aligned automatically.
The following features require that your Objective-C project is compiled with Buck.
The Buck toolbar allows you to build and run your Buck-enabled programs.
If you write code that will cause
clang errors or warnings, Nuclide’s Code Diagnostics will show
you the error. You can see the error in two places: inline within the
Editing Area, and in the Code Diagnostics pane below.
Hover over the sideways red triangle in the gutter to see the
clang error inline.
Hovering over an Objective-C object will provide you the type of that object inline.
In fact, you can even pin that type hint so that it always displays. Just click on the pin icon when hovering over a variable to pin it.
x icon of a pinned type hint to remove it.
Pinned type hints can be moved anywhere within the editor.
Buck enhances the understanding of the types of objects in your project so that autocomplete can be enabled.
Without Buck, you will still get the default autocomplete feature, but without project and object specific information.
Jump To Definition
Nuclide provides a jump to definition/symbol feature for Objective-C programs.
For example, if you want to go to the definition of
initWithHelloString:, hover over
initWithHelloString: and either press
Cmd-<mouse click> (
Ctrl-<mouse click> on Linux) or
Ctrl-Alt-Enter on Linux).
Jump Between Header and Implementation
Ctrl-Alt-N on Linux), you can jump between the header (i.e.,
the implementation (i.e.,
Debugging Swift applications is currently not supported.
See the Buck guide for how to build, run and debug iOS apps.
Optimally, it would be nice to run the application directly from Xcode and attach to the simulator process associated with that Xcode project. However, due to
lldbprocess conflict issues, this is currently not possible.