未分類

アラートを表示する

投稿日:

アラートを表示するメソッド

//アラート
    func displayAleart() {
        let alert: UIAlertController = UIAlertController(title: "アラート表示", message: "保存してもいいですか?", preferredStyle:  UIAlertController.Style.alert)

        let defaultAction: UIAlertAction = UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler:{
            (action: UIAlertAction!) -> Void in
            print("OK")
        })
        let cancelAction: UIAlertAction = UIAlertAction(title: "キャンセル", style: UIAlertAction.Style.cancel, handler:{
            (action: UIAlertAction!) -> Void in
            print("Cancel")
        })

        alert.addAction(cancelAction)
        alert.addAction(defaultAction)

        present(alert, animated: true, completion: nil)
    }

参考:【Swift】アラートを表示する(Alert/ActionSheet)

-未分類

執筆者:

関連記事

PremiereProのキャッシュの保存先を確認し削除する

キャッシュを毎回消していると思ったら、8Gくらい溜まっていた。。 デフォルトではわかりにくいところにキャッシュの保存フォルダがあるので、見つけにくい。 外付けハードディスクに保存するのがいいらしい。 …

no image

テロップの文字を移動すると見切れる時の対処法

ベクトルモーションで文字全体を見えるよう位置調整してから、通常のモーションで位置を動かす。 【premiere pro】テキスト/文字の端が切れる・見えなくなる時の解決方法の話。

no image

プレミアプロ講座応用編3_シェイプやイラストを使ったテロップ

背景や下線のあるテロップ シェイプを追加するだけ。 位置や不透明度等でアニメーションをつけられる。 イラストを使う イラストを使う時に「クロップ」(画像をトリミングする機能)というエフェクトを使う。

no image

Int型からString型へ変換

Int型→String型またはString型→Int型に変換(キャスト)する方法。 //String型->Int型 let yearString = “2020” let yearInt = I …

XMLパースで使うRSSのURLの調べ方

各サイトのRSS用URLを調べたい。 //XMLパース let urlString = “https://assets.wor.jp/rss/rdf/sankei/affairs.rdf” //←この …