UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Is there a way to unembed code?

Forums > SwiftUI

@Apps  

Suppose this code:

ScrollView {
      Section() {
        Text("Header")
          .font(.largeTitle)
      }
      ForEach(numbers, id: \.self) {
        Text("\($0)")
      }
    } // 1

Now suppose I want to remove the ScrollView, so this will be a 3 step operation:

  1. Double click the opening curluy brace at the ScrollView line to see where is the ending curly brace.
  2. comment the ScrollView line
  3. comment the curly brace at //1

Is there any shortcut or something that allows this to be done with one operation? I mean comment both lines but not the lines inside?

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.