AppleHardwareType

public enum AppleHardwareType

Used to convert an Apple device model name (in the form iPhone10,3) to a human readable form (such as iPhoneX). This enum works with the HardwareInformation class to get the type of device the app is running on.

Example:

// Get human-readable name (iPhoneX)
let device = AppleHardwareType(fromModel: "iPhone10,3")
  • Undocumented

    Declaration

    Swift

    public enum AppleHardwareType
  • An original iPhone.

    Declaration

    Swift

    case iPhone
  • An iPhone 3G.

    Declaration

    Swift

    case iPhone3G
  • An iPhone 3GS.

    Declaration

    Swift

    case iPhone3GS
  • An iPhone 4.

    Declaration

    Swift

    case iPhone4
  • An iPhone 4S.

    Declaration

    Swift

    case iPhone4S
  • An iPhone 5.

    Declaration

    Swift

    case iPhone5
  • An iPhone 5C.

    Declaration

    Swift

    case iPhone5C
  • An iPhone 5S.

    Declaration

    Swift

    case iPhone5S
  • An iPhone 6.

    Declaration

    Swift

    case iPhone6
  • An iPhone 6 Plus.

    Declaration

    Swift

    case iPhone6Plus
  • An iPhone 6S.

    Declaration

    Swift

    case iPhone6S
  • An iPhone 6S Plus.

    Declaration

    Swift

    case iPhone6SPlus
  • An iPhone SE.

    Declaration

    Swift

    case iPhoneSE
  • An iPhone 7.

    Declaration

    Swift

    case iPhone7
  • An iPhone 7 Plus.

    Declaration

    Swift

    case iPhone7Plus
  • An iPhone 8.

    Declaration

    Swift

    case iPhone8
  • An iPhone 8 Plus.

    Declaration

    Swift

    case iPhone8Plus
  • An iPhone X

    Declaration

    Swift

    case iPhoneX
  • An original iPad.

    Declaration

    Swift

    case iPad
  • An iPad 2.

    Declaration

    Swift

    case iPad2
  • An iPad Mini

    Declaration

    Swift

    case iPadMini
  • An iPad 3.

    Declaration

    Swift

    case iPad3
  • An iPad 4.

    Declaration

    Swift

    case iPad4
  • An iPad Air.

    Declaration

    Swift

    case iPadAir
  • An iPad Mini 2.

    Declaration

    Swift

    case iPadMini2
  • An iPad Mini 3.

    Declaration

    Swift

    case iPadMini3
  • An iPad Mini 4.

    Declaration

    Swift

    case iPadMini4
  • An iPad Air 4

    Declaration

    Swift

    case iPadAir2
  • An iPad Pro 12".

    Declaration

    Swift

    case iPadPro12In
  • An iPad Pro 9".

    Declaration

    Swift

    case iPadPro9In
  • An iPad 4th Generation.

    Declaration

    Swift

    case iPad5thGen
  • An iPad Pro 12: 2nd Generation.

    Declaration

    Swift

    case iPadPro12In2ndGen
  • An iPad Pro 10".

    Declaration

    Swift

    case iPadPro10In
  • An original iPodTouch.

    Declaration

    Swift

    case iPodTouch
  • An iPad Touch 2nd Generation.

    Declaration

    Swift

    case iPodTouch2ndGen
  • An iPad Touch 3rd Generation.

    Declaration

    Swift

    case iPodTouch3rdGen
  • An iPod Touch 4th Generation.

    Declaration

    Swift

    case iPodTouch4thGen
  • An iPod Touch 5th Generation.

    Declaration

    Swift

    case iPodTouch5thGen
  • An iPodTouch 6th Generation.

    Declaration

    Swift

    case iPodTouch6thGen
  • An Apple TV 2nd Generation.

    Declaration

    Swift

    case appleTV2ndGen
  • An Apple TV 3rd Generation.

    Declaration

    Swift

    case appleTV3rdGen
  • An Apple TV 4th Generation.

    Declaration

    Swift

    case appleTV4thGen
  • An Apple TV 4K.

    Declaration

    Swift

    case appleTV4K
  • An original AirPod.

    Declaration

    Swift

    case airPods
  • An original Apple Watch.

    Declaration

    Swift

    case appleWatch
  • An Apple Watch Series 1.

    Declaration

    Swift

    case appleWatchSeries1
  • An Apple Watch Series 2.

    Declaration

    Swift

    case appleWatchSeries2
  • An Apple Watch Series 3.

    Declaration

    Swift

    case appleWatchSeries3
  • An original HomePod.

    Declaration

    Swift

    case homePod
  • A 2010 MacBook 13" Display.

    Declaration

    Swift

    case macBook13In2010
  • A Late 2009 MacBook 13" Display.

    Declaration

    Swift

    case macBook13InLate2009
  • An Early-Mid 2009 MacBook 13" Display.

    Declaration

    Swift

    case macBook13In2009
  • A 2015 MacBook Air 11" Display.

    Declaration

    Swift

    case macBookAir11In2015
  • A 2012 MacBook Air 13" Display.

    Declaration

    Swift

    case macBookAir13In2012
  • A 2012 MacBook Air 11" DIsplay.

    Declaration

    Swift

    case macBookAir11In2012
  • A 2011 MacBook Air 13" Display.

    Declaration

    Swift

    case macBookAir13In2011
  • A 2011 MacBook Air 11" Display.

    Declaration

    Swift

    case macBookAir11In2011
  • A 2010 MacBook Air 13" Display.

    Declaration

    Swift

    case macBookAir13In2010
  • A 2010 MacBook Air 11" Display.

    Declaration

    Swift

    case macBookAir11In2010
  • A 2009 MacBook Air.

    Declaration

    Swift

    case macBookAir2009
  • A 2017 MacBook Pro 15" Display.

    Declaration

    Swift

    case macBookPro15In2017
  • A 2017 MacBook Pro 13" Display.

    Declaration

    Swift

    case macBookPro13In2017
  • A 2016 MacBook Pro 15" Display.

    Declaration

    Swift

    case macBookPro15In2016
  • A 2016 MacBook Pro 13" Display.

    Declaration

    Swift

    case macBookPro13In2016
  • A 2012 MacBook Pro 15" Display.

    Declaration

    Swift

    case macBookPro15In2012
  • A 2012 MacBook Pro 13" Display.

    Declaration

    Swift

    case macBookPro13In2012
  • A 2011 MacBook Pro 17" Display.

    Declaration

    Swift

    case macBookPro17In2011
  • A 2011 MacBook Pro 15" Display.

    Declaration

    Swift

    case macBookPro15In2011
  • A 2011 MacBook Pro 13" Display.

    Declaration

    Swift

    case macBookPro13In2011
  • A 2010 MacBook Pro 17" Display.

    Declaration

    Swift

    case macBookPro17In2010
  • A 2010 MacBook Pro 13" Display.

    Declaration

    Swift

    case macBookPro13In2010
  • A 2009 MacBook Pro 17" Display.

    Declaration

    Swift

    case macBookPro17In2009
  • A 2009 MacBook Pro 15" Display.

    Declaration

    Swift

    case macBookPro15In2009
  • A 2009 MacBook Pro 13" Display.

    Declaration

    Swift

    case macBookPro13In2009
  • A 2006 Mac Mini.

    Declaration

    Swift

    case macMini2006
  • A 2007 Mac Mini.

    Declaration

    Swift

    case macMini2007
  • A 2009 Mac Mini.

    Declaration

    Swift

    case macMini2009
  • A 2010 Mac Mini.

    Declaration

    Swift

    case macMini2010
  • A 2011 Mac Mini.

    Declaration

    Swift

    case macMini2011
  • A 2012 Mac Mini.

    Declaration

    Swift

    case macMini2012
  • A 2014 Mac Mini.

    Declaration

    Swift

    case macMini2014
  • A 2013 Mac Pro.

    Declaration

    Swift

    case macPro2013
  • A 2009 Mac Pro.

    Declaration

    Swift

    case macPro2009
  • A 2017 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2017
  • A 2017 iMac 21" 4K Retina Display.

    Declaration

    Swift

    case iMacRetina4K21In2017
  • A 2017 iMac 27" 5K Retina Display.

    Declaration

    Swift

    case iMacRetina5K27In2017
  • A 2015 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2015
  • A 2015 iMac 21" 4K Retina Display.

    Declaration

    Swift

    case iMacRetina4K21In2015
  • A 2014 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2014
  • A 2013 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2013
  • A 2013 iMac 27" Display.

    Declaration

    Swift

    case iMac27In2013
  • A 2012 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2012
  • A 2012 iMac 27" Display.

    Declaration

    Swift

    case iMac27In2012
  • A 2011 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2011
  • A 2011 iMac 27" Display.

    Declaration

    Swift

    case iMac27In2011
  • A 2009-2010 iMac 21" Display.

    Declaration

    Swift

    case iMac21In2009To2010
  • A 2009-2010 iMac 27" Display.

    Declaration

    Swift

    case iMac27In2009To2010
  • A 2009 iMac 20or 24 Display.

    Declaration

    Swift

    case iMac20InOr24In2009
  • Takes a device model name in the form iPhone10,3 and sets the enum to its human readable counterpart iPhoneX.

    Declaration

    Swift

    public init(fromModel model: String)

    Parameters

    model

    The given device model string to convert.

    Return Value

    The human readable name or unknown if unable to convert.