This file contains hidden or 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
NewsCell(article: .airBlock) |
This file contains hidden or 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
NewsCell(article: .blockChain) |
This file contains hidden or 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
extension Article { | |
static let blockChain: Self = .init( | |
title: "Lego Block Chain", | |
date: Date(), | |
detail: "Add your own Lego block to the chain of transactions to guarantee security by trusting a whole crowd of people you've never met. What can possibly go wrong?", | |
smallImageName: "blockCircle", | |
largeImageName: "chain" | |
) | |
This file contains hidden or 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
struct Article { | |
let title: String | |
let date: Date | |
let detail: String | |
let smallImageName: String | |
let largeImageName: String | |
} |
This file contains hidden or 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
NewsCell( | |
image: Image(systemName: "photo"), | |
text: Text("Text"), | |
detailText: Text("Detail Text"), | |
tertiaryText: Text("Tertiary Text"), | |
largeImage: Image(systemName: "photo") | |
) |
This file contains hidden or 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
/// Measurement system, such as metric, imperial. | |
enum System { | |
case metric | |
case imperial | |
} | |
extension System: FetchValue {} |
This file contains hidden or 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
enum Key: String, FetchKey { | |
case appID | |
case site = "q" | |
case system = "units" | |
var isInURLPath: Bool { | |
switch self { | |
case .system: return true | |
default: return false | |
} |
This file contains hidden or 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
enum Key: String, FetchKey { | |
case appID | |
case site = "q" | |
case system = "units" | |
} |
This file contains hidden or 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
public protocol Fetchable { | |
// Required. No default values: | |
/// The type of the object in the response. | |
associatedtype Fetched | |
/// The type of the failure object in the response. | |
associatedtype FetchedFailure | |
This file contains hidden or 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
struct Site { | |
let id: Int | |
let name: String | |
let weathers: [Weather] | |
let main: Main | |
struct Weather { | |
let id: Int | |
let main: String | |
let description: String |