Skip to content

Conversation

@ottijp
Copy link
Contributor

@ottijp ottijp commented Feb 11, 2025

I fixed the issue #155.

I modified some existing example/*.swfit to match Xcode's style.
In addition, I applied auto-indentation to some swift files in my project and veried they're exactly the same as Xcode's formatting.

Was:

VStack {
    Button(action: {
               print("clicked")
               isShowingSheet2 = true
           }) {
               Text("click me")
    }
    .buttonStyle(.bordered)
}
.padding(12)
.frame(width: 200, height: 400)
.sheet(isPresented: Binding(get: { isShowingSheet2 },
                            set: { v in isShowingSheet2 = v }
                            ) {
              Text("sheet2")
}
)

Now:

VStack {
    Button(action: {
        print("clicked")
        isShowingSheet2 = true
    }) {
        Text("click me")
    }
    .buttonStyle(.bordered)
}
.padding(12)
.frame(width: 200, height: 400)
.sheet(isPresented: Binding(get: { isShowingSheet2 },
                            set: { v in isShowingSheet2 = v }
                           ) {
    Text("sheet2")
}
)

Diff:

--- was.txt     2025-02-11 21:24:53
+++ now.txt     2025-02-11 21:24:59
@@ -1,9 +1,9 @@
 VStack {
     Button(action: {
-               print("clicked")
-               isShowingSheet2 = true
-           }) {
-               Text("click me")
+        print("clicked")
+        isShowingSheet2 = true
+    }) {
+        Text("click me")
     }
     .buttonStyle(.bordered)
 }
@@ -11,7 +11,7 @@
 .frame(width: 200, height: 400)
 .sheet(isPresented: Binding(get: { isShowingSheet2 },
                             set: { v in isShowingSheet2 = v }
-                            ) {
-              Text("sheet2")
+                           ) {
+    Text("sheet2")
 }
 )

@ottijp ottijp marked this pull request as ready for review February 11, 2025 12:43
@keith keith merged commit c76b52c into keith:master Feb 11, 2025
1 check passed
@keith
Copy link
Owner

keith commented Feb 11, 2025

much nicer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants