Fix iOS 12 issues

pull/79/head
Niels Andriesse 5 years ago
parent bb79a89b62
commit 32b772bbee

@ -6,14 +6,10 @@
<dict>
<key>CarthageVersion</key>
<string>0.34.0</string>
<key>DateTime</key>
<string>Mon Jan 20 04:58:06 UTC 2020</string>
<key>OSXVersion</key>
<string>10.15.1</string>
<key>WebRTCCommit</key>
<string>1445d719bf05280270e9f77576f80f973fd847f8 M73</string>
<key>XCodeVersion</key>
<string>1100.1120</string>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>

@ -12,9 +12,20 @@ final class DeviceLinkingModal : Modal, DeviceLinkingSessionDelegate {
// MARK: Components
private lazy var spinner = NVActivityIndicatorView(frame: CGRect.zero, type: .circleStrokeSpin, color: Colors.text, padding: nil)
private lazy var qrCodeImageViewContainer: UIView = {
let result = UIView()
result.addSubview(qrCodeImageView)
qrCodeImageView.pin(.top, to: .top, of: result)
qrCodeImageView.pin(.bottom, to: .bottom, of: result)
qrCodeImageView.center(.horizontal, in: result)
return result
}()
private lazy var qrCodeImageView: UIImageView = {
let result = UIImageView()
result.contentMode = .scaleAspectFit
result.set(.width, to: 128)
result.set(.height, to: 128)
return result
}()
@ -97,7 +108,7 @@ final class DeviceLinkingModal : Modal, DeviceLinkingSessionDelegate {
override func populateContentView() {
let stackView = UIStackView(arrangedSubviews: [ titleLabel, subtitleLabel, mnemonicLabel, buttonStackView ])
switch mode {
case .master: stackView.insertArrangedSubview(qrCodeImageView, at: 0)
case .master: stackView.insertArrangedSubview(qrCodeImageViewContainer, at: 0)
case .slave: stackView.insertArrangedSubview(spinner, at: 0)
}
contentView.addSubview(stackView)
@ -105,7 +116,6 @@ final class DeviceLinkingModal : Modal, DeviceLinkingSessionDelegate {
stackView.axis = .vertical
switch mode {
case .master:
qrCodeImageView.set(.height, to: 128)
let hexEncodedPublicKey = OWSIdentityManager.shared().identityKeyPair()!.hexEncodedPublicKey
qrCodeImageView.image = QRCode.generate(for: hexEncodedPublicKey, hasBackground: true)
case .slave:

@ -73,7 +73,13 @@ final class JoinPublicChatVC : UIViewController, UIPageViewControllerDataSource,
// Set up tab bar
view.addSubview(tabBar)
tabBar.pin(.leading, to: .leading, of: view)
tabBar.pin(.top, to: .top, of: view, withInset: navigationBar.height())
let tabBarInset: CGFloat
if #available(iOS 13, *) {
tabBarInset = navigationBar.height()
} else {
tabBarInset = 0
}
tabBar.pin(.top, to: .top, of: view, withInset: tabBarInset)
view.pin(.trailing, to: .trailing, of: tabBar)
// Set up page VC constraints
let pageVCView = pageVC.view!
@ -84,7 +90,13 @@ final class JoinPublicChatVC : UIViewController, UIPageViewControllerDataSource,
view.pin(.bottom, to: .bottom, of: pageVCView)
let screen = UIScreen.main.bounds
pageVCView.set(.width, to: screen.width)
let height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
let height: CGFloat
if #available(iOS 13, *) {
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
} else {
let statusBarHeight: CGFloat = 20
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight - statusBarHeight
}
pageVCView.set(.height, to: height)
enterChatURLVC.constrainHeight(to: height)
scanQRCodePlaceholderVC.constrainHeight(to: height)

@ -73,7 +73,13 @@ final class LinkDeviceVC : UIViewController, UIPageViewControllerDataSource, UIP
// Set up tab bar
view.addSubview(tabBar)
tabBar.pin(.leading, to: .leading, of: view)
tabBar.pin(.top, to: .top, of: view, withInset: navigationBar.height())
let tabBarInset: CGFloat
if #available(iOS 13, *) {
tabBarInset = navigationBar.height()
} else {
tabBarInset = 0
}
tabBar.pin(.top, to: .top, of: view, withInset: tabBarInset)
view.pin(.trailing, to: .trailing, of: tabBar)
// Set up page VC constraints
let pageVCView = pageVC.view!
@ -84,7 +90,13 @@ final class LinkDeviceVC : UIViewController, UIPageViewControllerDataSource, UIP
view.pin(.bottom, to: .bottom, of: pageVCView)
let screen = UIScreen.main.bounds
pageVCView.set(.width, to: screen.width)
let height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
let height: CGFloat
if #available(iOS 13, *) {
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
} else {
let statusBarHeight: CGFloat = 20
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight - statusBarHeight
}
pageVCView.set(.height, to: height)
enterPublicKeyVC.constrainHeight(to: height)
scanQRCodePlaceholderVC.constrainHeight(to: height)

@ -72,7 +72,13 @@ final class NewPrivateChatVC : UIViewController, UIPageViewControllerDataSource,
// Set up tab bar
view.addSubview(tabBar)
tabBar.pin(.leading, to: .leading, of: view)
tabBar.pin(.top, to: .top, of: view, withInset: navigationBar.height())
let tabBarInset: CGFloat
if #available(iOS 13, *) {
tabBarInset = navigationBar.height()
} else {
tabBarInset = 0
}
tabBar.pin(.top, to: .top, of: view, withInset: tabBarInset)
view.pin(.trailing, to: .trailing, of: tabBar)
// Set up page VC constraints
let pageVCView = pageVC.view!
@ -83,7 +89,13 @@ final class NewPrivateChatVC : UIViewController, UIPageViewControllerDataSource,
view.pin(.bottom, to: .bottom, of: pageVCView)
let screen = UIScreen.main.bounds
pageVCView.set(.width, to: screen.width)
let height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
let height: CGFloat
if #available(iOS 13, *) {
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
} else {
let statusBarHeight: CGFloat = 20
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight - statusBarHeight
}
pageVCView.set(.height, to: height)
enterPublicKeyVC.constrainHeight(to: height)
scanQRCodePlaceholderVC.constrainHeight(to: height)

