mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Prefer back button over dismiss
In some context this makes more sense, and it will never be confusing. // FREEBIE
This commit is contained in:
parent
00b5316976
commit
352f5c1059
3 changed files with 13 additions and 3 deletions
|
@ -104,7 +104,10 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
|
|||
|
||||
// Navigation
|
||||
|
||||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(didPressDismissButton))
|
||||
// Note: using a custom leftBarButtonItem breaks the interactive pop gesture, but we don't want to be able
|
||||
// to swipe to go back in the pager view anyway, instead swiping back should show the next page.
|
||||
let backButton = OWSViewController.createOWSBackButton(withTarget: self, selector: #selector(didPressDismissButton))
|
||||
self.navigationItem.leftBarButtonItem = backButton
|
||||
|
||||
if showAllMediaButton {
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: MediaStrings.allMedia, style: .plain, target: self, action: #selector(didPressAllMediaButton))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
*/
|
||||
- (UIBarButtonItem *)createOWSBackButton;
|
||||
|
||||
+ (UIBarButtonItem *)createOWSBackButtonWithTarget:(id)target selector:(SEL)selector;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||
//
|
||||
|
||||
#import "UIView+OWS.h"
|
||||
|
@ -42,6 +42,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
}
|
||||
|
||||
- (UIBarButtonItem *)createOWSBackButtonWithTarget:(id)target selector:(SEL)selector
|
||||
{
|
||||
return [[self class] createOWSBackButtonWithTarget:target selector:selector];
|
||||
}
|
||||
|
||||
+ (UIBarButtonItem *)createOWSBackButtonWithTarget:(id)target selector:(SEL)selector
|
||||
{
|
||||
OWSAssert(target);
|
||||
OWSAssert(selector);
|
||||
|
|
Loading…
Reference in a new issue