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

【完全版】AutoLayoutエラー診断所 ~発狂しないためのデバッグ手法~

akatsuki174
September 02, 2018

【完全版】AutoLayoutエラー診断所 ~発狂しないためのデバッグ手法~

2018/09/02 (日) iOSDC Japan 2018
その他関連資料はここらへんからたどれます。
http://akatsuki174.hatenablog.com/entry/20180820/1534723200

akatsuki174

September 02, 2018
Tweet

More Decks by akatsuki174

Other Decks in Programming

Transcript

  1. • ਢ౻ຘʢ@akatsuki174ʣ • גࣜձࣾZaim / iOSΤϯδχΞ • iOSDC Japan 2018

    ίΞελοϑ ࠙਌ձͷ೔ຊञ ͷҰ෦͸ ϫγ͕બΜͩ
  2. • ϥΠϒσόοΪϯάͰਐΊ·͢ • ͨ·ʹྫ͕ద੾͡Όͳ͍΍ͭ΋ɻڐͯ͠ɻ • εϥΠυࣗମ͸εΫγϣ෇͖Ͱ͍͋͛ͯ·͢ • αϯϓϧίʔυ • ໰୊ฤͱղ౴ฤ͕͋Γ·͢

    • ղઆ͸iOSDCޙ΋௥Ճ͍͖ͯ͠·͢ • https://github.com/akatsuki174/AutoLayoutDebugSample ੒ޭͨ͠Β ഥखʂ ׬શ൛͸ εϥΠυ໿ຕ
  3. ͨͩ… • ίʔυͰAuto LayoutΛ࢖ͬͨͱ͖ʹߴ֬཰Ͱtrue͕ฦͬͯ ɹ ͘ΔΑ͏ͳؾ͕ͯ͠ɺ͍·͍ͪ৚͕݅Θ͔Βͳ͔ͬͨ • ࠷ॳ͸frame(0, 0, 0,

    0)͚ͩͲޙ͔Β translatesAutoresizingMaskIntoConstraintsΛfalseʹͯ͠ ɹ αΠζΛ͋ͯΔ৔߹΋true͕ฦͬͯདྷͯ͠·͏ • ͪͳΈʹStoryboard্Ͱ໌Β͔ʹΤϥʔ͕ग़͍ͯΔͱ͖͸ ɹ ੍໿͕ᐆດͰ΋falseΛฦ͢͜ͱ΋͋Δ༷ࢠ
  4. contentHuggingPriorityͱ͸ • େ͖͘ͳΓʹ͘͞ / ίϯςϯπʹԊ͏༏ઌ౓ • Hug = ԊͬͯਐΉͱ͍͏ҙຯ •

    ͜ͷ஋͕খ͍͞ͱଞͷ੍໿ʹӨڹ͞Εͯେ͖͘ͳΓ΍͘͢ͳΔ • ݻ༗αΠζΑΓେ͖ͳαΠζ͕ࢦఆ͞Εͨͱ͖ʹ࢖ΘΕΔ
  5. Πϯετʔϧํ๏ $ brew update $ brew install chisel $ echo

    "command script import /usr/local/Cellar/chisel/ 1.8.0/libexec/fblldb.py" >> ~/.lldbinit-Xcode ※ύε͸దٓมߋ͍ͯͩ͘͠͞ɻ Xcode࠶ىಈ
  6. • σόοάͷͨΊʹView֊૚Λ೺Ѳ͢Δ • https://qiita.com/akatsuki174/items/ 45d4bd7cb150defbf116 • AutoLayoutͷσόοάΛ͢Δʢ1ʣ • https://qiita.com/akatsuki174/items/6935bb6ff64f4df51c5a •

    Debugging your layout ([WWDC2015] Mysteries of Auto Layout, Part 2ΑΓ) • https://qiita.com/akatsuki174/items/ 66c6a92ab52b458f5414
  7. • Mysteries of Auto Layout, Part 2 (WWDC 2015) •

    https://developer.apple.com/videos/play/wwdc2015/219/ • Α͘Θ͔ΔAuto Layout • גࣜձࣾϦοΫςϨίϜ. ઒ᬒ ༤հ ஶ. ॴ ༑ଠ ؂म.