210616 Wed
1.最初の学習内容:セグメント制御。selectedSegmentIndex
セグメント制御ブランチの処理方法(スイッチ構文を使用)
switch構文で
セグメントを最初のケース0,1に分けたい.
では、スイッチには何を入れますか?考えました.
答えはセグメント制御です.selectedSegmentIndexです...!
@IBAction func switchViewsBySegmentedControl(_ sender: UISegmentedControl) {
switch segmentedControl.selectedSegmentIndex {
case 0:
tableView.isHidden = false
collectionView.isHidden = true
case 1:
tableView.isHidden = true
collectionView.isHidden = false
default:
break
}
}
Swift - Segmented control - Switch multiple views イメージのインポート方法がわかりません😥

解決策
DispatchQueue.global().async {
guard let imageURL: URL = URL(string: item.thumbnails.first!) else { return }
guard let imageData: Data = try? Data(contentsOf: imageURL) else { return }
DispatchQueue.main.async {
if let index: IndexPath = tableView.indexPath(for: cell) {
if index.row == indexPath.row {
cell.itemThumbnail.image = UIImage(data: imageData)
}
}
}
}
ネットワークAPI,JSON Parsing 
メインスレッドへ移動
3.3つ目の学習内容:UIVEew Animation
Apple Developer Documentation
問題/難点→解決策
セグメント制御の背景色の変更
シーケンスイメージボードでbackground colorをそのまま変更すると、すぐに有効になります.
本当にシミュレータを回すと、変わりません.
もともとそうだったのか.
それとも何を間違えたの?

理由は分からないけど.
急いでいるからです.
コードでビューをタップして埋め込みます^.ううう
和弦で弾くと、すぐに良くなります.
segmentedControl.backgroundColor = UIColor.systemBlue
セグメント制御テキストの色の変更
segmentedControl.selectedSegmentTintColor = UIColor.white
TintColorはテキスト色ではありませんか?
使用不可
先にスキップ
セル・ビューで間隔を作成する方法
セルがビューの左側と上に近すぎます.
私はあなたに間隔をあけたいです.
どうしよう.


Thanks to Kodasense👍
解決策:スタックビューにアンカーポイントを掛けます.
でもどうしたらいいかわからず…^ううう
スタックビューは錫布にあります.
これはviewconで作ったアンカーですが、collection viewswiftファイルでやるべきかどうか分かりません...ううう
これもスキップして
コダックが教えてくれた他の方法

これを使えば、上のように錨を下ろす必要はありません.
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 5, left: 5, bottom: 5, right: 5)
}
うん...やってみましたが、ダメでした^.ううう
Reference
この問題について(210616 Wed), 我々は、より多くの情報をここで見つけました https://velog.io/@sunnywhynot/210616-Wedテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol