Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

iPad のサポート #131

Merged
merged 16 commits into from
Oct 14, 2015
Merged

iPad のサポート #131

merged 16 commits into from
Oct 14, 2015

Conversation

Watson1978
Copy link
Contributor

iPad のサポートを追加し、iOS 9 で追加された Split View に対応させてみました。

Split View に対応させるために LaunchScreen.storyboard を追加していますが、
iPhone 上でも起動時にこれが表示されるようになるはずです。
(適当に追加したので、修正した方が良いのかも・・・)

iPad を回転させたときに画面がみだれる現象があり対応してますが、
まだおかしな箇所があればご連絡ください。

@Watson1978
Copy link
Contributor Author

https://twitter.com/watson1978/status/648184462606385152 の対処を忘れてた・・・orz

@naoya
Copy link
Owner

naoya commented Oct 2, 2015

おお・・・すごいw

@Watson1978
Copy link
Contributor Author

UIActivityViewController が下の方に表示するように修正しました。

@Watson1978
Copy link
Contributor Author

このプルリクエストをiPhoneで動かしたら LaunchScreen がちゃんと表示されていなかった。どこか間違えているみたいです(´д`)

@naoya
Copy link
Owner

naoya commented Oct 7, 2015

これあと LaunchScreen が直ったらマージできるという理解でいいですか?

@Watson1978
Copy link
Contributor Author

はい。

(私が、ブランチをいろいろ切り替えたりして試してたので、おかしくなっていたのかも。今日はもうほろ酔いなので、明日あたりに再度確認してみますm(_ _)m )

@naoya
Copy link
Owner

naoya commented Oct 7, 2015

ラジャーです!

@Watson1978
Copy link
Contributor Author

LaunchScreen の件は、問題なかったです。
やはり私がブランチを切り替えたりしているときにおかしくなったっぽい

@Watson1978
Copy link
Contributor Author

iPad を横向きにし、コピーしたURLを開こうとすると通知が変なところに出る・・・
通知を表示するのに使用されている MPNotificationView が問題なのかも。

@Watson1978
Copy link
Contributor Author

TSMessages というものを代わりに使うようにしてみました。(星がいっぱい付いていたので、これを選択しました( ˘ω˘))

@Watson1978
Copy link
Contributor Author

とりあえず、こんなところでしょうか( ˘ω˘)

@naoya
Copy link
Owner

naoya commented Oct 9, 2015

conflict がありますね

@naoya
Copy link
Owner

naoya commented Oct 9, 2015

あと、URL 開くインタフェースが変わってるようなのでちょっとこれでいいか評価してみます。

@naoya
Copy link
Owner

naoya commented Oct 9, 2015

Podfile.lock が衝突しているのか

@naoya
Copy link
Owner

naoya commented Oct 9, 2015

master との Conflict を解消した Podfile.lock を貼っときます。この pull request にこちらから commit を足す方法がわからんかった

PODS:
  - AFNetworking (1.3.2)
  - ARChromeActivity (1.0.1)
  - HatenaBookmarkSDK (1.2):
    - SFHFKeychainUtils
  - HexColors (2.2.1)
  - JASidePanels (1.3.2)
  - NSDate+TimeAgo (1.0.2)
  - PocketAPI (1.0.2):
    - SFHFKeychainUtils (= 0.0.1)
  - SFHFKeychainUtils (0.0.1)
  - SVProgressHUD (0.9)
  - TSMessages (0.9.12):
    - HexColors (~> 2.2.0)
  - TTTAttributedLabel (2.0.0)
  - TUSafariActivity (1.0.0)

DEPENDENCIES:
  - AFNetworking (~> 1.3)
  - ARChromeActivity
  - HatenaBookmarkSDK (from `git@github.com:hatena/Hatena-Bookmark-iOS-SDK.git`)
  - JASidePanels
  - NSDate+TimeAgo
  - PocketAPI (from `git@github.com:naoya/Pocket-ObjC-SDK.git`, branch `cocoapods-dependency`)
  - SFHFKeychainUtils
  - SVProgressHUD
  - TSMessages
  - TTTAttributedLabel (from `git@github.com:TTTAttributedLabel/TTTAttributedLabel.git`)
  - TUSafariActivity

EXTERNAL SOURCES:
  HatenaBookmarkSDK:
    :git: git@github.com:hatena/Hatena-Bookmark-iOS-SDK.git
  PocketAPI:
    :branch: cocoapods-dependency
    :git: git@github.com:naoya/Pocket-ObjC-SDK.git
  TTTAttributedLabel:
    :git: git@github.com:TTTAttributedLabel/TTTAttributedLabel.git

CHECKOUT OPTIONS:
  HatenaBookmarkSDK:
    :commit: 9f6af4ea96f63f0d08b757c1fdf58c432e3f6168
    :git: git@github.com:hatena/Hatena-Bookmark-iOS-SDK.git
  PocketAPI:
    :commit: 2924afe59348f67dbc1a83c01bcd44c502b9222b
    :git: git@github.com:naoya/Pocket-ObjC-SDK.git
  TTTAttributedLabel:
    :commit: 636de1ef38bce6656a3f9989426ef5eee7a5a42d
    :git: git@github.com:TTTAttributedLabel/TTTAttributedLabel.git

SPEC CHECKSUMS:
  AFNetworking: 9168af1ebe62092499df4398ecb5e7b885e6a250
  ARChromeActivity: e77c0414584bb6d244fe6da7176465a75e981fba
  HatenaBookmarkSDK: 16f3cf6d23d3daa2e9e123da1a724abdd5a04b4b
  HexColors: abfd172e329dab59888614ccba6f216cec59289d
  JASidePanels: c8f5b130e18d51ee3de988d1c1fad2f88e0b0d21
  NSDate+TimeAgo: 7aa9c53dd3d7c55b5a41c1819a11638344adfbc8
  PocketAPI: d4b8f31c5a29e20da84b6a19055344bb1ad06099
  SFHFKeychainUtils: 9576b411a79a058f4d5381ace6f3242b9a62e664
  SVProgressHUD: 7038ae9d6a0bd2c87560d2699eba642eef82d41e
  TSMessages: c8cc7b80f2a833af533872cd02010cac061532cc
  TTTAttributedLabel: 4d752a2ff9832229c4f0081f44ef27e4f00cce2b
  TUSafariActivity: dd346df54a8f1cbb4fd05d504c76d47225fac99e

COCOAPODS: 0.38.2

@naoya
Copy link
Owner

naoya commented Oct 9, 2015

TSMessages、ルック & フィールがいまいちですね
特に iPhone だと画面領域を占有しすぎて邪魔に感じます

@naoya
Copy link
Owner

naoya commented Oct 9, 2015

いまわかりましたが、TSMessages はモーダルダイアログが表示されてる場合に、その裏にポップアップしてしまうことがありますね。

iPad だけこっちを使う、というのを回避策として講じるのはよいですが、iPhone のインタフェースをこれに変更するのはデグレードに相当するし NG かな、と思いました。

@Watson1978
Copy link
Contributor Author

なるほど、どの View コントローラに対して通知メッセージの View を挿入する
(Watson1978@59d24a0#diff-345526d8158ecc1118cc1f7df5940810R260)
ようなつくりなので、最前面にならないことがあるのですね・・・

@Watson1978
Copy link
Contributor Author

とりあえず、TSMessages は元に戻しとこ。

@Watson1978
Copy link
Contributor Author

MPNotificationView に手を入れて、通知メッセージが常に画面の上部に表示されるようにしてみました。最後のコミットでその変更を使うようにレポジトリを変更してます。

https://github.com/Watson1978/MPNotificationView/commit/7bd700d93b57e3e6023371baf1ecded8cb63999a

@naoya
Copy link
Owner

naoya commented Oct 13, 2015

実機に転送して試してみますね。

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

うーん、なんだろう、シミュレータでも実機でも iPad だとクラッシュしてしまいます。

シミュレータ

空のタイムラインの画面がでて Loading Indicator が回るのですが、ハンバーガーメニューをタップするとクラッシュ

*** Starting simulator
(main)> Oct 14 14:13:53  HBFav[9434] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct 14 14:13:53  HBFav[9434] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct 14 14:13:53  HBFav[9434] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2015-10-14 14:13:53.938 HBFav[9434:69594] RUBYMOTION_ENV: development
2015-10-14 14:13:54.035 HBFav[9434:69594] **** Background Fetch Enabled ****
2015-10-14 14:14:02.178 HBFav[9434:69594] left_view_controller.rb:70:in `block in profile_image_for:': undefined method `request' for nil:NilClass (NoMethodError)
        from left_view_controller.rb:69:in `profile_image_for:'
        from left_view_controller.rb:31:in `initialize_data_source'
        from left_view_controller.rb:8:in `viewDidLoad'
2015-10-14 14:14:02.188 HBFav[9434:69594] *** Terminating app due to uncaught exception 'NoMethodError', reason: 'left_view_controller.rb:70:in `block in profile_image_for:': undefined method `request' for nil:NilClass (NoMethodError)
        from left_view_controller.rb:69:in `profile_image_for:'
        from left_view_controller.rb:31:in `initialize_data_source'
        from left_view_controller.rb:8:in `viewDidLoad'
'
*** First throw call stack:
(
        0   CoreFoundation                      0x0000000104eaaf65 __exceptionPreprocess + 165
        1   libobjc.A.dylib                     0x0000000100c92deb objc_exception_throw + 48
        2   HBFav                               0x0000000100558480 _ZL10__vm_raisev + 400
        3   HBFav                               0x00000001005585b0 rb_vm_raise + 208
        4   HBFav                               0x00000001004540a9 rb_exc_raise + 9
        5   HBFav                               0x0000000100556812 rb_vm_method_missing + 786
        6   HBFav                               0x000000010052946e rb_vm_dispatch + 5902
        7   HBFav                               0x0000000100527c10 rb_vm_trigger_method_missing + 1120
        8   HBFav                               0x0000000100528e6e rb_vm_dispatch + 4366
        9   HBFav                               0x00000001000fddcc vm_dispatch + 1436
        10  HBFav                               0x00000001003cdc70 rb_scope__profile_image_for:__block__ + 272
        11  HBFav                               0x000000010052adef _ZL13vm_block_evalP7RoxorVMP11rb_vm_blockP13objc_selectormiPKm + 1439
        12  HBFav                               0x000000010052aff0 rb_vm_yield_args + 64
        13  HBFav                               0x000000010051ea9b rb_yield + 59
        14  HBFav                               0x000000010048bdfe rb_obj_tap + 14
        15  HBFav                               0x0000000100529a1c rb_vm_dispatch + 7356
        16  HBFav                               0x00000001000fddcc vm_dispatch + 1436
        17  HBFav                               0x00000001003cdb1c rb_scope__profile_image_for:__ + 348
        18  HBFav                               0x0000000100529a1c rb_vm_dispatch + 7356
        19  HBFav                               0x00000001000fddcc vm_dispatch + 1436
        20  HBFav                               0x00000001003ccd0a rb_scope__initialize_data_source__ + 762
        21  HBFav                               0x0000000100529a1c rb_vm_dispatch + 7356
        22  HBFav                               0x00000001000fddcc vm_dispatch + 1436
        23  HBFav                               0x00000001003cc3ea rb_scope__viewDidLoad__ + 362
        24  HBFav                               0x00000001003cc52d __unnamed_9 + 13
        25  UIKit                               0x0000000101f0f931 -[UIViewController loadViewIfRequired] + 1344
        26  UIKit                               0x0000000101f0fc7d -[UIViewController view] + 27
        27  HBFav                               0x000000010004a62b -[JASidePanelController _loadLeftPanel] + 193
        28  HBFav                               0x000000010004ba2a -[JASidePanelController _showLeftPanel:bounce:] + 59
        29  UIKit                               0x0000000101d861fa -[UIApplication sendAction:to:from:forEvent:] + 92
        30  UIKit                               0x0000000102168247 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 152
        31  UIKit                               0x0000000101d861fa -[UIApplication sendAction:to:from:forEvent:] + 92
        32  UIKit                               0x0000000101eea504 -[UIControl sendAction:to:forEvent:] + 67
        33  UIKit                               0x0000000101eea7d0 -[UIControl _sendActionsForEvents:withEvent:] + 311
        34  UIKit                               0x0000000101eea94b -[UIControl _sendActionsForEvents:withEvent:] + 690
        35  UIKit                               0x0000000101ee9906 -[UIControl touchesEnded:withEvent:] + 601
        36  UIKit                               0x0000000101df0aa3 -[UIWindow _sendTouchesForEvent:] + 835
        37  UIKit                               0x0000000101df1691 -[UIWindow sendEvent:] + 865
        38  UIKit                               0x0000000101da3752 -[UIApplication sendEvent:] + 263
        39  UIKit                               0x0000000101d7efcc _UIApplicationHandleEventQueue + 6693
        40  CoreFoundation                      0x0000000104dd70a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        41  CoreFoundation                      0x0000000104dccfcc __CFRunLoopDoSources0 + 556
        42  CoreFoundation                      0x0000000104dcc483 __CFRunLoopRun + 867
        43  CoreFoundation                      0x0000000104dcbe98 CFRunLoopRunSpecific + 488
        44  GraphicsServices                    0x00000001081e0ad2 GSEventRunModal + 161
        45  UIKit                               0x0000000101d84676 UIApplicationMain + 171
        46  HBFav                               0x000000010010624f main + 111
        47  libdyld.dylib                       0x00000001066d792d start + 1
        48  ???                                 0x0000000000000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NoMethodError

================================================================================
The application terminated. A crash report file may have been generated by the
system, use `rake crashlog' to open it. Use `rake debug=1' to restart the app
in the debugger.
================================================================================

実機

*** Application is running on the device, use ^C to quit.
Oct 14 14:11:52 itounaoyanoiPad HBFav[445] <Warning>: Unable to simultaneously satisfy constraints.
Oct 14 14:11:52 itounaoyanoiPad HBFav[445] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct 14 14:11:52 itounaoyanoiPad HBFav[445] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct 14 14:11:52 itounaoyanoiPad HBFav[445] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct 14 14:11:52 itounaoyanoiPad HBFav[445] <Warning>: RUBYMOTION_ENV: development
Oct 14 14:11:53 itounaoyanoiPad HBFav[445] <Warning>: web_view_controller.rb:294:in `profile_image_url:': undefined method `[]' for nil:NilClass (NoMethodError)
Oct 14 14:11:53 itounaoyanoiPad HBFav[445] <Warning>: web_view_controller.rb:294:in `profile_image_url:': undefined method `[]' for nil:NilClass (NoMethodError)
Oct 14 14:11:53 itounaoyanoiPad HBFav[445] <Warning>: web_view_controller.rb:294:in `profile_image_url:': undefined method `[]' for nil:NilClass (NoMethodError)
Oct 14 14:11:53 itounaoyanoiPad HBFav[445] <Error>: *** Terminating app due to uncaught exception 'NoMethodError', reason: 'web_view_controller.rb:294:in `profile_image_url:': undefined method `[]' for nil:NilClass (NoMethodError)
^Crake aborted!
Interrupt:
/Library/RubyMotion/lib/motion/project/template/ios.rb:288:in `block in <top (required)>'
Tasks: TOP => device
(See full trace by running task with --trace)

なんかよくわからないところで落ちてる。毎度クラッシュする場所が違うけど、profile_image_url が nil 触って落ちるというところは共通しているかも。

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

rake pod:install しなかったせいかな。ということで実行したのですが、Rakefile で

     pod 'MPNotificationView'
     pod 'MPNotificationView', :git => 'https://github.com/Watson1978/MPNotificationView.g\
 it', :branch => 'HBFav'

と MPNotificationView のエントリが二つありますです。

@Watson1978
Copy link
Contributor Author

うぉ、ホントだ。すみません。m(_ _)m

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

rake pod:install したけどクラッシュする結果は変わらず。

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

待っててもタイムラインにブックマークが表示されないところをみると、通信できてないとかかな・・・

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

$ bundle exec rake clean:all
$ bundle exec rake pod:install
$ bundle exec rake device_name="iPad Air 2" args="-AppleLanguages '(ja)'"

としてますが、だめですね

@Watson1978
Copy link
Contributor Author

クラッシュログを拝見していますが、手元の環境では見たことがないですね。。。

実機のログで

Oct 14 14:11:53 itounaoyanoiPad HBFav[445] <Warning>: web_view_controller.rb:294:in `profile_image_url:': undefined method `[]' for nil:NilClass (NoMethodError)

とありますが、そのような処理はコード中に見当たらないし。謎すぎる。。。

とりあえず、rake clean:allrake pod:install して一度ビルドし直すとよいのかな・・・。

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

iPhone 6 だとクラッシュせずに動きます。

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

ログとコードが一致していないし、何かコードじゃなくてビルド環境とかその辺に原因がありそうですね。

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

device_name="iPad Air 2" から device_name="iPad 2" にしたら動いた。なんだ・・・

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

シミュレータからアプリを削除してもう一回試したら、動きました。
実機でも同様の検証中

@Watson1978
Copy link
Contributor Author

device_name="xxxx" を変更して動いたのであれば、アプリのインストール時に変になっていたのかもですね・・・。
たぶん前にビルドしインストールしたものを上書きしようとして上手くいってなかったのが、
device_name="xxxx" を変更したら真っ新な状態のデバイス向けに新規にインストールされたのかと。

アプリを手動で削除すれば、実機でも動くのかな・・・

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

実機は削除 → インストールでもやっぱりクラッシュしてしまう

@naoya
Copy link
Owner

naoya commented Oct 14, 2015

いや、動いたな。謎だ・・・

@Watson1978
Copy link
Contributor Author

謎だ・・・

naoya added a commit that referenced this pull request Oct 14, 2015
@naoya naoya merged commit efac204 into naoya:master Oct 14, 2015
@naoya
Copy link
Owner

naoya commented Oct 14, 2015

マージしました!!

@Watson1978
Copy link
Contributor Author

Thanks ( ˘ω˘)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants