Giter Site home page Giter Site logo

wxbeacon-swift's Introduction

WxBeacon

Platform Language License

概要

WxBeacon は気温、湿度、気圧を観測し、iBeacon の仕組みを利用して送信するデバイスです。
本ライブラリは、iOS端末で WxBeacon のデータを受信して画面に観測値を表示するサンプルコードです。
WxBeacon はウェザーニュースタッチの有料会員のうち、ウェザーリポート送信などで 2000pt を達成した方にプレゼントしています。
WxBeacon

Requirement

iOS 8.0以降、Bluetooth, 位置情報の利用許可が必要です。
(WxBeacon の受信自体はiOS 7.0以降で可能ですが、本サンプルではエラー表示にUIAlertController を使用しているため、iOS 8.0以降を対象としています。)
本サンプルコードは Xcode 8.2.1, iOS 10.2.1 で動作確認を行っています。

How to use

  • WxBeaconData.swiftWxBeaconMonitor.swift をあなたのXcode のproject にコピーしてください。
  • Info.plist に NSLocationAlwaysUsageDescription の項目を追加してください。String の値は空欄でも良いです。
  • データ表示を行いたいclass で、WxBeaconMonitorDelegate protocol に沿って実装してください。
  • 下記のように WxBeaconMonitor を初期化してください。
let beaconMonitor = WxBeaconMonitor()
beaconMonitor.delegate = self
beaconMonitor.startMonitoring(true)
  • WxBeacon の値を受信すると、func didUpdateWeatherData(_ data: WxBeaconData?) が呼び出されます。
  • エラーがあった場合は func showAlert(_ message: String) が呼ばれます。
  • startMonitoring() の引数を true にした場合、アプリがバックグラウンドにいても beacon の受信を続けます。

wxbeacon-swift's People

Contributors

tashiro-wni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.