skip to Main Content

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")
///             }
///         }
///     }
///

2

Answers


  1. You can select your code and use Command + /

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search