
【じっくりSw1ftUI55】実践編25〜第37章 SwiftUI Grid と GridRow のチュートリアル
さてと、前回
で
LazyVGridとLazyHGridの基本
はやったので、今回は、
LazyVGridとLazyHGridの実践編
オイラの学びなんざ要らねって人は、
に全部サンプルも載ってそうなんでそっち見れば良いんじゃね?
んだば、早速
じっくり第37章を読んでく👓
概要としては、
前回だと、大きめなグリッドレイアウトなんかの解説が不足してたから
今回で紹介するぜ🕺
みたいなことを書いてんね👀💦
構文としては、
Grid {
GridRow {
// Cell views here
} GridRow {
// Cell views here
}
. .
}てな感じらしい。
さっそく動かす😛
まずは、新しいファイルを新規追加後、前回のコードを使って〜〜〜
import SwiftUI
import WebKit
//タイトル
let essentialsChapter37NavigationTitle = "第37章"
let essentialsChapter37Title = ""
let essentialsChapter37SubTitle = ""
//コード
let codeEssentials37 = """
"""
//ポイント
let pointEssentials37 = """
"""
//URL
let urlEssentials37 = "https://note.com/m_kakudo/n/n6fac5d510add"
//ビュー管理構造体
struct ListiOSApp17DevelopmentEssentialsCh37: Identifiable {
var id: Int
var title: String
var view: ViewEnumiOSApp17DevelopmentEssentialsCh37
}
//遷移先の画面を格納する列挙型
enum ViewEnumiOSApp17DevelopmentEssentialsCh37{
case Sec1
}
//各項目に表示するリスト項目
let dataiOSApp17DevelopmentEssentialsCh37: [ListiOSApp17DevelopmentEssentialsCh37] = [
ListiOSApp17DevelopmentEssentialsCh37(id: 1, title: essentialsChapter37SubTitle, view: .Sec1),
]
struct iOSApp17DevelopmentEssentialsCh37: View {
var body: some View {
VStack {
Divider()
List (dataiOSApp17DevelopmentEssentialsCh37) { data in
self.containedViewiOSApp17DevelopmentEssentialsCh37(dataiOSApp17DevelopmentEssentialsCh37: data)
}
.edgesIgnoringSafeArea([.bottom])
}
.navigationTitle(essentialsChapter37NavigationTitle)
.navigationBarTitleDisplayMode(.inline)
}
//タップ後に遷移先へ遷移させる関数
func containedViewiOSApp17DevelopmentEssentialsCh37(dataiOSApp17DevelopmentEssentialsCh37: ListiOSApp17DevelopmentEssentialsCh37) -> AnyView {
switch dataiOSApp17DevelopmentEssentialsCh37.view {
case .Sec1:
return AnyView(NavigationLink (destination: Essentials37()) {
Text(dataiOSApp17DevelopmentEssentialsCh37.title)
})
}
}
}
#Preview {
iOSApp17DevelopmentEssentialsCh37()
}
struct Essentials37: View {
var body: some View {
VStack{
TabView {
Essentials37ContentsView()
.tabItem {
Image(systemName: contentsImageTab)
Text(contentsTextTab)
}
Essentials37Code()
.tabItem {
Image(systemName: codeImageTab)
Text(codeTextTab)
}
Essentials37Points()
.tabItem {
Image(systemName: pointImageTab)
Text(pointTextTab)
}
Essentials37WEB()
.tabItem {
Image(systemName: webImageTab)
Text(webTextTab)
}
}
}
}
}
#Preview {
Essentials37()
}
struct Essentials37Code: View {
var body: some View {
ScrollView{
Text(codeEssentials37)
}
}
}
#Preview {
Essentials37Code()
}
struct Essentials37Points: View {
var body: some View {
ScrollView{
Text(pointEssentials37)
}
}
}
#Preview {
Essentials37Points()
}
struct Essentials37WebView: UIViewRepresentable {
let searchURL: URL
func makeUIView(context: Context) -> WKWebView {
let view = WKWebView()
let request = URLRequest(url: searchURL)
view.load(request)
return view
}
func updateUIView(_ uiView: WKWebView, context: Context) {
}
}
struct Essentials37WEB: View {
private var url:URL = URL(string: urlEssentials37)!
var body: some View {Essentials37WebView(searchURL: url)
}
}
#Preview {
Essentials37WEB()
}
struct Essentials37ContentsView: View {
var body: some View {
E37GridStandardView()
E37GridHStandardView()
}
}
struct E37GridStandardView: View {
private var fruitsColors: [Color] = [
.red,
.green,
.orange,
.purple,
.pink
]
private var fruitsGridItems = [
GridItem(.fixed(120)),
GridItem(.adaptive(minimum: 44)),
GridItem(.adaptive(minimum: 44)),
GridItem(.adaptive(minimum: 44)),
GridItem(.adaptive(minimum: 44)),
GridItem(.adaptive(minimum: 44)),
GridItem(.adaptive(minimum: 44)),
]
var body: some View {
ScrollView{
LazyVGrid(columns: fruitsGridItems, spacing: 10){
ForEach(1...5000, id: \.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: fruitsColors[fruitsIndex % fruitsColors.count])
}
}
.padding()
}
}
}
struct E37GridHStandardView: View {
private var fruitsColors: [Color] = [
.red,
.green,
.orange,
.purple,
.pink
]
private var fruitsGridItems = [
GridItem(.fixed(200)),
GridItem(.adaptive(minimum: 44, maximum: .infinity)),
GridItem(.adaptive(minimum: 76, maximum: .infinity)),
]
var body: some View {
ScrollView(.horizontal){
LazyHGrid(rows: fruitsGridItems, spacing: 10){
ForEach(1...5000, id: \.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: fruitsColors[fruitsIndex % fruitsColors.count])
}
}
.padding()
}
}
}
struct E37CellContentsView: View {
var fruitsIndex: Int
var fruitsColor: Color
var body: some View {
Text("\(fruitsIndex)")
.frame(minWidth: 44, maxWidth: .infinity,minHeight: 44)
.background(fruitsColor)
.presentationCornerRadius(44)
.font(.largeTitle)
}
}
#Preview {
Essentials37ContentsView()
}てな感じのコードを用意
struct E37CellContentsView: View {
var fruitsIndex: Int
var fruitsColor: Color
var body: some View {
Text("\(fruitsIndex)")
.frame(minWidth: 44, maxWidth: .infinity,minHeight: 44,maxHeight: 120)
.background(fruitsColor)
.presentationCornerRadius(44)
.font(.largeTitle)
}
}てな感じで、maxHeightを適当に追加しといて、
struct E37GridStandardView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...15,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(16...30,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(31...45,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}てな感じに書き換えてみると、、、

さらに、
struct E37GridStandardView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...15,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(16...30,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(31...45,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 46, fruitsColor: .purple)
}
}
}てな感じで追記すると、、、

と、ちょっとセルの数が縦では収まりきらなくなってるので〜〜〜

自動で空白セルを作りたかったら、、、
struct E37GridAutoEmptyCellView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(7...10,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(16...18,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
}
}
}てな感じでやると、、、

struct E37CellContentsView: View {
var fruitsIndex: Int
var fruitsColor: Color
var body: some View {
Text("\(fruitsIndex)")
.frame(minWidth: 44, maxWidth: .infinity,minHeight: 44,maxHeight: 120)
.background(fruitsColor)
.cornerRadius(8)
.font(.largeTitle)
}
}てな感じで、真面目に
cornerRadius
を設定してあげると、、、

.cornerRadius(44)だと、

自分で好きに空白や色を変えた並びにしたいなら
struct E37GridAutoEmptyCellView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(7...10,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(16...18,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
}
}
}てな感じにして、

GridRowの中に入れて〜〜〜
さっきの最終行に
GridRow{
E37CellContentsView(fruitsIndex: 20, fruitsColor: .brown)
.gridCellColumns(2)
E37CellContentsView(fruitsIndex: 20, fruitsColor: .gray)
.gridCellColumns(3)
}を追加してあげるだけで、

余白なんかを指定したいなら
struct E37GridAlignmentSpacingCellView: View {
var body: some View {
Grid(horizontalSpacing: 20,verticalSpacing: 10){
GridRow{
ForEach(1...3,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(4...6,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(7...9,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 10, fruitsColor: .purple)
}
}
}てな感じにして、

細かい設定をグリッドごとに〜〜〜
struct E37GridDetailSettingCellView: View {
var body: some View {
Grid{
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
}
}
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
GridRow{
ForEach(4...5,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}で、

struct E37GridDetailSettingCellView: View {
var body: some View {
Grid{
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
}
}
.font(.title)
.foregroundColor(.red)
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
.font(.largeTitle)
.foregroundColor(.yellow)
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
.font(.title)
.foregroundColor(.orange)
GridRow{
ForEach(4...5,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}てやれば、

同系色にしたから、文字が消えちゃってる藁🤣
ここでポイント①アラインメントのパラメータとしては、、、
◆Grid ビューの配置としては、以下の9つ
.trailing
.leading
.top
.bottom
.topLeading
.topTrailing
.bottomLeading
.bottomTrailing
.center
◆テキストのベースラインとしては、以下の6つ
.centerFirstTextBaseline
.centerLastTextBaseline
.leadingFirstTextBaseline
.leadingLastTextBaseline
.trailingFirstTextBaseline
.trailingLastTextBaseline
があるらしい。ま、試しに
struct E37GridDetailSettingCellView: View {
var body: some View {
Grid(alignment: .top){
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
}
}
.font(.caption)
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
.font(.caption)
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
.font(.caption)
GridRow{
ForEach(4...5,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}に変更すると、

流石に見にくい藁🤣
struct E37GridDetailSettingCellView: View {
var body: some View {
Grid(alignment: .top){
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
}
}
.font(.caption)
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
.font(.caption)
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
.font(.caption)
}
}
}
struct E37GridDetailSettingCellView: View {
var body: some View {
ScrollView{
Grid(alignment: .top){
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
}
}
.font(.caption)
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
.font(.caption)
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
.font(.caption)
GridRow{
ForEach(4...5,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}
}
どうやら、Grid()内のAlignmentは縦にしか反応しない様子なので〜〜〜
.gridColumnAlignment(.leading)みたいなモディファイアで調整はできるみたいだね👀
struct E37ColumnCellAlignmentAnchorView: View {
var body: some View {
Grid {
GridRow {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .red)
Text("🍎")
Text("🍊")
Text("🍌")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .pink)
}
.font(.largeTitle)
GridRow {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .orange)
Text("🍇")
Text("🍑")
Text("🍉")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .yellow)
}
.font(.largeTitle)
GridRow {
ForEach(1...5, id: \.self) { index in
E37CellContentsView(fruitsIndex: index, fruitsColor: .green)
}
}
}
}
}
struct E37ColumnCellAlignmentAnchorView: View {
var body: some View {
Grid {
GridRow(alignment: .bottom) {
E37CellContentsView(fruitsIndex: 0,fruitsColor: .red)
Text("🍎")
Text("🍊")
Text("🍌")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .pink)
}
.font(.largeTitle)
GridRow(alignment: .top) {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .orange)
Text("🍇")
Text("🍑")
Text("🍉")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .yellow)
}
.font(.largeTitle)
GridRow {
ForEach(1...5, id: \.self) { index in
E37CellContentsView(fruitsIndex: index, fruitsColor: .green)
}
}
}
}
}てな感じで変更すると、、、

ここで、
struct E37ColumnCellAlignmentAnchorView: View {
var body: some View {
Grid {
GridRow(alignment: .bottom) {
E37CellContentsView(fruitsIndex: 0,fruitsColor: .red)
Text("🍎")
Text("🍊")
Text("🍌")
.gridColumnAlignment(.trailing)
E37CellContentsView(fruitsIndex: 0, fruitsColor: .pink)
}
.font(.largeTitle)
GridRow(alignment: .top) {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .orange)
Text("🍇")
Text("🍑")
Text("🍉")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .yellow)
}
.font(.largeTitle)
GridRow {
ForEach(1...5, id: \.self) { index in
E37CellContentsView(fruitsIndex: index, fruitsColor: .green)
}
}
}
}
}てな感じで、
.gridColumnAlignment(.trailing)みたいに追加するだけで

