-
-
Save sturdysturge/aa9b1176ba70e44553eea76fcae8712f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@StateObject var dataModel = DataModel() | |
var body: some View { | |
if let tickers = dataModel.tickerData?.tickers | |
.sorted(by: { $0.market.name < $1.market.name }) { | |
NavigationView { | |
List(0..<tickers.count) { index in | |
if let ticker = tickers[index] { | |
NavigationLink(destination: TickerDetailView(index: index) | |
.environmentObject(dataModel)) { | |
Text(""" | |
\(ticker.market.name) | |
\(ticker.base.rawValue) \(ticker.target) | |
""") | |
} | |
} | |
} | |
.navigationTitle("DOGE") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment