Skip to content

Commit 4e55aac

Browse files
committed
clean up code
1 parent d406972 commit 4e55aac

11 files changed

Lines changed: 17 additions & 58 deletions

Xcodes/Frontend/InfoPane/CompatibilityView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ private struct WrapperView: View {
5050
Text("Is Nil?")
5151
}
5252
}
53-
.animation(.default)
5453
.frame(width: 200, height: 100)
5554
.padding()
5655
}

Xcodes/Frontend/InfoPane/CompilersView.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ private struct WrapperView: View {
6565

6666
var body: some View {
6767
VStack {
68-
HStack {
69-
CompilersView(compilers: compilers)
70-
.border(.red)
71-
}
68+
CompilersView(compilers: compilers)
69+
.border(.red)
7270
Spacer()
7371
Toggle(isOn: $isNil) {
7472
Text("Is Nil?")
7573
}
7674
}
77-
.animation(.default)
7875
.frame(width: 200, height: 100)
7976
.padding()
8077
}

Xcodes/Frontend/InfoPane/IconView.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,19 @@ private struct WrapperView: View {
4242
@State var isIcon = false
4343
var state: XcodeInstallState {
4444
isIcon
45-
? XcodeInstallState.notInstalled
46-
: XcodeInstallState.installed(Path("/Applications/Xcode.app")!)
45+
? XcodeInstallState.installed(Path("/Applications/Xcode.app")!)
46+
: XcodeInstallState.notInstalled
4747
}
4848

4949
var body: some View {
5050
VStack {
51-
HStack {
52-
IconView(installState: state)
53-
.border(.red)
54-
}
51+
IconView(installState: state)
52+
.border(.red)
5553
Spacer()
5654
Toggle(isOn: $isIcon) {
57-
Text("Is an Icon?")
55+
Text("Icon?")
5856
}
5957
}
60-
.animation(.default)
6158
.frame(width: 300, height: 100)
6259
.padding()
6360
}

Xcodes/Frontend/InfoPane/IdenticalBuildView.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ struct IdenticalBuildsView: View {
3333
.font(.subheadline)
3434
}
3535
}
36-
.frame(maxWidth: .infinity, alignment: .leading)
3736
.accessibilityElement()
3837
.accessibility(label: Text("IdenticalBuilds"))
3938
.accessibility(value: Text(accessibilityDescription))
@@ -67,16 +66,13 @@ private struct WrapperView: View {
6766

6867
var body: some View {
6968
VStack {
70-
HStack {
71-
IdenticalBuildsView(builds: builds)
69+
IdenticalBuildsView(builds: builds)
7270
.border(.red)
73-
}
7471
Spacer()
7572
Toggle(isOn: $isEmpty) {
76-
Text("Is Empty?")
73+
Text("No Builds?")
7774
}
7875
}
79-
.animation(.default)
8076
.frame(width: 300, height: 100)
8177
.padding()
8278
}

Xcodes/Frontend/InfoPane/InfoPane.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct InfoPane: View {
2727
)
2828
case let .installing(installationStep):
2929
InstallationStepDetailView(installationStep: installationStep)
30-
.fixedSize(horizontal: false, vertical: true)
3130
CancelInstallButton(xcode: xcode)
3231
case .installed:
3332
InstalledStateButtons(xcode: xcode)
@@ -38,7 +37,6 @@ struct InfoPane: View {
3837
Group {
3938
ReleaseNotesView(url: xcode.releaseNotesURL)
4039
ReleaseDateView(date: xcode.releaseDate)
41-
.frame(maxWidth: .infinity, alignment: .leading)
4240
IdenticalBuildsView(builds: xcode.identicalBuilds)
4341
CompatibilityView(requiredMacOSVersion: xcode.requiredMacOSVersion)
4442
SDKsView(sdks: xcode.sdks)
@@ -54,23 +52,6 @@ struct InfoPane: View {
5452
UnselectedView()
5553
}
5654
}
57-
58-
@ViewBuilder
59-
private func downloadFileSize(for xcode: Xcode) -> some View {
60-
// if we've downloaded it no need to show the download size
61-
if let downloadFileSize = xcode.downloadFileSizeString, case .notInstalled = xcode.installState {
62-
VStack(alignment: .leading) {
63-
Text("DownloadSize")
64-
.font(.headline)
65-
.frame(maxWidth: .infinity, alignment: .leading)
66-
Text("\(downloadFileSize)")
67-
.font(.subheadline)
68-
.frame(maxWidth: .infinity, alignment: .leading)
69-
}
70-
} else {
71-
EmptyView()
72-
}
73-
}
7455
}
7556

7657
struct InfoPane_Previews: PreviewProvider {

Xcodes/Frontend/InfoPane/InstallationStepDetailView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ struct InstallDetailView_Previews: PreviewProvider {
3939
}
4040
)
4141
)
42-
42+
4343
InstallationStepDetailView(
4444
installationStep: .unarchiving
4545
)
4646
}
47+
.padding()
4748
}
4849
}

Xcodes/Frontend/InfoPane/InstalledStateButtons.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ struct InstalledStateButtons: View {
3838
Spacer()
3939
UninstallButton(xcode: xcode)
4040
}
41-
4241
}
4342
}
4443
}

Xcodes/Frontend/InfoPane/NotInstalledStateButtons.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ struct NotInstalledStateButtons: View {
2222
} label: {
2323
Text("Install") .help("Install")
2424
}
25+
2526
if let size = downloadFileSizeString {
26-
2727
Text("DownloadSize")
2828
.font(.headline)
2929
Text(size)

Xcodes/Frontend/InfoPane/ReleaseDateView.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct ReleaseDateView: View {
1414
var body: some View {
1515
if let date = date {
1616
VStack(alignment: .leading) {
17-
Text("ReleaseDate (old version)")
17+
Text("ReleaseDate")
1818
.font(.headline)
1919
Text("\(date, style: .date)")
2020
.font(.subheadline)
@@ -41,16 +41,13 @@ private struct WrapperView: View {
4141

4242
var body: some View {
4343
VStack {
44-
HStack {
45-
ReleaseDateView(date: date)
46-
.border(.red)
47-
}
44+
ReleaseDateView(date: date)
45+
.border(.red)
4846
Spacer()
4947
Toggle(isOn: $isNil) {
5048
Text("Is Nil?")
5149
}
5250
}
53-
.animation(.default)
5451
.frame(width: 300, height: 100)
5552
.padding()
5653
}

Xcodes/Frontend/InfoPane/ReleaseNotesView.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,12 @@ private struct WrapperView: View {
4646

4747
var body: some View {
4848
VStack {
49-
HStack {
50-
ReleaseNotesView(url: url)
51-
.border(.red)
52-
}
49+
ReleaseNotesView(url: url).border(.red)
5350
Spacer()
5451
Toggle(isOn: $hasURL) {
5552
Text("Has URL?")
5653
}
5754
}
58-
.animation(.default)
5955
.frame(width: 300, height: 100)
6056
.padding()
6157
}

0 commit comments

Comments
 (0)