Xcode extension - quickly change access control level (public, private etc.) of selected Swift code by Editor menu item or keyboard command
Xcode extension to change the access control level of Swift code selection
Download from the Mac App Store – versions have now diverged – this repo contains the latest fixes
public
, private
, fileprivate
, internal
or no access control modifier. Choose an option from the new Access Level of Selection item at the bottom of Xcode's Editor menu:private
and fileprivate
code becomes internal
, internal
becomes public
, and any public
code stays as is.private
code stays as is, fileprivate
and internal
become private
, and public
code becomes internal
.internal
code to public
, exposing it as API for your frameworkpublic
code to be internal
, removing its visibility as APIprivate(set) internal var
) are treated separately: when incrementing/decrementing access, or making/removing API, overridden setters maintain their current access level. If the underlying entity ends up with the same access level as the overriden setter, the explicit override is removed. When setting code to a single access level, the explicit setter override is removed so the entire entity is set to the desired level.open
or final
for the moment, mostly because it’s a bit more work and just ship it already, and partly because I sort of feel those notations should require a bit more forethought when planning a framework.public
declarations of top level members in public
extensions. Work in progress, to come shortly 😅
Available to download now on the Mac App Store – versions have now diverged – this repo contains the latest fixes
The MAS and github versions are currently in sync woohoo! But if you want to install yourself:
Distribute
and export the created archive using the option Copy
to use locally. Save wherever you like.