Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SF Symbol name for device #280

Open
matiaskorhonen opened this issue Apr 28, 2021 · 5 comments
Open

SF Symbol name for device #280

matiaskorhonen opened this issue Apr 28, 2021 · 5 comments

Comments

@matiaskorhonen
Copy link

It would be great if DeviceKit could return the name of the correct SF symbol for a device.

For example:

Device.current.symbol_name

// or

Device.current.system_image

So, an iPhone 8 or earlier would return iphone.homebutton and home buttonless phones would return iphone and so forth…

iphone iphone.homebutton ipad ipad.homebutton
iphone iphone.homebutton ipad ipad.homebutton
@denisenepraunig
Copy link
Collaborator

Hahah, that would be a nice feature 😅. @Zandor300 what do you think?

@Zandor300
Copy link
Member

@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"
    }
}

@gabors
Copy link

gabors commented Apr 29, 2021

Great idea, let's not forget Macs and Apple TVs

@furiosFast
Copy link
Contributor

furiosFast commented Apr 19, 2023

hi,
how to do the same but with iphone 14 pro and the dynamic island?

UPDATE: is now possibile using .hasDynamicIsland

@kudit
Copy link

kudit commented Mar 21, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants