mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-04 11:42:39 -06:00
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> This PR removes the `options` parameters which use the default value. ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> <img width="1014" alt="Screenshot 2024-03-03 at 21 17 55" src="https://github.com/home-assistant/iOS/assets/35694712/85324caf-c36d-4366-a9f8-9c349192a361"> <img width="1049" alt="Screenshot 2024-03-03 at 21 17 17" src="https://github.com/home-assistant/iOS/assets/35694712/cebddbe6-8ea4-415e-b12a-0e35f86bf5a3"> <img width="1022" alt="Screenshot 2024-03-03 at 21 16 53" src="https://github.com/home-assistant/iOS/assets/35694712/ccccb902-9791-42f6-8868-5900093c40ae"> <img width="991" alt="Screenshot 2024-03-03 at 21 16 28" src="https://github.com/home-assistant/iOS/assets/35694712/f2f33685-a55c-47ed-a555-8cc0fc1561ce"> <img width="1329" alt="Screenshot 2024-03-03 at 21 16 00" src="https://github.com/home-assistant/iOS/assets/35694712/2dc156da-29d6-44e4-a064-4fbdb79139bd"> <img width="1130" alt="Screenshot 2024-03-03 at 21 14 53" src="https://github.com/home-assistant/iOS/assets/35694712/628dd2ff-5bba-4ee7-912b-cdbdf73f18b2">
15 lines
456 B
Swift
15 lines
456 B
Swift
import Foundation
|
|
|
|
public extension NSMutableAttributedString {
|
|
func addMissingAttributes(_ attributes: [Key: Any]) {
|
|
let range = NSRange(location: 0, length: string.utf16.count)
|
|
for (key, newValue) in attributes {
|
|
enumerateAttribute(key, in: range) { value, range, _ in
|
|
if value == nil {
|
|
addAttribute(key, value: newValue, range: range)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|