:ghost:

オンラインもくもく会というのをやる。

何?

  • 👇コレ

ios-app-yaru.connpass.com

  • 勉強会をやる
  • 場所を借りて開催するのではなく、オンライン上(現時点ではTwitter)でやりとりを行いながら、それぞれ勉強する
  • 今回はiOS関連の開発をやっている人向けの勉強会

きっかけ

  • オフラインの勉強会に行くのが面倒になった。
  • 深夜2時のテンション

こんなふうになったらいいな

  • この勉強会がきっかけでみんなが幸せになる 💪💪💪💪💪

がんばるぞ!

  • やっていきます

グループURL

ios-app-yaru.connpass.com

他にも

  • みんもく会 という民泊+もくもく会を組み合わせた勉強会グループもやってます。
  • 最近、日本の民泊があやしい雲行きになってきていて開催の見通しはまだないですが・・・

minmoku.connpass.com

Swift4 ローカル通知を5秒後に出す

5秒後にアプリからの通知が来るようにしたい

環境

コード

  • Appdelegate.swift
import UserNotifications

class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // ....
        let center = UNUserNotificationCenter.current()
        // トリガーされている全ての通知をトリガー解除する
        center.removeAllPendingNotificationRequests();
        // 「通知を許可しますか?」ダイアログを出す
        center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in if granted { print("通知許可")}
        }
        let content = UNMutableNotificationContent()
        content.title = "通知タイトル"
        content.body = "通知本文"
        content.sound = UNNotificationSound.default()
        // 5秒後に通知を出すようにする
        let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)
        let request = UNNotificationRequest(identifier: "HogehogeNotification", content: content, trigger: trigger)
        center.add(request)
        center.delegate = self
        // ....
    }
}

確認

  • アプリを起動する
  • 通知が来る
  • 🙌

iOSアプリ開発 任意のVerのcocoapodsを導入とpod,carthageライブラリのインストール、アップデートをする方法

cocoapods 導入・アップデート

$ gem update cocoapods
$ gem install cocoapods

cocoapods バージョン指定導入

$ gem install -v 1.5.3 cocoapods

ライブラリのインストール

  • Podfile.lockに従ってインストール
$ pod install
  • Cartfile.resolvedに従ってインストール
# キャッシュ無し(推奨)
$ carthage bootstrap --no-cache-builds --platform iOS
# キャッシュ有り
$ carthage bootstrap --cache-builds --platform iOS

ライブラリのアップデート

$ pod update
$ carthage update --cache-builds --platform iOS

参考URL

qiita.com

qiita.com