Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Layout Debug with Reveal.app

Layout Debug with Reveal.app

Avatar for USAMI Kosuke

USAMI Kosuke

December 23, 2015

More Decks by USAMI Kosuke

Other Decks in Programming

Transcript

  1. Xcode ͱͷҧ͍ • Reveal ͸ break ͠ͳͯ͘΋ϨΠΞ΢τ֬ೝͰ͖Δ • Live Edit

    : Reveal ͸ͦͷ৔Ͱ஋ʢframe ΍ color ͳ ͲʣΛॻ͖׵͑Δ͜ͱ͕Ͱ͖Δ
  2. Auto Layout ͷ Live Edit • ֤ Constraint ʹରͯ͠ɾɾɾ •

    Constant ஋ͷมߋ • Active / NonActive ੾Γସ͑ • ίʔυͰͰ͖Δ͜ͱͱಉ͡
  3. ྫ • σβΠφʔ͞Μ͔ΒͷϨΠΞ΢τࢦࣔͩͱ iPhone 4S Ͱݟ੾ ΕΔ • Α͋͘Δɻ •

    σβΠφʔ͞Μ͸ iPhone 4S ͷදࣔʹͩ͜ΘΓ͕ͳ͍ • ๻ʮ͡Ό͋ͬͪ͜ͰϚʔδϯͱ͔ௐ੔͠·͢Ͷʯ
  4. ʢ༨ஊʣ • σβΠφʔ͞Μ͸ iPhone 4S Λ੾Γ͍ͨͱΑ͘ݴ͏ • ͏ΜɺΘ͔Δɻ • ͨͩɺiPad

    ͷ iPhone ޓ׵දࣔ΋ಉ͡ॎԣൺ • iPad ͰϘλϯ͕͸Έग़ͯԡͤͳ͍ → ϦδΣΫτ
  5. ௐ੔ • iPhone 4S + Reveal Ͱ໨తͷը໘Λදࣔ • Ϛʔδϯͷ Constant

    Λมߋͯ͠ྑͦ͞͏ͳ஋Λ୳͢ • ͜ͷ࡞ۀ͕ Reveal ͩͱΘΓͱָͰྑ͍
  6. ࣮૷ • ྫ : Ϛʔδϯ͕௨ৗ 30 pt / 4S ͚ͩ

    15 pt • Ϛʔδϯ >= 15 pt ͷ੍໿Λ͚ͭΔ • Ϛʔδϯ == 30 pt ͷ੍໿Λ͚ͭΔʢ༏ઌ౓Լ͛Δʣ • Ͱ͖ͨΒ Reveal Ͱ࠶֬ೝ
  7. Tips : Reveal ಋೖ • Reveal Λ࢖͏ʹ͸ɺiOS ΞϓϦʹ Reveal ϥΠϒϥϦΛϦ

    ϯΫ͢Δඞཁ͕͋ΔʢCocoaPods Λར༻Ͱ͖Δʣ • LLDB Ͱϩʔυ : Integrating Reveal without modifying your Xcode project - Itty Bitty Labs
  8. iOS γϛϡϨʔλͷ৔߹ • ࣄલʹϦϯΫͯ͠ͳͯ͘΋ LLDB ͰϩʔυͰ͖Δ expr (void*)dlopen( "/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);

    expr [(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
  9. iOS ࣮ػͷ৔߹ • ࣄલʹ Copy Resources ͕ඞཁ͚ͩͲɺLink ͸ෆཁ expr (void*)dlopen(

    [(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2); expr [(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
  10. AppCode integration • AppCode ͳΒɺDebug Condigurations Ͱ Inject Reveal library

    on launch Λ༗ޮʹ͓͚ͯ͠͹ OK • ͓ͦΒ͘લड़ͷํ๏Λࣗಈతʹ΍ͬͯ͘Ε͍ͯΔ