Use SF Symbol 3 battery icons for iOS 15
Open, LowPublic

Description

In addition to existing 100, 25, and 0 battery charge percentage icons, SF Symbol 3 introduced 75 and 50 for devices running iOS 15.

  • Use the additional symbols when available on iOS 15
    • It's probably a good idea to discuss with the maintainers the percentages for each symbol and get a confirmation
  • Try to eliminate the "unknown state" in the current codebase
    • okay to use precondition to assert certain conditions are met in the catch-all branch, or fatalError for the impossible branch
apollozhu triaged this task as Low priority.
apollozhu updated the task description. (Show Details)
apollozhu updated the task description. (Show Details)Dec 31 2021, 6:53 AM
ivanveloz added a subscriber: ivanveloz.EditedAug 16 2022, 1:03 AM

I would like to propose this mapping for the percentage symbols:

Charge levelSymbol
Chargingbattery.100.bolt
x >= 85%battery.100
x >= 65%battery.75
x >= 35%battery.50
x >= 10%battery.25
x < 10%battery.0

On iOS 14 and below, the mapping would remain this:

Chargingbattery.100.bolt
x >= 40%battery.100
x >= 10%battery.25
x < 10%battery.0

Let me know what you think.

Sorry for not getting to this earlier, looks good to me!

Hi @apollozhu, I'm currently working on this feature as well as the "unknown states" issues you mentioned. It would be great if you can give me more details about those unknown states.

Sorry of the late reply. By unknown state I mean the case in which we return "camera.metering.unknown". in Battery.swift. There's probably a case in which it is truly needed, but currently it's hard to reason when that's the case.