comparison LazyBearWatchOS Extension/Views/Helpers/WatchOSNewsDetail.swift @ 455:b560babcd5ed

WatchOS views implemented
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Mon, 28 Jun 2021 11:55:19 +0200
parents
children c6913f0ce46e
comparison
equal deleted inserted replaced
454:c79a3ed3d230 455:b560babcd5ed
1 //
2 // WatchOSNewsDetail.swift
3 // LazyBearWatchOS Extension
4 //
5 // Created by Dennis Concepción Martín on 27/06/2021.
6 //
7
8 import SwiftUI
9
10 struct WatchOSNewsDetail: View {
11 var new: LatestNewsModel
12
13 var body: some View {
14 ScrollView {
15 VStack(alignment: .leading) {
16 Text("\(convertEpoch(new.datetime, true)) ago")
17 .font(.footnote)
18 .opacity(0.5)
19
20 Text(new.headline.capitalized)
21 .font(.headline)
22 .fontWeight(.semibold)
23
24 Text(new.summary)
25 .font(.footnote)
26 }
27 }
28 }
29 }
30
31 struct WatchOSNewsDetail_Previews: PreviewProvider {
32 static var previews: some View {
33 WatchOSNewsDetail(
34 new: LatestNewsModel(
35 datetime: 1621037430000,
36 headline: "Chaos Monkeys' author calls Apple's statement on his departure defamatory",
37 image: "https://cloud.iexapis.com/v1/news/image/99abeb99-6d9e-47c8-ae7b-53404eacccec",
38 source: "Investing.com",
39 summary: "https://www.investing.com/news/stock-market-news",
40 url: "https://bloomberg.com")
41 )
42 }
43 }