KingFisher で UIButtonに画像を設定する


KingFisherでUIButtonにリモート画像を設定するには、buttonTypeをカスタムに設定します。

let button = UIButton(type: .custom)
button.kf.setImage(with: url, for: .normal)

これでオッケー。

🐣


フリーランスエンジニアです。
お仕事のご相談こちらまで
[email protected]

Core MLを使ったアプリを作っています。
機械学習関連の情報を発信しています。

Twitter
Medium