Commit 8aaa0e53 authored by David黄金龙's avatar David黄金龙

处理 一键登录 在模拟器 和 真机上的不同

parent 495fe4f0
...@@ -355,6 +355,10 @@ extension YHOneKeyLoginManager { ...@@ -355,6 +355,10 @@ extension YHOneKeyLoginManager {
attributes: attributes, attributes: attributes,
context: nil context: nil
).size ).size
#if targetEnvironment(simulator)
// 这段代码只会在模拟器上编译
let textHeight = ceill(Float80(boundingSize.height)) let textHeight = ceill(Float80(boundingSize.height))
model.privacyAlertPrivacyContentFrameBlock = { model.privacyAlertPrivacyContentFrameBlock = {
...@@ -362,13 +366,16 @@ extension YHOneKeyLoginManager { ...@@ -362,13 +366,16 @@ extension YHOneKeyLoginManager {
return CGRectMake(21.0, 15.0+24.0+33.0, alertContentWidth, CGFloat(textHeight)) return CGRectMake(21.0, 15.0+24.0+33.0, alertContentWidth, CGFloat(textHeight))
} }
currentTop = currentTop + 33.0 + Double(textHeight) currentTop = currentTop + 33.0 + Double(textHeight)
#if targetEnvironment(simulator)
// 这段代码只会在模拟器上编译
print("This is running on a simulator.")
#else #else
// 这段代码只会在真机上编译 // 这段代码只会在真机上编译
print("This is running on a physical device.") let textHeight = ceill(boundingSize.height)
model.privacyAlertPrivacyContentFrameBlock = {
screenSize, superViewSize, frame in
return CGRectMake(21.0, 15.0+24.0+33.0, alertContentWidth, CGFloat(textHeight))
}
currentTop = currentTop + 33.0 + Double(textHeight)
model.privacyAlertButtonFrameBlock = { model.privacyAlertButtonFrameBlock = {
screenSize, superViewSize, frame in screenSize, superViewSize, frame in
return CGRectMake(16, 15+24+33+textHeight+36.0, alertBtnWith, alertBtnHeight) return CGRectMake(16, 15+24+33+textHeight+36.0, alertBtnWith, alertBtnHeight)
......
...@@ -301,8 +301,21 @@ class YHAddFriendCardCell: UITableViewCell { ...@@ -301,8 +301,21 @@ class YHAddFriendCardCell: UITableViewCell {
attributes: attributes, attributes: attributes,
context: nil context: nil
).size ).size
let textHeight = ceill(Float80(boundingSize.height))
return CGFloat(textHeight)
#if targetEnvironment(simulator)
// 这段代码只会在模拟器上编译
print("This is running on a simulator.")
let textHeight : CGFloat = CGFloat(ceill(Float80(CGFloat(boundingSize.height))))
return textHeight
#else
// 这段代码只会在真机上编译
print("This is running on a physical device.")
let textHeight : CGFloat = ceill(CGFloat(boundingSize.height))
return textHeight
#endif
return 0.0
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment