Skip to content

fpg1503/OptionalOutlets

Repository files navigation

OptionalOutlets

This Xcode plugin makes @IBOutlets Optional and private in Xcode.

OptionalOutlets demo

OptionalOutlets
Supports weak and strong Outlets and Collections
Super easy installation
💪 ImplicitlyUnwrappedOptionals are ugly, say goodbye to them!
🙈 Outlets should be private, now they are!

Installation

Alcatraz

You can install OptionalOutlets using Alcatraz.

First, install Alcatraz using

curl -fsSL https://raw.githubusercontent.com/supermarin/Alcatraz/deploy/Scripts/install.sh | sh
  • Restart Xcode
  • Click on Window
  • Select Package Manager
  • Search and Install OptionalOutlets
  • Restart Xcode

Manually

You can also install the plugin manually by cloning this repository and building the project. It'll be installed on ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OptionalOutlets.xcplugin.

You should restart Xcode after that.

What does this do?

The primary goal of this plugin is to make @IBOutlets Optional. By default, Xcode uses ImplicitlyUnwrappedOptionals, but that's dangerous and even though you can safely unwrap them most people don't. The secondary goal is to make your @IBOutlets private. Using outlets outside a class is a code smell and seldom is needed. This plugin automatically makes your outlets Optional and private, simple as that! Don't worry, they are independent rules and you can disable them at any time.

🚀 Let's Make Xcode Great Again™

Special Thanks

Need help?

Please submit an issue on GitHub and provide information about your setup.

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

About

❓ An Xcode plugin to make @IBOutlets Optional

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published