さらにCellAnchorを追加してみると、、、
struct E37ColumnCellAlignmentAnchorView: View {
var body: some View {
Grid {
GridRow(alignment: .bottom) {
E37CellContentsView(fruitsIndex: 0,fruitsColor: .red)
Text("🍎")
.gridCellAnchor(.center)
Text("🍊")
.gridCellAnchor(.top)
Text("🍌")
.gridColumnAlignment(.trailing)
E37CellContentsView(fruitsIndex: 0, fruitsColor: .pink)
}
.font(.largeTitle)
GridRow(alignment: .top) {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .orange)
Text("🍇")
Text("🍑")
Text("🍉")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .yellow)
}
.font(.largeTitle)
GridRow {
ForEach(1...5, id: \.self) { index in
E37CellContentsView(fruitsIndex: index, fruitsColor: .green)
}
}
}
}
}
アンカーの方は、列単位じゃなくって
ビュー単位で細かい設定ができる
のがわかるね👀
以上。
Apple公式
さてと、次回は
実は普段、記事公開後に当たり前に使っちゃってる
タブビュー
について紹介した
第38章 SwiftUI でタブ付きビューを構築する
をやってく🕺
記事公開後、
いつもどおり、
でやった操作を〜〜〜
今回はビューが多いのでペタペタ頑張る💦









