1.落ちる原因
MyAccountViewCell.swift
のsetupSubViews()
にある、$0.trailing.equalTo(XXX.snp.left)
の影響で、ことごとく落ちます。使い方を確認されたし。
MyAccountViewCell.swift
のlayoutSubviews()
で行っている初期化処理は、init
に移動する。
layoutSubviews()
は、setupSubViews()
より後に呼ばれます。
他のViewControllerも同様。
2.accountButtonの外見の件
この時点でaccountButton.frame.height
が0
のため
(もちろんaccountButton.frame.size.height
も0
)
contentView.frame.height
を使えばよいのでは。
- accountButton.layer.cornerRadius = accountButton.frame.height / 2
+ accountButton.layer.cornerRadius = contentView.frame.height / 2
設定誤り
- accountButton.imageView?.image = UIImage(systemName: "person.fill")
+ accountButton.setImage(UIImage(systemName: "person.fill")!, for: .normal)