@ -69,7 +69,7 @@ final class QRCodeVC : UIViewController, UIPageViewControllerDataSource, UIPageV
// Set up tab bar
view.addSubview(tabBar)
tabBar.pin(.leading, to: .leading, of: view)
tabBarTopConstraint = tabBar.pin(.top, to: .top, of: view)
tabBarTopConstraint = tabBar.autoPinEdge(toSuperviewSafeArea: .top)
view.pin(.trailing, to: .trailing, of: tabBar)
// Set up page VC constraints
let pageVCView = pageVC.view!
@ -80,7 +80,13 @@ final class QRCodeVC : UIViewController, UIPageViewControllerDataSource, UIPageV
view.pin(.bottom, to: .bottom, of: pageVCView)
let screen = UIScreen.main.bounds
pageVCView.set(.width, to: screen.width)
let height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
let height: CGFloat
if #available(iOS 13, *) {
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight
} else {
let statusBarHeight: CGFloat = 20
height = navigationController!.view.bounds.height - navigationBar.height() - Values.tabBarHeight - statusBarHeight
}
pageVCView.set(.height, to: height)
viewMyQRCodeVC.constrainHeight(to: height)
scanQRCodePlaceholderVC.constrainHeight(to: height)

@ -16,6 +16,7 @@ final class RegisterVC : UIViewController {
private lazy var copyPublicKeyButton: Button = {
let result = Button(style: .prominentOutline, size: .large)
result.setTitle(NSLocalizedString("Copy", comment: ""), for: UIControl.State.normal)
result.titleLabel!.font = .boldSystemFont(ofSize: Values.mediumFontSize)
result.addTarget(self, action: #selector(copyPublicKey), for: UIControl.Event.touchUpInside)
return result
}()

@ -4235,9 +4235,15 @@ typedef enum : NSUInteger {
[searchBar setImage:searchImage forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal];
UIImage *clearImage = [[UIImage imageNamed:@"searchbar_clear"] asTintedImageWithColor:LKColors.searchBarPlaceholder];
[searchBar setImage:clearImage forSearchBarIcon:UISearchBarIconClear state:UIControlStateNormal];
searchBar.searchTextField.backgroundColor = LKColors.searchBarBackground;
searchBar.searchTextField.textColor = LKColors.text;
searchBar.searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", @"") attributes:@{ NSForegroundColorAttributeName : LKColors.searchBarPlaceholder }];
UITextField *searchTextField;
if (@available(iOS 13, *)) {
searchTextField = searchBar.searchTextField;
} else {
searchTextField = (UITextField *)[searchBar valueForKey:@"_searchField"];
}
searchTextField.backgroundColor = LKColors.searchBarBackground;
searchTextField.textColor = LKColors.text;
searchTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"Search", @"") attributes:@{ NSForegroundColorAttributeName : LKColors.searchBarPlaceholder }];
searchBar.keyboardAppearance = UIKeyboardAppearanceDark;
[searchBar setPositionAdjustment:UIOffsetMake(4, 0) forSearchBarIcon:UISearchBarIconSearch];
[searchBar setSearchTextPositionAdjustment:UIOffsetMake(2, 0)];

@ -75,7 +75,9 @@ public class OWSNavigationBar: UINavigationBar {
return
}
backgroundColor = UIColor(rgbHex: 0x161616)
backgroundColor = UIColor(rgbHex: 0x161616) // Colors.navigationBarBackground
tintColor = UIColor(rgbHex: 0xFFFFFF) // Colors.text
if UIAccessibility.isReduceTransparencyEnabled {
blurEffectView?.isHidden = true

Loading…
Cancel
Save