美文网首页
swift ipad iPhone 判断

swift ipad iPhone 判断

作者: 5eky2 | 来源:发表于2017-09-19 16:15 被阅读49次

import Foundation

import UIKit

extension UIDevice {

public class func isPad() -> Bool {

return UIDevice.current.userInterfaceIdiom == .pad

}

public class func isPhone() -> Bool {

return UIDevice.current.userInterfaceIdiom == .phone

}

}

相关文章

网友评论

      本文标题:swift ipad iPhone 判断

      本文链接:https://www.haomeiwen.com/subject/lstgsxtx.html