このタプルを配列に追加しようとすると、上記のエラーが発生します。'(名前:UIImage?)'の引数リストを受け入れる 'UIImage'型の初期化子が見つかりません
struct Cards{
var cards: [(face: String, value: Int, image: UIImage?)] = []
}
var playerCards: [(face: String, value: Int, image: UIImage?)] = []
func dealCards() {
self.createCards()
var turn = 0
for var i = 0; i <= self.cards.cards.count - 1; ++i {
if turn == 0 {
turn = 1
self.playerCards.append((face: self.cards.cards[i].face, value: self.cards.cards[i].value, image: self.cards.cards[i].image))
}
else {
turn = 0
}
}
}
func createCards(){
cards.cards.append(face: "Ace Of Spades", value: 14, image: UIImage(named: "ace_of_spades.png"))
}
初期化子文字列(画像の名前)ではない別のUIImage – Paulw11