remove OWSNavigationControllerBase

This appears to have been a hack for something that may have been
necessary in older versions of iOS. Current iOS seems to just return
true with no side-effects from this super call so there's no reason to
retain this hack apparent.
This commit is contained in:
Ehren Kret 2024-04-28 23:19:43 -05:00
parent 8bd714e847
commit 30424e19ae
11 changed files with 10 additions and 71 deletions

View File

@ -76,10 +76,8 @@
3402AA55271D9DCD0084CBAE /* AttachmentTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95597271B510500B05242 /* AttachmentTextView.swift */; };
3402AA56271D9DCD0084CBAE /* FindByPhoneNumberViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A9557D271B510500B05242 /* FindByPhoneNumberViewController.swift */; };
3402AA57271D9DCD0084CBAE /* MediaMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95578271B510500B05242 /* MediaMessageView.swift */; };
3402AA58271D9DCD0084CBAE /* OWSNavigationControllerBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A9556B271B510500B05242 /* OWSNavigationControllerBase.m */; };
3402AA5A271D9DCD0084CBAE /* OWSTableViewController2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A9558B271B510500B05242 /* OWSTableViewController2.swift */; };
3402AA5B271D9DCD0084CBAE /* StickerPackCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A95570271B510500B05242 /* StickerPackCollectionView.swift */; };
3402AA5D271D9DCD0084CBAE /* OWSNavigationControllerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 34A95582271B510500B05242 /* OWSNavigationControllerBase.h */; settings = {ATTRIBUTES = (Public, ); }; };
3402AA62271D9DEC0084CBAE /* ThreadUtil+SignalUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3402A9FC271D9CB80084CBAE /* ThreadUtil+SignalUI.swift */; };
3402AA63271D9DEC0084CBAE /* ContactShareViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A955A5271B510500B05242 /* ContactShareViewModel.swift */; };
3402AA65271D9DEC0084CBAE /* ThreadViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34A955A7271B510500B05242 /* ThreadViewModel.swift */; };
@ -3147,7 +3145,6 @@
34A95564271B510400B05242 /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = "<group>"; };
34A95567271B510500B05242 /* OWSWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSWindow.swift; sourceTree = "<group>"; };
34A95569271B510500B05242 /* ActionSheetController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionSheetController.swift; sourceTree = "<group>"; };
34A9556B271B510500B05242 /* OWSNavigationControllerBase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OWSNavigationControllerBase.m; sourceTree = "<group>"; };
34A9556E271B510500B05242 /* LinearHorizontalLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinearHorizontalLayout.swift; sourceTree = "<group>"; };
34A9556F271B510500B05242 /* StickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerView.swift; sourceTree = "<group>"; };
34A95570271B510500B05242 /* StickerPackCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StickerPackCollectionView.swift; sourceTree = "<group>"; };
@ -3160,7 +3157,6 @@
34A9557D271B510500B05242 /* FindByPhoneNumberViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FindByPhoneNumberViewController.swift; sourceTree = "<group>"; };
34A9557E271B510500B05242 /* SpamCaptchaViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpamCaptchaViewController.swift; sourceTree = "<group>"; };
34A9557F271B510500B05242 /* TextApprovalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextApprovalViewController.swift; sourceTree = "<group>"; };
34A95582271B510500B05242 /* OWSNavigationControllerBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OWSNavigationControllerBase.h; sourceTree = "<group>"; };
34A9558A271B510500B05242 /* ContactFieldViewHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactFieldViewHelper.swift; sourceTree = "<group>"; };
34A9558B271B510500B05242 /* OWSTableViewController2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSTableViewController2.swift; sourceTree = "<group>"; };
34A9558D271B510500B05242 /* EditContactShareNameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditContactShareNameViewController.swift; sourceTree = "<group>"; };
@ -6376,8 +6372,6 @@
880C2E01262A19DE006650B6 /* InteractiveSheetViewController.swift */,
34A95591271B510500B05242 /* ModalActivityIndicatorViewController.swift */,
665EF86C290C385B00F490D2 /* OWSNavigationController.swift */,
34A95582271B510500B05242 /* OWSNavigationControllerBase.h */,
34A9556B271B510500B05242 /* OWSNavigationControllerBase.m */,
765283AD2A00D8B4004583A9 /* OWSTableContents.swift */,
765283B12A00D8EC004583A9 /* OWSTableItem.swift */,
765283AF2A00D8CE004583A9 /* OWSTableSection.swift */,
@ -11206,7 +11200,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
3402AA5D271D9DCD0084CBAE /* OWSNavigationControllerBase.h in Headers */,
34A954BA271A471300B05242 /* SignalUI.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -12432,7 +12425,6 @@
3402AA71271D9E180084CBAE /* OWSLayerView.swift in Sources */,
3402AAB1271D9E180084CBAE /* OWSNavigationBar.swift in Sources */,
665EF86D290C385B00F490D2 /* OWSNavigationController.swift in Sources */,
3402AA58271D9DCD0084CBAE /* OWSNavigationControllerBase.m in Sources */,
764FE0432A2F049C004D2804 /* OWSSearchBar.swift in Sources */,
3402AA70271D9E180084CBAE /* OWSStackView.swift in Sources */,
765283AE2A00D8B4004583A9 /* OWSTableContents.swift in Sources */,

