How do you get an iPhone's device name

前端 未结 9 1560
我在风中等你
我在风中等你 2020-11-29 22:26

If you open Settings -> General -> About, it\'ll say Bob\'s iPhone at the top of the screen. How do you programmatically grab that name?

相关标签:
9条回答
  • 2020-11-29 23:24

    For Swift 4+ versions, please use the below code:

    UIDevice.current.name
    
    0 讨论(0)
  • 2020-11-29 23:28

    Remember: import UIKit

    Swift:

    UIDevice.currentDevice().name
    

    Swift 3, 4, 5:

    UIDevice.current.name
    
    0 讨论(0)
  • 2020-11-29 23:29

    In Unity, using C#:

    SystemInfo.deviceName;
    
    0 讨论(0)
提交回复
热议问题