Skip to content

Commit

Permalink
Dismiss about view controller correctly
Browse files Browse the repository at this point in the history
This should fix some KVO crashes due to the view controllers being
initialized strangely.
  • Loading branch information
saagarjha committed Nov 12, 2020
1 parent b942c1c commit 69ff9f6
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 47 deletions.
4 changes: 4 additions & 0 deletions app/AboutViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ - (void)dealloc {
[prefs removeObserver:self forKeyPath:@"bootCommand"];
}

- (IBAction)dismiss:(id)sender {
[self dismissViewControllerAnimated:self completion:nil];
}

- (void)exitRecovery:(id)sender {
[NSUserDefaults.standardUserDefaults setBool:NO forKey:@"recovery"];
exit(0);
Expand Down
7 changes: 2 additions & 5 deletions app/Base.lproj/About.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,11 @@
</connections>
</tableView>
<navigationItem key="navigationItem" title="About" id="bpe-0g-cWF">
<barButtonItem key="leftBarButtonItem" style="done" systemItem="done" id="vOn-qw-XSp">
<barButtonItem key="rightBarButtonItem" style="done" systemItem="done" id="vOn-qw-XSp">
<connections>
<segue destination="0yy-Uo-cZb" kind="custom" customClass="DismissSegue" id="xBv-BT-uv2"/>
<action selector="dismiss:" destination="yJz-O7-jlW" id="q2h-Xl-XBU"/>
</connections>
</barButtonItem>
<connections>
<outlet property="rightBarButtonItem" destination="vOn-qw-XSp" id="KNd-k0-V0z"/>
</connections>
</navigationItem>
<connections>
<outlet property="bootCommandField" destination="bKw-tV-nX1" id="MVz-gk-QE7"/>
Expand Down
16 changes: 0 additions & 16 deletions app/DismissSegue.h

This file was deleted.

16 changes: 0 additions & 16 deletions app/DismissSegue.m

This file was deleted.

1 change: 0 additions & 1 deletion app/UIViewController+Extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN

@interface UIViewController (Extras)

- (IBAction)unwind:(UIStoryboardSegue *)segue;
- (void)presentError:(NSError *)error title:(NSString *)title;

@end
Expand Down
3 changes: 0 additions & 3 deletions app/UIViewController+Extras.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

@implementation UIViewController (Extras)

- (IBAction)unwind:(UIStoryboardSegue *)segue {
}

- (void)presentError:(NSError *)error title:(NSString *)title {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:error.localizedDescription preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
Expand Down
6 changes: 0 additions & 6 deletions iSH.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
BBCE66E2249A807700F45269 /* root.tar.gz in Resources */ = {isa = PBXBuildFile; fileRef = BBF124901FA7C3100088FB50 /* root.tar.gz */; };
BBFB55662158644C00DFE6DE /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = BBFB55652158644C00DFE6DE /* libresolv.tbd */; };
BBFB557121586C4800DFE6DE /* UIViewController+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = BBFB557021586C4800DFE6DE /* UIViewController+Extras.m */; };
BBFB557621586F9200DFE6DE /* DismissSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = BBFB557521586F9200DFE6DE /* DismissSegue.m */; };
BBFB5579215876CD00DFE6DE /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BBFB5578215876CD00DFE6DE /* AboutViewController.m */; };
BBFB557C215878C600DFE6DE /* UIApplication+OpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = BBFB557B215878C600DFE6DE /* UIApplication+OpenURL.m */; };
BBFB558021587B6800DFE6DE /* ArrowBarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = BBFB557F21587B6800DFE6DE /* ArrowBarButton.m */; };
Expand Down Expand Up @@ -494,8 +493,6 @@
BBFB55652158644C00DFE6DE /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
BBFB556F21586C4800DFE6DE /* UIViewController+Extras.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Extras.h"; sourceTree = "<group>"; };
BBFB557021586C4800DFE6DE /* UIViewController+Extras.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Extras.m"; sourceTree = "<group>"; };
BBFB557421586F9200DFE6DE /* DismissSegue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DismissSegue.h; sourceTree = "<group>"; };
BBFB557521586F9200DFE6DE /* DismissSegue.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DismissSegue.m; sourceTree = "<group>"; };
BBFB5577215876CD00DFE6DE /* AboutViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = "<group>"; };
BBFB5578215876CD00DFE6DE /* AboutViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AboutViewController.m; sourceTree = "<group>"; };
BBFB557A215878C600DFE6DE /* UIApplication+OpenURL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIApplication+OpenURL.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -947,8 +944,6 @@
BBFB557021586C4800DFE6DE /* UIViewController+Extras.m */,
BBFB557A215878C600DFE6DE /* UIApplication+OpenURL.h */,
BBFB557B215878C600DFE6DE /* UIApplication+OpenURL.m */,
BBFB557421586F9200DFE6DE /* DismissSegue.h */,
BBFB557521586F9200DFE6DE /* DismissSegue.m */,
);
name = Utilities;
sourceTree = "<group>";
Expand Down Expand Up @@ -1423,7 +1418,6 @@
BBAEE33C249BDADC0069EBB5 /* ProgressReportViewController.m in Sources */,
BB78AB2B1FAD22440013E782 /* TerminalView.m in Sources */,
BB23F58D231E1D1400585522 /* ScrollbarView.m in Sources */,
BBFB557621586F9200DFE6DE /* DismissSegue.m in Sources */,
BB455E111FB37F6600AFB48B /* DelayedUITask.m in Sources */,
BB0FC5921F980A6C00803272 /* Terminal.m in Sources */,
BB101B382364CF57000A93BC /* FontPickerViewController.m in Sources */,
Expand Down

0 comments on commit 69ff9f6

Please sign in to comment.