gpt4 book ai didi

iphone - Objective C 宏的 Swift 版本 : IS_IPHONE5

转载 作者:行者123 更新时间:2023-11-30 10:16:01 25 4
gpt4 key购买 nike

我需要以下 Obj.C 宏的 swift 版本

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

#define IS_IPHONE5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f)

最佳答案

class 标记之外定义这些

let IS_IPHONE = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.Phone
let IS_IPHONE5 = IS_IPHONE && UIScreen.mainScreen().bounds.size.height == 568.0

关于iphone - Objective C 宏的 Swift 版本 : IS_IPHONE5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29893587/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com