Open matiaskorhonen opened 3 years ago
Hahah, that would be a nice feature 😅. @Zandor300 what do you think?
@denisenepraunig Yeah, really nice. Could be implemented fairly easily I think using just Swift:
var sfSymbolName: String {
if isPhone {
return hasRoundedDisplayCorners ? "iphone" : "iphone.homebutton"
} else {
return hasRoundedDisplayCorners ? "ipad" : "ipad.homebutton"
}
}
Great idea, let's not forget Macs and Apple TVs
hi, how to do the same but with iphone 14 pro and the dynamic island?
UPDATE: is now possibile using .hasDynamicIsland
This feature has been added in this project: GitHub.com/kudit/Device It includes support for all 3 "generations" of iPhone (home button, notch, & Dynamic Island), 2 models of iPad, HomePod, Apple TV, Apple Vision, iPod touch, and Macs! (I could use some help adding more Mac models but there is an easy way to add additional devices without having to learn an obscure mapping).
It would be great if DeviceKit could return the name of the correct SF symbol for a device.
For example:
So, an iPhone 8 or earlier would return
iphone.homebutton
and home buttonless phones would returniphone
and so forth…iphone
iphone.homebutton
ipad
ipad.homebutton