Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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