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

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
shtnkgm
March 26, 2019

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

Bonfire iOS #5 発表資料

shtnkgm

March 26, 2019

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

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

    UILabel! // after @IBOutlet private(set) weak var titleLabel: UILabel!
  2. // 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 } } }
  3. // Tips: දࣔ׬ྃͷ଴ػ func waitUntil(condition: () -> Bool) { while

    !condition() { RunLoop.main.run(until: Date(timeIntervalSinceNow: 0.001)) } }

More Decks by shtnkgm

Other Decks in Programming