Dismiss about view controller correctly

This should fix some KVO crashes due to the view controllers being
initialized strangely.
This commit is contained in:
Saagar Jha
2020-11-11 22:29:59 -08:00
parent b942c1cb8b
commit 69ff9f6f17
7 changed files with 6 additions and 47 deletions
+4
View File
@@ -62,6 +62,10 @@
[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);
+2 -5
View File
@@ -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"/>
-16
View File
@@ -1,16 +0,0 @@
//
// DismissSegue.h
// iSH
//
// Created by Theodore Dubois on 9/23/18.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface DismissSegue : UIStoryboardSegue
@end
NS_ASSUME_NONNULL_END
-16
View File
@@ -1,16 +0,0 @@
//
// DismissSegue.m
// iSH
//
// Created by Theodore Dubois on 9/23/18.
//
#import "DismissSegue.h"
@implementation DismissSegue
- (void)perform {
[self.sourceViewController.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}
@end
-1
View File
@@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface UIViewController (Extras)
- (IBAction)unwind:(UIStoryboardSegue *)segue;
- (void)presentError:(NSError *)error title:(NSString *)title;
@end
-3
View File
@@ -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]];
-6
View File
@@ -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 */; };
@@ -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>"; };
@@ -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>";
@@ -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 */,