设备和屏幕尺寸检测 Device
- 授权协议: MIT
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/Ekhoo/Device
软件介绍
Device 是轻量级工具,检测当前的设备和屏幕尺寸。
设备版本使用示例:
func myFunc() {
/*** Display the device version ***/
switch Device.version() {
/*** iPhone ***/
case .iPhone4: print("It's an iPhone 4")
case .iPhone4S: print("It's an iPhone 4S")
case .iPhone5: print("It's an iPhone 5")
case .iPhone5C: print("It's an iPhone 5C")
case .iPhone5S: print("It's an iPhone 5S")
case .iPhone6: print("It's an iPhone 6")
case .iPhone6S: print("It's an iPhone 6S")
case .iPhone6Plus: print("It's an iPhone 6 Plus")
case .iPhone6PlusS: print("It's an iPhone 6 Plus S")
/*** iPad ***/
case .iPad1: print("It's an iPad 1")
case .iPad2: print("It's an iPad 2")
case .iPad3: print("It's an iPad 3")
case .iPad4: print("It's an iPad 4")
case .iPadAir: print("It's an iPad Air")
case .iPadAir2: print("It's an iPad Air 2")
case .iPadMini: print("It's an iPad Mini")
case .iPadMini2: print("It's an iPad Mini 2")
case .iPadMini3: print("It's an iPad Mini 3")
case .iPadMini4: print("It's an iPad Mini 4")
case .iPadPro: print("It's an iPad Pro")
/*** iPod ***/
case .iPodTouch1Gen: print("It's a iPod touch generation 1")
case .iPodTouch2Gen: print("It's a iPod touch generation 2")
case .iPodTouch3Gen: print("It's a iPod touch generation 3")
case .iPodTouch4Gen: print("It's a iPod touch generation 4")
case .iPodTouch5Gen: print("It's a iPod touch generation 5")
case .iPodTouch6Gen: print("It's a iPod touch generation 6")
/*** Simulator ***/
case .Simulator: print("It's a Simulator")
/*** Unknown ***/
default: print("It's an unknown device")
}
}屏幕版本示例:
func myFucn() {
/*** Display the device screen size ***/
switch Device.size() {
case .Screen3_5Inch: print("It's a 3.5 inch screen")
case .Screen4Inch: print("It's a 4 inch screen")
case .Screen4_7Inch: print("It's a 4.7 inch screen")
case .Screen5_5Inch: print("It's a 5.5 inch screen")
default: print("Unknown size")
}
}白帽子讲浏览器安全
钱文祥 / 电子工业出版社 / 2016-3 / 79.00元
浏览器是重要的互联网入口,一旦受到漏洞攻击,将直接影响到用户的信息安全。作为攻击者有哪些攻击思路,作为用户有哪些应对手段?在《白帽子讲浏览器安全》中我们将给出解答,带你了解浏览器安全的方方面面。《白帽子讲浏览器安全》兼顾攻击者、研究者和使用者三个场景,对大部分攻击都提供了分析思路和防御方案。《白帽子讲浏览器安全》从攻击者常用技巧的“表象”深入介绍浏览器的具体实现方式,让你在知其然的情况下也知其所以......一起来看看 《白帽子讲浏览器安全》 这本书的介绍吧!
