Included in plans:
This conversion option currently affects the optionality of the following:
- Method parameters
- Return types
Currently, this conversion option does not affect the optionality of local variables.
With this conversion option, you can now treat pointer-type method parameters, return types, and properties as either:
- Optional (
?): Swiftify defaults to treating pointer-type parameters and return types as optional.
Implicitly Unwrapped Optional (
!): If you check the Swift interface for an Objective-C header file you'll find that Xcode imports Objective-C pointer type parameters and return values as implicitly unwrapped optionals in Swift.
Non-optional: Selecting this option reduces the number of optional unwrappings in the generated Swift code. If your code is wrapped between
NS_ASSUME_NONNULL_ENDmacros or for pointers marked as
nonnullthe converter output will be similar to the case if Non-optional was selected.
Converted Swift code with Optional mode selected:
Converted Swift code with Implicitly Unwrapped Optional mode selected:
Converted Swift code with Non-optional mode selected:
To toggle this feature open Preferences (⌘+,) => Converter and choose from the available options: