 
 import UIKit
 
+extension RGAppTools where Base: UIDevice {
+
+    /// 获取设备时间
+    public var deviceTime: String {
+        let deviceTime = Date()
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
+        return dateFormatter.string(from: deviceTime)
+    }
+    
+    /// 判断是否为 iPhone X 系列
+    public static var isIPhoneXSeries: Bool {
+        var iPhoneXSeries = false
+        if UIDevice.rat.isPhone == false {
+            return iPhoneXSeries
+        }
+        
+        if #available(iOS 11.0, *)  {
+            if let bottom = UIApplication.shared.delegate?.window??.safeAreaInsets.bottom {
+                if bottom > CGFloat(0.0) {
+                    iPhoneXSeries = true
+                }
+            }
+        }
+        
+        return iPhoneXSeries
+    }
+
+    /// 判断设备是否为 iPhone
+    public static var isPhone: Bool {
+        return UIDevice.current.userInterfaceIdiom == .phone
+    }
+    
+    /// 判断设备是否为 iPad
+    public static var isPad: Bool {
+        return UIDevice.current.userInterfaceIdiom == .pad
+    }
+
+    /// 打印当前设备信息
+    public static func printDeviceInformations() {
+        print("currentDevice: ", UIDevice.current)
+
+        let device = UIDevice()
+        print("device.name: ", device.name)
+        print("device.model: ", device.model)
+        print("device.localizedModel: ", device.localizedModel)
+
+        print("device.systemName: ", device.systemName)
+        print("device.systemVersion: ", device.systemVersion)
+
+        print("device.identifierForVendor: ", device.identifierForVendor ?? "\nRGAppTools get device.identifierForVendor failed.")
+    }
+
+}
+
+
 /// Enum of Device Types
 public enum DeviceType: String {
     case unknown    =   "unknown",
-    
+
     //  iPhone
     iPhone_2G           =   "iPhone",
     iPhone_3G           =   "iPhone 3G",

        case "iPhone9,2", "iPhone9,4":
            print("iPhone 7 Plus")
            return .iPhone_7_Plus
            
        case "iPhone10,1", "iPhone10,4":
            print("iPhone 8")
            return .iPhone_8
            
        case "iPhone10,2", "iPhone10,5":
            print("iPhone 8 Pllus")
            return .iPhone_8_Plus
            
        case "iPhone10,3", "iPhone10,6":
            print("iPhone X")
            return .iPhone_X

        case "iPad4,1", "iPad4,2", "iPad4,3":
            print("iPad Air")
            return .iPad_Air

        case "iPad4,4", "iPad4,5", "iPad4,6":
            print("iPad Mini 2")
            return .iPad_Mini_2

        case "iPad4,7", "iPad4,8", "iPad4,9":
            print("iPad Mini 3")
            return .iPad_Mini_3

        case "iPad5,1", "iPad5,2":
            print("iPad Mini 4")
            return .iPad_Mini_4
