Eureka EngineeringLearn about Eureka’s engineering efforts, product developments and more.
Eureka EngineeringLearn about Eureka’s engineering efforts, product developments and more.
先日、「M7 と少しだけ戯れてみた」というエントリでモーションアクティビティを試しに触ってました。その流れで自分の歩数を定期的に Tweet するようにしてみたらおもしろいかなぁと思って折角なので iOS 7 から導入された Background Fetch を使って見ようと思い、その時の内容をメモとして残してみようと思います。 ここに書く実験内容は Apple の審査を通った実績のあるものではない点をご了承ください。 Background Fetch とは iOS 7 から追加された新しい Background Mode のひとつ OS 側が不定期(OS の判断で適切だと思われるタイミング)で - (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBac
8. 🤔 override func viewDidLoad() { super.viewDidLoad() // HUD MBProgressHUD.showAdded(to: view, animated: true) Alamofire.request("https://hogefuga.com/piyo").responseJSON { [weak self] response in guard response.error == nil else { return } guard let data = response.data else { return } guard let piyo = String(data: data, encoding: .utf8) else { return } guard let weakSelf = self else { return }
Local Notification もユーザー承認が必要に これまで Local Notification はユーザーへの確認なしで表示することができましたが、iOS 8 から Local Notification も Remote Notification 同様、ユーザーへの確認が必要になりました。これは iOS 7 から Background Fetch や iBeacon などのようなバックグラウンドで動作する機能が増えたことにより、Remote Notification と似たような使われかたが多くなったからかと思われます。 ということで、iOS 8 からの Local Notification の正しい利用方法を解説したいと思います! Local Notification を認証させる Local Notification を認証してもらうには、次のような処理を記述します。 f
iOS開発に欠かせないiOS SDK、フレームワークの機能。でも、どの機能を使うべきか悩んだりすることはありませんか? そこでDeNA吉田正史さんが、作りたいアプリ・機能から逆引きできるiOS SDK機能、フレームワーク概要のまとめをレポートしてくれました。これはすごい便利です! by 馬場美由紀 (CodeIQ中の人) iOS SDK機能、フレームワーク概要のまとめと機能別逆引き CocoaPodsの登場によって、昨今のiOS開発ではとても簡単にライブラリを導入することができ、皆さんも多くの機能開発が楽になっていると思います。 ただiOS SDK自身にも非常に多くの機能やフレームワークが提供されており、外部ライブラリを利用しなくても実現できることも多くあります。 そこで、現状どのようなフレームワークや機能が提供されているか、簡単にまとめてみました。 機能の逆引きで何ができるかを記載してい
iOSアプリのコーディング規約を考える時はGoogleよりもNYTimesのObjective-Cスタイルガイドを参考にすべき By raimon, 2015-03-21(土), in category Ios Googleのスタイルガイドは古い 複数人でiOSアプリをObjective-Cコードで書いて保守する時、コーディング規約を検討することになる。 参考にすべきスタイルガイドとして良く挙がるものにGoogle Objective-C Style Guideがあるが、これはいかんせん古い。メモリ管理ARCやNSNumberのリテラル構文など、比較的新しいトピックについても追記されてはいるが、 インスタンス変数のアクセス修飾子 プロパティを使う事が主流となっている2015年現在、余り扱われない autorelease を使ったオブジェクト生成など、MRC時代の規約 何よりホスティング先が
公開されているコーディング規約をいくつかまとめてみました。 Apple https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html CookPad(日本語) https://github.com/cookpad/styleguide/blob/master/objective-c.ja.md Wantedly https://github.com/wantedly/objective-c-style-guide/tree/master NYTimes https://github.com/NYTimes/objective-c-style-guide Google http://google-styleguide.googlecod
UIViewにはビュー階層を表示するためのプライベートメソッドrecursiveDescription があるので、これを使います。 このメソッドを呼び出すと、以下のようにビュー階層をログ出力してくれます。 <UIView: 0x7ff192717cc0; frame = (0 0; 320 568); autoresize = W+H; gestureRecognizers = <NSArray: 0x7ff19264f0d0>; layer = <CALayer: 0x7ff192717d90>> | <UIView: 0x7ff1927198e0; frame = (0 60; 320 183); autoresize = RM+BM; layer = <CALayer: 0x7ff1927199b0>> | | <UITextField: 0x7ff192656c40; frame
当初はBaaS系のサービスを比較してみようと思っていましたが、諸事情による急遽内容を変更いたします。 モバイルアプリには欠かせないWebとの連携 最近のモバイルアプリでは、Web APIからデータを取ってきたり、画像をダウンロードしたりと、Webとの連携が必要な場合が殆どですね。 iOS SDKにはWebとの連携を簡単におこなう為のクラスが幾つか準備されています。 今回はそんな「いくつかの方法」を紹介したいと思います。 統一感を重んじてこの中の一つの方法で実装するもよし。臨機応変に使い分けて実装するもよし。 これからご紹介する方法では説明を簡単にする為にエラー処理などを省略しています。実装する場合には忘れずに。 「他にもこんな方法があるよ」「この実装方法だとココがまずくない」とかありましたら是非ともコメント欄で教えて下さい。 今回はDoorkeeperのAPIからイベント情報を取得する事を
Swift で使えるオープンソースライブラリ 2014年は新言語 Swift が登場し、iOS アプリ開発者にとってはかなり印象深い年になったのではないでしょうか。Swift の登場以後、さまざまな取り組みが iOS アプリ開発者の中で行われ、その結果の1つとしてオープンソースライブラリもかなり増えました。 Swift で一から書かれたものもあれば、既存のものを Swift でも使えるようにアップデートしてくれているものもあります。ある意味、混沌としている現状では「じゃあいまから Swift で iOS アプリ開発するときに何を使えば良いの!?」といったことになりかねません。ということで、現在までに公開されている Swift で使えるオープンソースライブラリを目的別にまとめてみました。 Swift アドベントカレンダーのために書いた記事なので、タイトルには「Swift 時代の」としています
Utilクラスとかを定義して以下のメソッド作っておくと便利。 マイナーバージョンは見てないので、7.1になっても大丈夫(なはず)。 + (BOOL)isIOS7 { NSArray *aOsVersions = [[[UIDevice currentDevice]systemVersion] componentsSeparatedByString:@"."]; NSInteger iOsVersionMajor = [[aOsVersions objectAtIndex:0] intValue]; if (iOsVersionMajor == 7) { return YES; } return NO; }
iOSアプリではシングルウィンドウしかないと思われがちですが、実は随所で使われているiOSのウィンドウ「UIWindow」。 このUIWindowの知られざる登場シーンや活用法、注意点などについて、DeNAの@sintarioさんに解説レポートを寄稿していただきました。 by 馬場美由紀 (CodeIQ中の人) iOS開発における「ウィンドウ」とは? デスクトップOSであれば、一つのアプリが複数のウィンドウを同時に展開するマルチウィンドウアプリであることは、ほぼ当たり前ですよね。画面上にいくつものウィンドウを同時に開いて、並べたり切り替えたりしながら画面の広さを活かしたやり方で作業するものです。 これに対して、iOSの世界観は大きく様相が異なります。高精細なRetinaディスプレイが普及したとはいえ、iPhoneの画面はやはりお世辞にも広くはありません。一般的にiOSでは、一つのアプリが画
Mac OS X 向けアプリケーション開発を仕事としている永遠製作所が、日々の開発でつきあたった問題点や、ちょっとしたTipsをメモしていこうと言う、自分勝手な覚え書きブログ。 インターネットの掲示板で初心者からの質問として、二つの画面の間でデータの受け渡しをやりたいがその方法がわからないというのをよく見かける。あ、もちろんiOS SDKプログラミングの話ね。 別にアップルがそのためになにか特別なAPIを用意してくれているわけではないので普通にC言語のブログラミングでやっているようにプログラムを作ればいいだけの話。でもiOSプログラミングでは画面の表示のためにはこのコントローラを使いなさいとか、初期化時にはこのメソッドをオーバーライドしなさいとか、色々決め毎があるのできっとなにか決まりがあるんだろうと思ってしまい見つけられずに質問をするのだろう。 とは言え、こう書いた方がiOS的には判りや
データ処理、設定データの保存、外部との通信など、アプリを終了後に、「バックグラウンド」で処理を実行するにはどうすればよいでしょうか? iOS4以降にはマルチタスク (MultiTasking) 処理機構が備わっています。 マルチタスクは複数のアプリを様々な状態のまま同時にメモリ上において処理を続けるすることができる機能ですが、そもそもアプリの状態には、どういうものがあるのでしょうか? 一口に「バックグラウンド」と言っても、その言葉の定義は様々です。 そこで調べてみると、アプリの状態には、 [Not Running], [Inactive], [Active], [Background], [Suspended] の4つの状態となっています。(App States and Multitaskingより) [Active] → [Inactive] → [Background] と移行
実行時にフレームワークバージョンで判定する AppleのiOS7移行ドキュメントにも書いてあったのでNSFoundationVersionNumber を使うようにしている。 [UIDevice currentDevice].systemVersion を使うやり方もちらほら見かけるが、値が文字列であるためバージョンの大小判定としては実装を工夫する必要がある。NSFoundationVersionNumber を使う方が可読性もあり、実装も楽である。[UIDevice currentDevice].systemVersion は表示したりログとして残す方に使うと良いと思う。 if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { // Load resources for iOS 6.1 or
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く