WWDC - Improving Battery Life and Performance

每一开发阶段的Metric工具

截屏2020-10-19 上午11.00.43.png
  • XCTest Metrics
    Performance of measure blocks

  • MetricKit
    Framework for battery and performance metrics collection

  • Xcode Metrics Organizer
    Aggregated battery, performance, and I/O metrics in Xcode

MetricKit 集成

Step1

声明遵守MXMetricManagerSubscriber协议

@protocol MXMetricManagerSubscriber

Step2

[MXMetricManager sharedManager]注册Subscriber

[[MXMetricManager sharedManager] addSubscriber:self];

Step3

实现didReceiveMetricPayloads:方法,并处理数据

- (void)didReceiveMetricPayloads:(NSArray * _Nonnull)payloads{
}

其他

APL平均像素亮度

  • Color of UI on OLED displays impacts energy
  • Lighter colors = more energy (high APL)
  • Darker colors = less energy (low APL)

你可能感兴趣的:(WWDC - Improving Battery Life and Performance)