Readable Width in action

Readable Width in action

Fb69c72d5af289d6674d2659246a5291?s=128

Tomohiro Nishimura

October 26, 2016
Tweet

Transcript

  1. ࣮ફ3FBEBCMF8JEUI ؔ੢ϞόΠϧΞϓϦݚڀձ

  2. JE4JYFJHIU w ג ͸ͯͳ w J04ΞϓϦॻ͖࢝ΊͯҰ೥ܦͬͨ w ࠷ۙͷτϐοΫ͕ͳ͍ͷ͕೰ΈͰ͢ w !UPNPIJ@SP

  3. 3FBEBCMF8JEUI

  4. ਓ͕ؒ಄Λಈ͔ͣ͞ʹจ ࣈ͕ಡΊΔ෯ ͬ͘͟Γ

  5. None
  6. None
  7. None
  8. 3FBEBCMF8JEUI

  9. None
  10. None
  11. ৄ͘͠͸

  12. ࢿྉݟ͍ͨͰ͢

  13. None
  14. ࣮ફ3FBEBCMF8JEUI ؔ੢ϞόΠϧΞϓϦݚڀձ

  15. ಺༰ w جຊ w 6*5BCMF w #BTJD$FMM w $VTUPN$FMM w

    8JUI"DDFTTPSZ7JFX w ίʔυ͔Βࢦఆ͢Δ
  16. ಺༰ w جຊ w 6*5BCMF w #BTJD$FMM w $VTUPN$FMM w

    8JUI"DDFTTPSZ7JFX w ίʔυ͔Βࢦఆ͢Δ
  17. None
  18. None
  19. None
  20. None
  21. -BZPVU.BSHJOT(VJEF MFBEJOHBODIPS

  22. None
  23. None
  24. 3FBEBCMF$POUFOU(VJEF MFBEJOHBODIPS

  25. ಺༰ w جຊ w 6*5BCMF w #BTJD$FMM w $VTUPN$FMM w

    8JUI"DDFTTPSZ7JFX w ίʔυ͔Βࢦఆ͢Δ
  26. None
  27. None
  28. DFMM-BZPVU.BSHJOT'PMM PX3FBEBCMF8JEUI class TableViewController: UITableViewController { override func viewDidLoad() {

    super.viewDidLoad() tableView.cellLayoutMarginsFollowReadableWidth = true } }
  29. None
  30. ಺༰ w جຊ w 6*5BCMF w #BTJD$FMM w $VTUPN$FMM w

    8JUI"DDFTTPSZ7JFX w ίʔυ͔Βࢦఆ͢Δ
  31. None
  32. None
  33. None
  34. None
  35. DFMM-BZPVU.BSHJOT'PMM PX3FBEBCMF8JEUI class TableViewController: UITableViewController { override func viewDidLoad() {

    super.viewDidLoad() tableView.cellLayoutMarginsFollowReadableWidth = true } }
  36. None
  37. ಺༰ w جຊ w 6*5BCMF w #BTJD$FMM w $VTUPN$FMM w

    8JUI"DDFTTPSZ7JFX w ίʔυ͔Βࢦఆ͢Δ
  38. None
  39. None
  40. None
  41. None
  42. None
  43. ಺༰ w جຊ w 6*5BCMF w #BTJD$FMM w $VTUPN$FMM w

    8JUIBDDFTTPSZWJFX w ίʔυ͔Βࢦఆ͢Δ
  44. None
  45. private func setup() { label = UILabel() label.text = "Section

    Header" label.font = UIFont.boldSystemFont(ofSize: 15) contentView.addSubview(label) } override func layoutSubviews() { super.layoutSubviews() label.sizeToFit() let insetY = (bounds.height - label.bounds.height) / 2 label.frame = bounds.insetBy(dx: 16, dy: insetY) }
  46. None
  47. private func setup() { label = UILabel() label.text = "Section

    Header" label.font = UIFont.boldSystemFont(ofSize: 15) label.translatesAutoresizingMaskIntoConstraints = false contentView.addSubview(label) let guide = contentView.readableContentGuide NSLayoutConstraint.activate([ label.topAnchor.constraint(equalTo: guide.topAnchor), label.bottomAnchor.constraint(equalTo: guide.bottomAnchor), label.leadingAnchor.constraint(equalTo: guide.leadingAnchor), label.trailingAnchor.constraint(equalTo: guide.trailingAnchor), ]) }
  48. None
  49. ·ͱΊ w 4VQFSWJFXͷ'PMMPX3FBEBCMF8JEUIΛ ༗ޮʹ͢Δ w 6*5BCMF7JFXͷ DFMM-BZPVU.BSHJOT'PMMPX3FBEBCMF8J EUIΛ࢖͏ w 6*7JFXͷSFBEBCMF$POUFOU(VJEFΛ࢖͏

  50. ϋοϐʔϋϩ΢Οϯ