Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,18 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

[self.detailLabel.topAnchor constraintEqualToAnchor:self.titleLabel.bottomAnchor constant:4].active = YES;

[self.detailLabel.leftAnchor constraintEqualToAnchor:self.profileImageView.rightAnchor constant:12].active = YES;
[self.detailLabel.leftAnchor constraintEqualToAnchor:self.profileImageView.rightAnchor constant:12].active = YES;

[self registerForTraitChanges:@[UITraitUserInterfaceStyle.self] withHandler:^(SFSDKUITableViewCell *cell, UITraitCollection *previousCollection) {
[cell updateLayerColor];
}];
return self;
}

- (void)updateLayerColor {
self.layer.borderColor = [UIColor salesforceSystemBackgroundColor].CGColor;
}

- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
[super traitCollectionDidChange:previousTraitCollection];
if ([self.traitCollection hasDifferentColorAppearanceComparedToTraitCollection:previousTraitCollection]) {
[self updateLayerColor];
}
}

- (void)awakeFromNib {
[super awakeFromNib];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ class RootViewController: UIViewController {
super.viewDidLoad()
self.view.backgroundColor = UIColor.appContentBackground

registerForTraitChanges([UITraitUserInterfaceStyle.self]) { (self: RootViewController, _: UITraitCollection) in
self.updateBorderColor()
}

NotificationCenter.default.addObserver(self,
selector: #selector(clearPopoversForPasscode),
name: NSNotification.Name(rawValue: kSFScreenLockFlowWillBegin),
Expand Down Expand Up @@ -541,12 +545,6 @@ class RootViewController: UIViewController {
return self.responseSection.container
}

override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
self.updateBorderColor()
}
}

func updateBorderColor() -> Void {
for textField in self.textFields {
Expand Down
Loading