@@ -69,7 +69,7 @@ struct HomeView: View {
69
69
} message: {
70
70
Text ( " Please try again. " )
71
71
}
72
- . alert ( " Unavailable Network" , isPresented: $unavailableNetworkAlert) {
72
+ . alert ( " Network Unavailable " , isPresented: $unavailableNetworkAlert) {
73
73
Button ( " OK " , role: . cancel) { }
74
74
}
75
75
. alert ( " run out of API credits " , isPresented: $runOutOfAPICredits) {
@@ -283,7 +283,6 @@ struct HomeView: View {
283
283
try FileManager . default. createDirectory ( at: directoryName, withIntermediateDirectories: true )
284
284
285
285
for abbreviation in abbreviations {
286
- let _ = print ( 4 )
287
286
readData ( abbreviation)
288
287
}
289
288
} catch {
@@ -348,7 +347,6 @@ struct HomeView: View {
348
347
let cryptocurrency = Cryptocurrency ( symbol: meta [ " symbol " ] !, name: meta [ " currency_base " ] !, history: history, abbreviation: abbreviation)
349
348
cryptocurrencies. append ( cryptocurrency)
350
349
cryptocurrencies = sortCryptocurrencyByName ( cryptocurrencies)
351
- let _ = print ( 1 )
352
350
writeData ( cryptocurrency)
353
351
} else {
354
352
cryptocurrency!. history = history
@@ -365,7 +363,6 @@ struct HomeView: View {
365
363
366
364
func writeData( _ cryptocurrency: Cryptocurrency ) {
367
365
do {
368
- let _ = print ( 2 )
369
366
let directoryName = getProjectDirectory ( )
370
367
371
368
let jsonEncoder = JSONEncoder ( )
@@ -374,14 +371,12 @@ struct HomeView: View {
374
371
let cryptocurrencyDir = directoryName. appendingPathComponent ( " \( cryptocurrency. abbreviation) .txt " , isDirectory: true )
375
372
try json? . write ( to: cryptocurrencyDir, atomically: true , encoding: String . Encoding. utf16)
376
373
} catch {
377
- let _ = print ( 3 )
378
374
unknownErrorAlert = true
379
375
}
380
376
}
381
377
382
378
func readData( _ cryptocurrencyAbbreviation: String ) {
383
379
do {
384
- let _ = print ( 5 )
385
380
let directoryName = getProjectDirectory ( )
386
381
let cryptocurrencyDir = directoryName. appendingPathComponent ( " \( cryptocurrencyAbbreviation) .txt " , isDirectory: true )
387
382
@@ -392,17 +387,14 @@ struct HomeView: View {
392
387
393
388
let getCryptocurrency = getCryptocurrency ( cryptocurrencyAbbreviation)
394
389
if getCryptocurrency == nil {
395
- let _ = print ( 7 )
396
390
cryptocurrencies. append ( cryptocurrency)
397
391
cryptocurrencies = sortCryptocurrencyByName ( cryptocurrencies)
398
392
} else {
399
- let _ = print ( 8 )
400
393
getCryptocurrency!. history = cryptocurrency. history
401
394
getCryptocurrency!. price = cryptocurrency. price
402
395
doDummyOnCryptocurrencies ( )
403
396
}
404
397
} catch {
405
- let _ = print ( 6 )
406
398
unknownErrorAlert = true
407
399
}
408
400
}
0 commit comments