これは完全に機能する私の警告です。アラートが表示されたときにテキストの横に表示されるアラートに画像を追加したいのですが、違いがある場合はSpriteKitのSKSceneにあります。UIAlertControllerに画像を追加する
var alertController = UIAlertController(title: "How to Skate", message: "Tap the screen to perform a trick and jump over the obsticles (You can grind on rails) The game will end when you hit a highlighted red, orange or yellow obsticle. Thats it! + Image", preferredStyle: UIAlertControllerStyle.Alert)
alertController.addAction(UIAlertAction(title: "Cool!", style: UIAlertActionStyle.Cancel, handler: nil))
self.view?.window?.rootViewController?.presentViewController(alertController, animated: true, completion: nil)
これらのアプローチは準拠していません。効果的にボタン領域に画像を追加し、アラートビューの他のボタンのサイズに影響を与えます。また、このアプローチのアクセシビリティも準拠していない可能性があります。 Appleはこれを可能にしたはずだが、そのオプションがなければ、「UIView」からのカスタムアラートが最良のアプローチのように思え、すべての要素を制御できるという利点がある。 – user4806509