お世話になっている作業用BGMサイト達

作業BGMとしてよくお世話になってます。

クラシック(ネットラジオ) クラシック音楽専門の無料で聴けるインターネットラジオサービスを紹介。交響曲をはじめ、室内楽、オペラ、などジャンルからも選べます。 -音楽関連サイトリンク集 MUSIC-STYLE


"作業用 BGM"で検索したり"lofi hip hop radio - beats to relax"でライブ配信を聞いたりしてます。
YouTube


ゲーム配信サイト、作業用BGMとしても好きです。
Twitch

iOS端末情報リンクとメモ

wikipediaが充実しています。

端末の情報としてはほぼ十分では無いでしょうか。
iPhone - Wikipedia

個人的なメモ
  • iPhoneは 5sから64bit対応
  • iOS11は64bitのみインストール可能
  • iOS11は現状64bitのアプリのみ動作可能

風邪に関するメモ書き

ちょっと風邪ひいたので自分自身への注意も兼ねてメモ書きを残します。

風邪をひく場合
  • 山登りなど体力を消耗しすぎた時
  • 寝不足
  • 栄養不足
風邪をひいた時の注意点
  • 集中力が落ちる
  • 注意力も落ちる
  • 風邪に気づけない
  • 風邪をひいた時のお前の判断は大体間違っている
定期的にやること
  • 体温を毎日計測する
  • 体を冷やさない
  • 人混みではマスクを使用する


今回は山に登って体力消費したのに食べ過ぎで胃腸にも負担をかけたのが原因っぽいですね・・・

swift改行について

他の人が書いたソースコード読んで、ちょっと混乱したのでメモ

swiftは行終わりに ; を書かなくてもよい、であって書く事もできます。
なので

var strA:String = "strA"; var strB:String = "strB";

という形に一行で複数の変数宣言も可能です。
私はswiftでこの書き方はしませんが、良い使いかたもあるのかも知れませんね。

UIAlertControllerを使ってみる

とりあえず画面にボタンを追加します

f:id:mtntmyk:20171115214459p:plain

ボタン押下時にUIAlertControllerを表示するよう変更

    @IBAction func btnClick(_ sender: UIButton) {
        let ac = UIAlertController(title:"Title", message: "Message", preferredStyle: UIAlertControllerStyle.alert)
        
        let aDef = UIAlertAction(title: "default", style: UIAlertActionStyle.default, handler: {
            (action: UIAlertAction!) in
            print("Default!")
        })
        
        let aDes = UIAlertAction(title: "destructive", style: UIAlertActionStyle.destructive, handler: {
            (action: UIAlertAction!) in
            print("Default!")
        })
        
        let aCan = UIAlertAction(title: "cancel", style: UIAlertActionStyle.cancel, handler: {
            (action: UIAlertAction!) in
            print("Cancel!")
        })
        
        ac.addAction(aDef)
        ac.addAction(aDes)
        ac.addAction(aCan)

        self.present(ac, animated: true, completion:popoverPresentationController)
    }

f:id:mtntmyk:20171115220348p:plain

表示できました。

addActionを2つに減らすと表示されるボタンのスタイルが少し変わります。

f:id:mtntmyk:20171116224619p:plain

できました。

下からの表示に変更します。

UIAlertControllerStyle.alert を UIAlertControllerStyle.actionSheet に変更すれば下からの表示になります。

    @IBAction func btnClick(_ sender: UIButton) {
        let ac = UIAlertController(title:"Title", message: "Message", preferredStyle: UIAlertControllerStyle.actionSheet)
        
        let aDef = UIAlertAction(title: "default", style: UIAlertActionStyle.default, handler: {
            (action: UIAlertAction!) in
            print("Default!")
        })
        
        let aDes = UIAlertAction(title: "destructive", style: UIAlertActionStyle.destructive, handler: {
            (action: UIAlertAction!) in
            print("Default!")
        })
        
        let aCan = UIAlertAction(title: "cancel", style: UIAlertActionStyle.cancel, handler: {
            (action: UIAlertAction!) in
            print("Cancel!")
        })
        
        ac.addAction(aDef)
        ac.addAction(aDes)
        ac.addAction(aCan)
        
        self.present(ac, animated: true, completion:nil)
    }

f:id:mtntmyk:20171116225509p:plain

できました。

popoverで表示してみます。

UIAlertControllerStyle を actionSheet に変更すると popoverPresentationController の設定を使用できます。
iPhoneだと動作を確認できないので、iPadで実行します。

    @IBAction func btnClick(_ sender: UIButton) {
        let ac = UIAlertController(title:"Title", message: "Message", preferredStyle: UIAlertControllerStyle.actionSheet)
        
        let aDef = UIAlertAction(title: "default", style: UIAlertActionStyle.default, handler: {
            (action: UIAlertAction!) in
            print("Default!")
        })
        
        let aDes = UIAlertAction(title: "destructive", style: UIAlertActionStyle.destructive, handler: {
            (action: UIAlertAction!) in
            print("Default!")
        })
        
        let aCan = UIAlertAction(title: "cancel", style: UIAlertActionStyle.cancel, handler: {
            (action: UIAlertAction!) in
            print("Cancel!")
        })
        
        ac.addAction(aDef)
        ac.addAction(aDes)
        ac.addAction(aCan)
        
        ac.popoverPresentationController?.sourceView = self.view
        ac.popoverPresentationController?.sourceRect = btn.frame

        self.present(ac, animated: true, completion:nil)
    }


f:id:mtntmyk:20171116225840p:plain

sourceRect に吹き出しを指したい位置を指定します。

インストーラーの少し修正を行った時のメモ

インストーラーってそういえば何をしているのかは謎だったのが、少しだけわかりました。

何をしたらインストーラーなのか

アプリケーションに必要なファイルをPCへコピーして、実行可能にすれば最低限のインストーラーと言えると思います。

その他どんなことをしているのか
  • GUIで操作しやすくかつ、個々の要望に答えれる処理
  • Windowsであればアンインストール一覧へ表示して、そこからアンインストール可能にする
  • 既にインストール済みの場合はインストールさせない、もしくはアップデートなどを行えるようにする
  • サービスの登録やショートカットの作成など
その他
  • 有料の InstallShield が有名ですが、値段が高いです

Xcodeでswiftを使って見ている所感など

現時点での分

  • 作ったものを即動かせるので楽しいです
  • Swiftはバージョンが変わるとかなり書き方が変わる印象が強いです
  • 新しい書籍はObjective-cよりSwiftの方が多い気がします
  • 多言語だと do - while 文が repeat - while と書くなど戸惑う事も多いかも知れません

 

swiftの学習に関して

AndroidStudioやEclipseAndroid向け開発、もしくはVisualStudioでWindows向けの開発経験がある
 
スマホタブレットなどの開発をしたことがないのであれば
  • とりあえず Hello World! をシミュレータで動かしてみる(方法をネットで検索することも含めて練習だと思います)