Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use viewDidLoad over awakeFromNib for KVO init #983

Merged
merged 1 commit into from
Oct 26, 2020
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
Use viewDidLoad over awakeFromNib for KVO init
awakeFromNib can potentially be called multiple times; in our case twice
because it needs to load the view controller and then the file owner,
which is the view controller again. viewDidLoad is called once.

Also, remove a duplicate segue.
  • Loading branch information
saagarjha committed Oct 25, 2020
commit 4ba3852d9cecf9b3c9e8437b9000d2300e46b91b
3 changes: 0 additions & 3 deletions app/Roots.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="2wD-dq-vPG" kind="show" id="qCX-jp-cr9"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="Default Root" textLabel="c8w-0c-rgD" detailTextLabel="s1e-Wg-AtO" style="IBUITableViewCellStyleSubtitle" id="o8d-j7-u1g">
<rect key="frame" x="0.0" y="99" width="736" height="55.666667938232422"/>
Expand Down
4 changes: 2 additions & 2 deletions app/RootsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ @interface RootDetailViewController : UITableViewController <UIDocumentPickerDel

@implementation RootsTableViewController

- (void)awakeFromNib {
[super awakeFromNib];
- (void)viewDidLoad {
[super viewDidLoad];
[Roots.instance addObserver:self forKeyPath:@"roots" options:0 context:nil];
[Roots.instance addObserver:self forKeyPath:@"defaultRoot" options:0 context:nil];
}
Expand Down