サンプルコード
◆Essentials37.swift
import SwiftUI
import WebKit
//タイトル
let essentialsChapter37NavigationTitle = "第37章"
let essentialsChapter37Title = "第37章 SwiftUI Grid と GridRow のチュートリアル"
let essentialsChapter37SubTitle = "第37章 SwiftUI Grid と GridRow のチュートリアル"
//コード
let codeEssentials37 = """
struct Essentials37ContentsView: View {
var body: some View {
E37GridStandardView()
E37GridAutoEmptyCellView()
E37GridCustomEmptyCellView()
E37GridAlignmentSpacingCellView()
E37GridDetailSettingCellView()
E37ColumnCellAlignmentAnchorView()
}
}
struct E37GridStandardView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(7...12,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(13...18,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
}
}
}
struct E37GridAutoEmptyCellView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(7...10,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(16...18,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
}
}
}
struct E37GridCustomEmptyCellView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6, id: \\.self) { fruitsIndex in
if (fruitsIndex % 2 == 1) {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
} else {
Color.clear
.gridCellUnsizedAxes([.horizontal, .vertical])
}
}
}
GridRow{
ForEach(7...12, id: \\.self) { fruitsIndex in
if (fruitsIndex % 2 == 0) {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
} else {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .yellow)
}
}
}
GridRow{
ForEach(13...18, id: \\.self) { fruitsIndex in
if (fruitsIndex < 16) {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
} else {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .blue)
}
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
GridRow{
E37CellContentsView(fruitsIndex: 20, fruitsColor: .brown)
.gridCellColumns(2)
E37CellContentsView(fruitsIndex: 20, fruitsColor: .gray)
.gridCellColumns(3)
}
}
}
}
struct E37GridAlignmentSpacingCellView: View {
var body: some View {
Grid(horizontalSpacing: 20,verticalSpacing: 10){
GridRow{
ForEach(1...3,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(4...6,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(7...9,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 10, fruitsColor: .purple)
}
}
}
struct E37GridDetailSettingCellView: View {
var body: some View {
ScrollView{
Grid(alignment: .leading){
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
.gridColumnAlignment(.leading)
}
}
.font(.caption)
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
.font(.caption)
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
.font(.caption)
GridRow{
ForEach(4...5,id:\\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}
}
struct E37ColumnCellAlignmentAnchorView: View {
var body: some View {
Grid {
GridRow(alignment: .bottom) {
E37CellContentsView(fruitsIndex: 0,fruitsColor: .red)
Text("🍎")
.gridCellAnchor(.center)
Text("🍊")
.gridCellAnchor(.top)
Text("🍌")
.gridColumnAlignment(.trailing)
E37CellContentsView(fruitsIndex: 0, fruitsColor: .pink)
}
.font(.largeTitle)
GridRow(alignment: .top) {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .orange)
Text("🍇")
Text("🍑")
Text("🍉")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .yellow)
}
.font(.largeTitle)
GridRow {
ForEach(1...5, id: \\.self) { index in
E37CellContentsView(fruitsIndex: index, fruitsColor: .green)
}
}
}
}
}
struct E37CellContentsView: View {
var fruitsIndex: Int
var fruitsColor: Color
var body: some View {
Text("\\(fruitsIndex)")
.frame(minWidth: 44, maxWidth: .infinity,minHeight: 44,maxHeight: 120)
.background(fruitsColor)
.cornerRadius(44)
.font(.largeTitle)
}
}
#Preview {
Essentials37ContentsView()
}
"""
//ポイント
let pointEssentials37 = """
アラインメントのパラメータとしては、、、
◆Grid ビューの配置としては、以下の9つ
.trailing
.leading
.top
.bottom
.topLeading
.topTrailing
.bottomLeading
.bottomTrailing
.center
◆テキストのベースラインとしては、以下の6つ
.centerFirstTextBaseline
.centerLastTextBaseline
.leadingFirstTextBaseline
.leadingLastTextBaseline
.trailingFirstTextBaseline
.trailingLastTextBaseline
"""
//URL
let urlEssentials37 = "https://note.com/m_kakudo/n/na864b90b4346"
//ビュー管理構造体
struct ListiOSApp17DevelopmentEssentialsCh37: Identifiable {
var id: Int
var title: String
var view: ViewEnumiOSApp17DevelopmentEssentialsCh37
}
//遷移先の画面を格納する列挙型
enum ViewEnumiOSApp17DevelopmentEssentialsCh37{
case Sec1
}
//各項目に表示するリスト項目
let dataiOSApp17DevelopmentEssentialsCh37: [ListiOSApp17DevelopmentEssentialsCh37] = [
ListiOSApp17DevelopmentEssentialsCh37(id: 1, title: essentialsChapter37SubTitle, view: .Sec1),
]
struct iOSApp17DevelopmentEssentialsCh37: View {
var body: some View {
VStack {
Divider()
List (dataiOSApp17DevelopmentEssentialsCh37) { data in
self.containedViewiOSApp17DevelopmentEssentialsCh37(dataiOSApp17DevelopmentEssentialsCh37: data)
}
.edgesIgnoringSafeArea([.bottom])
}
.navigationTitle(essentialsChapter37NavigationTitle)
.navigationBarTitleDisplayMode(.inline)
}
//タップ後に遷移先へ遷移させる関数
func containedViewiOSApp17DevelopmentEssentialsCh37(dataiOSApp17DevelopmentEssentialsCh37: ListiOSApp17DevelopmentEssentialsCh37) -> AnyView {
switch dataiOSApp17DevelopmentEssentialsCh37.view {
case .Sec1:
return AnyView(NavigationLink (destination: Essentials37()) {
Text(dataiOSApp17DevelopmentEssentialsCh37.title)
})
}
}
}
#Preview {
iOSApp17DevelopmentEssentialsCh37()
}
struct Essentials37: View {
var body: some View {
VStack{
TabView {
Essentials37ContentsView()
.tabItem {
Image(systemName: contentsImageTab)
Text(contentsTextTab)
}
Essentials37Code()
.tabItem {
Image(systemName: codeImageTab)
Text(codeTextTab)
}
Essentials37Points()
.tabItem {
Image(systemName: pointImageTab)
Text(pointTextTab)
}
Essentials37WEB()
.tabItem {
Image(systemName: webImageTab)
Text(webTextTab)
}
}
}
}
}
#Preview {
Essentials37()
}
struct Essentials37Code: View {
var body: some View {
ScrollView{
Text(codeEssentials37)
}
}
}
#Preview {
Essentials37Code()
}
struct Essentials37Points: View {
var body: some View {
ScrollView{
Text(pointEssentials37)
}
}
}
#Preview {
Essentials37Points()
}
struct Essentials37WebView: UIViewRepresentable {
let searchURL: URL
func makeUIView(context: Context) -> WKWebView {
let view = WKWebView()
let request = URLRequest(url: searchURL)
view.load(request)
return view
}
func updateUIView(_ uiView: WKWebView, context: Context) {
}
}
struct Essentials37WEB: View {
private var url:URL = URL(string: urlEssentials37)!
var body: some View {Essentials37WebView(searchURL: url)
}
}
#Preview {
Essentials37WEB()
}
struct Essentials37ContentsView: View {
var body: some View {
E37GridStandardView()
E37GridAutoEmptyCellView()
E37GridCustomEmptyCellView()
E37GridAlignmentSpacingCellView()
E37GridDetailSettingCellView()
E37ColumnCellAlignmentAnchorView()
}
}
struct E37GridStandardView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(7...12,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(13...18,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
}
}
}
struct E37GridAutoEmptyCellView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(7...10,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(16...18,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
}
}
}
struct E37GridCustomEmptyCellView: View {
var body: some View {
Grid{
GridRow{
ForEach(1...6, id: \.self) { fruitsIndex in
if (fruitsIndex % 2 == 1) {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
} else {
Color.clear
.gridCellUnsizedAxes([.horizontal, .vertical])
}
}
}
GridRow{
ForEach(7...12, id: \.self) { fruitsIndex in
if (fruitsIndex % 2 == 0) {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
} else {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .yellow)
}
}
}
GridRow{
ForEach(13...18, id: \.self) { fruitsIndex in
if (fruitsIndex < 16) {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
} else {
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .blue)
}
}
}
E37CellContentsView(fruitsIndex: 19, fruitsColor: .purple)
GridRow{
E37CellContentsView(fruitsIndex: 20, fruitsColor: .brown)
.gridCellColumns(2)
E37CellContentsView(fruitsIndex: 20, fruitsColor: .gray)
.gridCellColumns(3)
}
}
}
}
struct E37GridAlignmentSpacingCellView: View {
var body: some View {
Grid(horizontalSpacing: 20,verticalSpacing: 10){
GridRow{
ForEach(1...3,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .pink)
}
}
GridRow{
ForEach(4...6,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .orange)
}
}
GridRow{
ForEach(7...9,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
E37CellContentsView(fruitsIndex: 10, fruitsColor: .purple)
}
}
}
struct E37GridDetailSettingCellView: View {
var body: some View {
ScrollView{
Grid(alignment: .leading){
GridRow{
E37CellContentsView(fruitsIndex: 1, fruitsColor: .pink)
VStack{
Image("りんごちゃん")
HStack{
Text("🍎")
Text("りんご")
}
.gridColumnAlignment(.leading)
}
}
.font(.caption)
GridRow{
VStack{
Image("バナナさん")
HStack{
Text("🍌")
Text("バナナ")
}
}
E37CellContentsView(fruitsIndex: 2, fruitsColor: .yellow)
}
.font(.caption)
GridRow{
E37CellContentsView(fruitsIndex: 3, fruitsColor: .orange)
VStack{
Image("みかんちゃん")
HStack{
Text("みかん")
Text("🍊")
}
}
}
.font(.caption)
GridRow{
ForEach(4...5,id:\.self){ fruitsIndex in
E37CellContentsView(fruitsIndex: fruitsIndex, fruitsColor: .green)
}
}
}
}
}
}
struct E37ColumnCellAlignmentAnchorView: View {
var body: some View {
Grid {
GridRow(alignment: .bottom) {
E37CellContentsView(fruitsIndex: 0,fruitsColor: .red)
Text("🍎")
.gridCellAnchor(.center)
Text("🍊")
.gridCellAnchor(.top)
Text("🍌")
.gridColumnAlignment(.trailing)
E37CellContentsView(fruitsIndex: 0, fruitsColor: .pink)
}
.font(.largeTitle)
GridRow(alignment: .top) {
E37CellContentsView(fruitsIndex: 0, fruitsColor: .orange)
Text("🍇")
Text("🍑")
Text("🍉")
E37CellContentsView(fruitsIndex: 0, fruitsColor: .yellow)
}
.font(.largeTitle)
GridRow {
ForEach(1...5, id: \.self) { index in
E37CellContentsView(fruitsIndex: index, fruitsColor: .green)
}
}
}
}
}
struct E37CellContentsView: View {
var fruitsIndex: Int
var fruitsColor: Color
var body: some View {
Text("\(fruitsIndex)")
.frame(minWidth: 44, maxWidth: .infinity,minHeight: 44,maxHeight: 120)
.background(fruitsColor)
.cornerRadius(44)
.font(.largeTitle)
}
}
#Preview {
Essentials37ContentsView()
}
◆EssentialsMenu.swift
//フレームワーク
import SwiftUI
import WebKit
//ビュー管理構造体
struct ListiOSApp17DevelopmentEssentials: Identifiable {
var id: Int
var title: String
var view: ViewEnumiOSApp17DevelopmentEssentials
}
//遷移先の画面を格納する列挙型
enum ViewEnumiOSApp17DevelopmentEssentials {
case Ch1
//じっくり13で追加
case Ch2
//じっくり14で追加
case Ch3
//じっくり15で追加
case Ch4
//じっくり16で追加
case Ch5
//じっくり17で追加
case Ch6
//じっくり18で追加
case Ch7
//じっくり19で追加
case Ch8
//じっくり20、21で追加
case Ch9
//じっくり22、23で追加
case Ch10
//じっくり24で追加
case Ch11
//じっくり25で追加
case Ch12
//じっくり26で追加
case Ch13
//じっくり27,28で追加
case Ch14
//じっくり29で追加
case Ch15
//じっくり31で追加
case Ch16
//じっくり32で追加
case Ch17
//じっくり33で追加
case Ch18
//じっくり34で追加
case Ch19
//じっくり35で追加
case Ch20
//じっくり36で追加
case Ch21
//じっくり37で追加
case Ch22
//じっくり40で追加
case Ch23
//じっくり41で追加
case Ch24
//じっくり43で追加
case Ch25
//じっくり44で追加
case Ch26
//じっくり45で追加
case Ch27
//じっくり46で追加
case Ch28
//じっくり47で追加
case Ch29
//じっくり48で追加
case Ch30
//じっくり49で追加
case Ch31
//じっくり50で追加
case Ch32
//じっくり51で追加
case Ch33
//じっくり52で追加
case Ch34
//じっくり53で追加
case Ch35
//じっくり54で追加
case Ch36
//じっくり55で追加
case Ch37
}
//各項目に表示する文字列
let dataiOSApp17DevelopmentEssentials: [ListiOSApp17DevelopmentEssentials] = [
ListiOSApp17DevelopmentEssentials(id: 1, title: essentialsChapter1Title, view: .Ch1),
//じっくり13で追加
ListiOSApp17DevelopmentEssentials(id: 2, title: essentialsChapter2Title, view: .Ch2),
//じっくり13で追加
ListiOSApp17DevelopmentEssentials(id: 3, title: essentialsChapter3Title, view: .Ch3),
//じっくり15で追加
ListiOSApp17DevelopmentEssentials(id: 4, title: essentialsChapter4Title, view: .Ch4),
//じっくり16で追加
ListiOSApp17DevelopmentEssentials(id: 5, title: essentialsChapter5Title, view: .Ch5),
//じっくり17で追加
ListiOSApp17DevelopmentEssentials(id: 6, title: essentialsChapter6Title, view: .Ch6),
//じっくり18で追加
ListiOSApp17DevelopmentEssentials(id: 7, title: essentialsChapter7Title, view: .Ch7),
//じっくり19で追加
ListiOSApp17DevelopmentEssentials(id: 8, title: essentialsChapter8Title, view: .Ch8),
//じっくり20、21で追加
ListiOSApp17DevelopmentEssentials(id: 9, title: essentialsChapter9Title, view: .Ch9),
//じっくり22、23で追加
ListiOSApp17DevelopmentEssentials(id: 10, title: essentialsChapter10Title, view: .Ch10),
//じっくり24で追加
ListiOSApp17DevelopmentEssentials(id: 11, title: essentialsChapter11Title, view: .Ch11),
//じっくり25で追加
ListiOSApp17DevelopmentEssentials(id: 12, title: essentialsChapter12Title, view: .Ch12),
//じっくり26で追加
ListiOSApp17DevelopmentEssentials(id: 13, title: essentialsChapter13Title, view: .Ch13),
//じっくり27,28で追加
ListiOSApp17DevelopmentEssentials(id: 14, title: essentialsChapter14Title, view: .Ch14),
//じっくり29で追加
ListiOSApp17DevelopmentEssentials(id: 15, title: essentialsChapter15Title, view: .Ch15),
//じっくり31で追加
ListiOSApp17DevelopmentEssentials(id: 16, title: essentialsChapter16Title, view: .Ch16),
//じっくり32で追加
ListiOSApp17DevelopmentEssentials(id: 17, title: essentialsChapter17Title, view: .Ch17),
//じっくり33で追加
ListiOSApp17DevelopmentEssentials(id: 18, title: essentialsChapter18Title, view: .Ch18),
//じっくり34で追加
ListiOSApp17DevelopmentEssentials(id: 19, title: essentialsChapter19Title, view: .Ch19),
//じっくり35で追加
ListiOSApp17DevelopmentEssentials(id: 20, title: essentialsChapter20Title, view: .Ch20),
//じっくり36で追加
ListiOSApp17DevelopmentEssentials(id: 21, title: essentialsChapter21Title, view: .Ch21),
//じっくり37で追加
ListiOSApp17DevelopmentEssentials(id: 22, title: essentialsChapter22Title, view: .Ch22),
//じっくり40で追加
ListiOSApp17DevelopmentEssentials(id: 23, title: essentialsChapter23Title, view: .Ch23),
//じっくり41で追加
ListiOSApp17DevelopmentEssentials(id: 24, title: essentialsChapter24Title, view: .Ch24),
//じっくり43で追加
ListiOSApp17DevelopmentEssentials(id: 25, title: essentialsChapter25Title, view: .Ch25),
//じっくり44で追加
ListiOSApp17DevelopmentEssentials(id: 26, title: essentialsChapter26Title, view: .Ch26),
//じっくり45で追加
ListiOSApp17DevelopmentEssentials(id: 27, title: essentialsChapter27Title, view: .Ch27),
//じっくり46で追加
ListiOSApp17DevelopmentEssentials(id: 28, title: essentialsChapter28Title, view: .Ch28),
//じっくり47で追加
ListiOSApp17DevelopmentEssentials(id: 29, title: essentialsChapter29Title, view: .Ch29),
//じっくり48で追加
ListiOSApp17DevelopmentEssentials(id: 30, title: essentialsChapter30Title, view: .Ch30),
//じっくり49で追加
ListiOSApp17DevelopmentEssentials(id: 31, title: essentialsChapter31Title, view: .Ch31),
//じっくり50で追加
ListiOSApp17DevelopmentEssentials(id: 32, title: essentialsChapter32Title, view: .Ch32),
//じっくり51で追加
ListiOSApp17DevelopmentEssentials(id: 33, title: essentialsChapter33Title, view: .Ch33),
//じっくり52で追加
ListiOSApp17DevelopmentEssentials(id: 34, title: essentialsChapter34Title, view: .Ch34),
//じっくり53で追加
ListiOSApp17DevelopmentEssentials(id: 35, title: essentialsChapter35Title, view: .Ch35),
//じっくり54で追加
ListiOSApp17DevelopmentEssentials(id: 36, title: essentialsChapter36Title, view: .Ch36),
//じっくり55で追加
ListiOSApp17DevelopmentEssentials(id: 37, title: essentialsChapter37Title, view: .Ch37),
]
struct iOSApp17DevelopmentEssentials: View {
var body: some View {
VStack {
Divider()
List (dataiOSApp17DevelopmentEssentials) { data in
self.containedViewiOSApp17DevelopmentEssentials(dataiOSApp17DevelopmentEssentials: data)
}
.edgesIgnoringSafeArea([.bottom])
}
.navigationTitle("iOS開発の章目次")
.navigationBarTitleDisplayMode(.inline)
}
//タップ後に遷移先へ遷移させる関数
func containedViewiOSApp17DevelopmentEssentials(dataiOSApp17DevelopmentEssentials: ListiOSApp17DevelopmentEssentials) -> AnyView {
switch dataiOSApp17DevelopmentEssentials.view {
case .Ch1:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh1()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり13で追加
case .Ch2:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh2()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり13で追加
case .Ch3:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh3()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり15で追加
case .Ch4:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh4()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり16で追加
case .Ch5:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh5()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり17で追加
case .Ch6:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh6()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり18で追加
case .Ch7:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh7()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり19で追加
case .Ch8:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh8()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり20、21で追加
case .Ch9:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh9()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり22、23で追加
case .Ch10:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh10()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり24で追加
case .Ch11:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh11()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり25で追加
case .Ch12:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh12()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり26で追加
case .Ch13:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh13()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり27,28で追加
case .Ch14:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh14()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり29で追加
case .Ch15:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh15()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり31で追加
case .Ch16:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh16()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり32で追加
case .Ch17:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh17()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり33で追加
case .Ch18:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh18()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり34で追加
case .Ch19:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh19()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり35で追加
case .Ch20:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh20()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり36で追加
case .Ch21:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh21()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり37で追加
case .Ch22:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh22()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり40で追加
case .Ch23:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh23()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり41で追加
case .Ch24:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh24()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり43で追加
case .Ch25:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh25()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり44で追加
case .Ch26:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh26()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり45で追加
case .Ch27:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh27()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり46で追加
case .Ch28:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh28()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり47で追加
case .Ch29:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh29()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり48で追加
case .Ch30:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh30()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり49で追加
case .Ch31:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh31()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり50で追加
case .Ch32:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh32()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり51で追加
case .Ch33:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh33()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり52で追加
case .Ch34:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh34()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり53で追加
case .Ch35:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh35()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり54で追加
case .Ch36:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh36()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
//じっくり54で追加
case .Ch37:
return AnyView(NavigationLink (destination: iOSApp17DevelopmentEssentialsCh37()) {
Text(dataiOSApp17DevelopmentEssentials.title)
})
}
}
}
#Preview {
iOSApp17DevelopmentEssentials()
}💃さてと、じゃまた次回🕺