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

(iOS13の)UIBarButtonItem 位置調整あるある

domonr
October 23, 2019

(iOS13の)UIBarButtonItem 位置調整あるある

domonr

October 23, 2019
Tweet

More Decks by domonr

Other Decks in Programming

Transcript

  1. 8

  2. 10

  3. 12

  4. 14

  5. Client error attempting to change layout margins of a private

    view 16 ϓϥΠϕʔτϏϡʔͷϨΠΞ΢τϚʔδϯΛมߋ͠ Α͏ͱ͢ΔΫϥΠΞϯτΤϥʔ
  6. 18 loop: for view in subviews { for stack in

    view.subviews where stack is UIStackView { stack.superview?.layoutMargins = .zero break loop } } ্هͷΑ͏ʹSubViewΛճͯ͠layoutMarginsΛௐ੔ͨ͠ΒౖΒΕ·͢
  7. 20

  8. 27 class HogeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad()

    self.navigationItem.leftBarleftButtonItems = [ UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil), UIBarButtonItem(customView: view) ] } }