1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
import SwiftUI
struct ContentView: View {
var photos:[PhotoData] = [
PhotoData( imageName:"CC0_01", title:"景色1", message:"森と山です" ),
PhotoData( imageName:"CC0_04", title:"景色2", message:"きれいな湖です" ),
PhotoData( imageName:"CC0_06", title:"景色3", message:"フィレンツェです" ),
PhotoData( imageName:"CC0_07", title:"景色4", message:"ひまわりです" ),
PhotoData( imageName:"CC0_10", title:"景色5", message:"海に日が沈みます" ),
PhotoData( imageName:"CC0_05", title:"ハンバーガーセット", message:"おいしいです" ),
PhotoData( imageName:"CC0_08", title:"カフェラテ", message:"おちつきます" ),
PhotoData( imageName:"CC0_09", title:"ケーキ", message:"あまいです" ),
PhotoData( imageName:"CC0_12", title:"お酒", message:"酔います" )
]
var body: some View {
List {
Section( "景色写真" ) {
ForEach( photos ) { photo in
SceneryRow( data:photo )
}
}
}
.listStyle( .grouped )
}
}
|