Skip to content

Instantly share code, notes, and snippets.

View lenhhoxung86's full-sized avatar

Tiendh lenhhoxung86

View GitHub Profile
@lenhhoxung86
lenhhoxung86 / DeviceModel.swift
Created November 2, 2017 12:34 — forked from JonFir/DeviceModel.swift
Get device model in Swift
// Note: More information can be found here
// https://www.theiphonewiki.com/wiki/Models
import UIKit
public extension UIDevice {
var modelName: String {
var systemInfo = utsname()
uname(&systemInfo)
let machineMirror = Mirror(reflecting: systemInfo.machine)