はじめに
Textに使ったことのない機能があったので使ってみました
サンプルアプリ
実装
import SwiftUI
struct ContentView: View {
let tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: Date())!
let yesterday = Calendar.current.date(byAdding: .day, value: -1, to: Date())!
var body: some View {
Text(yesterday...tomorrow)
}
}
おわり
知らない機能でした
参考記事