Skip to content

Commit 233e5f6

Browse files
committed
chore: swift-format changes
1 parent 38a5545 commit 233e5f6

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

BDKSwiftExampleWallet/View Model/Receive/ReceiveViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ extension ReceiveViewModel {
110110
func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) {
111111
if let message = messages.first,
112112
let record = message.records.first,
113-
let _ = String(data: record.payload, encoding: .utf8)
113+
String(data: record.payload, encoding: .utf8) != nil
114114
{
115115
// Handle response
116116
}

BDKSwiftExampleWallet/View/BalanceView.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
import SwiftUI
99

1010
struct BalanceView: View {
11-
11+
1212
@State private var balanceTextPulsingOpacity: Double = 0.7
13-
13+
1414
private var format: BalanceDisplayFormat
1515
private let balance: UInt64
1616
private var fiatPrice: Double
1717
private var satsPrice: Double {
1818
let usdValue = Double(balance).valueInUSD(price: fiatPrice)
1919
return usdValue
2020
}
21-
21+
2222
private var currencySymbol: some View {
2323
Image(systemName: format == .fiat ? "dollarsign" : "bitcoinsign")
2424
.foregroundStyle(.secondary)
@@ -34,7 +34,7 @@ struct BalanceView: View {
3434
.id("symbol-\(format)")
3535
.animation(.spring(response: 0.3, dampingFraction: 0.7), value: format)
3636
}
37-
37+
3838
@MainActor
3939
private var formattedBalance: String {
4040
switch format {
@@ -50,7 +50,7 @@ struct BalanceView: View {
5050
return satsPrice.formatted(.number.precision(.fractionLength(2)))
5151
}
5252
}
53-
53+
5454
@MainActor
5555
var balanceText: some View {
5656
Text(format == .fiat && satsPrice == 0 ? "00.00" : formattedBalance)
@@ -71,7 +71,7 @@ struct BalanceView: View {
7171
}
7272
}
7373
}
74-
74+
7575
private var unitText: some View {
7676
Text(format.displayText)
7777
.foregroundStyle(.secondary)
@@ -85,17 +85,17 @@ struct BalanceView: View {
8585
.id("format-\(format)")
8686
.animation(.spring(response: 0.3, dampingFraction: 0.7), value: format)
8787
}
88-
88+
8989
init(format: BalanceDisplayFormat, balance: UInt64, fiatPrice: Double) {
9090
self.format = format
9191
self.balance = balance
9292
self.fiatPrice = fiatPrice
9393
}
94-
94+
9595
var body: some View {
9696
buildBalance()
9797
}
98-
98+
9999
@ViewBuilder
100100
private func buildBalance() -> some View {
101101
VStack(spacing: 10) {
@@ -118,11 +118,11 @@ struct BalanceView: View {
118118
}
119119

120120
#if DEBUG
121-
#Preview {
122-
BalanceView(
123-
format: .bip21q,
124-
balance: 5000,
125-
fiatPrice: 89000
126-
)
127-
}
121+
#Preview {
122+
BalanceView(
123+
format: .bip21q,
124+
balance: 5000,
125+
fiatPrice: 89000
126+
)
127+
}
128128
#endif

BDKSwiftExampleWallet/View/WalletView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct WalletView: View {
2727
.ignoresSafeArea()
2828

2929
VStack(spacing: 20) {
30-
30+
3131
BalanceView(
3232
format: balanceFormat,
3333
balance: viewModel.balanceTotal,

0 commit comments

Comments
 (0)