パフォーマンス改善とユニットテスト

E45f9c343d90c74554c65c89c6f861bc?s=47 shtnkgm
March 26, 2019

 パフォーマンス改善とユニットテスト

Bonfire iOS #5 発表資料

E45f9c343d90c74554c65c89c6f861bc?s=128

shtnkgm

March 26, 2019
Tweet

Transcript

  1. 10.
  2. 33.

    // Tips: ΞΫηεम০ࢠΛมߋ͢Δ // before @IBOutlet private weak var titleLabel:

    UILabel! // after @IBOutlet private(set) weak var titleLabel: UILabel!
  3. 34.

    // Tips: subviews͔ΒಛఆΫϥεViewͷΈΛऔಘ͢Δ let labels = view.findViews(subclassOf: UILabel.self) let tabViews

    = view.findViews(subclassOf: TabView.self) extension UIView { var recursiveSubviews: [UIView] { return subviews + subviews.flatMap { $0.recursiveSubviews } } func findViews<T: UIView>(subclassOf: T.Type) -> [T] { return recursiveSubviews.compactMap { $0 as? T } } }
  4. 35.

    // Tips: දࣔ׬ྃͷ଴ػ func waitUntil(condition: () -> Bool) { while

    !condition() { RunLoop.main.run(until: Date(timeIntervalSinceNow: 0.001)) } }
  5. 40.
  6. 41.
  7. 42.
  8. 43.
  9. 54.