DRN
DRN

Reputation: 155

How can we remove comments from apple documentation code

Do we have any shortcut to remove iOS documentation commnets? When we copy the code from apple documentation it's copied along with ///. I would like to uncomment with the Xcode shortcut (if any).

///
///     struct PlayButton: View {
///         @Binding var isPlaying: Bool
///
///         var body: some View {
///             Button(action: {
///                 self.isPlaying.toggle()
///             }) {
///                 Image(systemName: isPlaying ? "pause.circle" : "play.circle")
///             }
///         }
///     }
///

Upvotes: 1

Views: 244

Answers (2)

Jeroen
Jeroen

Reputation: 2093

My approach would be to edit multiple lines simultaneously and remove them.

  1. Hold ⌥ Option
  2. Drag your cursor from the first line (behind the 3rd slash) to the last line (so in a straight line down)
  3. You're now editing multiple lines. Press delete 3 times to remove the slashes, then escape to exit this mode.

So in short: ⌥ Option + drag down on the lines you want to edit.

Upvotes: 1

Sharad Gangurde
Sharad Gangurde

Reputation: 1

You can select your code and use Command + /

Upvotes: 0

Related Questions