View File

@ -5,6 +5,7 @@
import Foundation
import SignalServiceKit
import UIKit
/// Represents the chat color chosen for a particular scope.
///

View File

@ -4,6 +4,7 @@
//
import Foundation
import UIKit
// ColorOrGradientSetting is used for persistence and comparison.
// ColorOrGradientValue is used for rendering.

View File

@ -10,6 +10,3 @@ FOUNDATION_EXPORT double SignalUIVersionNumber;
//! Project version string for SignalUI.
FOUNDATION_EXPORT const unsigned char SignalUIVersionString[];
// The public headers of the framework
#import <SignalUI/OWSNavigationControllerBase.h>

View File

@ -53,7 +53,7 @@ extension OWSNavigationChildController {
/// This navigation controller subclass should be used anywhere we might
/// want to cancel back button presses or back gestures due to, for example,
/// unsaved changes.
open class OWSNavigationController: OWSNavigationControllerBase {
open class OWSNavigationController: UINavigationController {
private var owsNavigationBar: OWSNavigationBar {
return navigationBar as! OWSNavigationBar
@ -245,23 +245,10 @@ extension OWSNavigationController: UINavigationBarDelegate {
// wasBackButtonClicked is true if the back button was pressed but not
// if a back gesture was performed or if the view is popped programmatically.
let wasBackButtonClicked = topViewController?.navigationItem == item
var result = true
if wasBackButtonClicked {
if let child = topViewController?.getFinalNavigationChildController() {
result = !child.shouldCancelNavigationBack
}
if wasBackButtonClicked, let child = topViewController?.getFinalNavigationChildController() {
return !child.shouldCancelNavigationBack
}
// If we're not going to cancel the pop/back, we need to call the super
// implementation since it has important side effects.
if result {
// NOTE: result might end up false if the super implementation cancels the
// the pop/back.
super.ows_navigationBar(navigationBar, shouldPop: item)
result = true
}
return result
return true
}
}

View File

@ -1,20 +0,0 @@
//
// Copyright 2017 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// This subclass exists purely to expose UINavigationController's implementation of
/// UINavigationBarDelegate to the swift subclass OWSNavigationController. Objc
/// can force a call to the superclass' implenentation of navigationBar(: shouldPopItem:) but
/// swift can't do that, so we wrap it in objc.
@interface OWSNavigationControllerBase : UINavigationController
- (BOOL)ows_navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item;
@end
NS_ASSUME_NONNULL_END

View File

@ -1,23 +0,0 @@
//
// Copyright 2017 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
#import "OWSNavigationControllerBase.h"
NS_ASSUME_NONNULL_BEGIN
@interface UINavigationController (OWSNavigationControllerBase) <UINavigationBarDelegate>
@end
@implementation OWSNavigationControllerBase
- (BOOL)ows_navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
{
return [super navigationBar:navigationBar shouldPopItem:item];
}
@end
NS_ASSUME_NONNULL_END

View File

@ -4,6 +4,7 @@
//
import Foundation
import UIKit
public class OWSTableSection {

View File

@ -4,6 +4,7 @@
//
import Foundation
import UIKit
// Any view that exposes a read-only image that can be used for transitions
public protocol PrimaryImageView: UIView {

View File

@ -4,6 +4,7 @@
//
import Foundation
import UIKit
public protocol TextViewWithPlaceholderDelegate: AnyObject {
/// A method invoked by the text field when its cursor/selection changed without any change

View File

@ -4,6 +4,7 @@
//
import Foundation
import UIKit
extension Wallpaper {
var asColorOrGradientSetting: ColorOrGradientSetting? {