Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Alexander Borsuk
48f04e3242 [ios] Correctly unsubscribe from notifications
Signed-off-by: Alexander Borsuk <me@alex.bio>
2023-02-24 10:59:27 +01:00
Alexander Borsuk
7eb595c85c [ios] Use notification instead of the delegate for the street Editor
It allows to intercept X (clear) button messages too. Delegate approach requires a separate method for it.

Signed-off-by: Alexander Borsuk <me@alex.bio>
2023-02-24 10:59:27 +01:00
Alexander Borsuk
a2ba991e3c [ios] Removed unnecessary input validators
Signed-off-by: Alexander Borsuk <me@alex.bio>
2023-02-24 10:59:26 +01:00
Alexander Borsuk
71710f7ba7 [ios] Removed keyboard layout constraints
Signed-off-by: Alexander Borsuk <me@alex.bio>
2023-02-24 10:59:26 +01:00
Alexander Borsuk
abc1b04481 [ios] Removed MWMKeyboard
Signed-off-by: Alexander Borsuk <me@alex.bio>
2023-02-24 10:59:25 +01:00
39 changed files with 45 additions and 579 deletions

View file

@ -39,7 +39,6 @@ final class BookmarksListViewController: MWMViewController {
self?.presenter.toggleVisibility(in: viewModel)
}
presenter.viewDidLoad()
MWMKeyboard.add(self);
}
override func viewDidAppear(_ animated: Bool) {
@ -47,10 +46,6 @@ final class BookmarksListViewController: MWMViewController {
presenter.viewDidAppear()
}
deinit {
MWMKeyboard.remove(self);
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
updateInfoSize()
@ -243,10 +238,3 @@ extension BookmarksListViewController: BookmarksListInfoViewControllerDelegate {
updateInfoSize()
}
}
extension BookmarksListViewController: MWMKeyboardObserver {
func onKeyboardAnimation() {
let keyboardHeight = MWMKeyboard.keyboardHeight();
tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: keyboardHeight, right: 0)
}
}

View file

@ -27,7 +27,6 @@
#import "MWMController.h"
#import "MWMEditorHelper.h"
#import "MWMFrameworkListener.h"
#import "MWMKeyboard.h"
#import "MWMLocationManager.h"
#import "MWMLocationModeListener.h"
#import "MWMMailViewController.h"

View file

@ -1,9 +1,5 @@
#import "MWMInputValidator.h"
@interface UITextField (RuntimeAttributes)
@property (copy, nonatomic) NSString * localizedPlaceholder;
@property (nonatomic) MWMInputValidator * validator;
@property (nonatomic, readonly) BOOL isValid;
@end

View file

@ -1,6 +1,4 @@
#import "MWMInputValidatorFactory.h"
#import "UITextField+RuntimeAttributes.h"
#import <objc/runtime.h>
@implementation UITextField (RuntimeAttributes)
@ -15,30 +13,4 @@
return L(placeholder);
}
- (void)setValidator:(MWMInputValidator *)validator
{
objc_setAssociatedObject(self, @selector(validator), validator, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (MWMInputValidator *)validator
{
return objc_getAssociatedObject(self, @selector(validator));
}
- (void)setValidatorName:(NSString *)validatorName
{
objc_setAssociatedObject(self, @selector(validatorName), validatorName, OBJC_ASSOCIATION_COPY_NONATOMIC);
self.validator = [MWMInputValidatorFactory validator:validatorName];
}
- (MWMInputValidator *)validatorName
{
return objc_getAssociatedObject(self, @selector(validatorName));
}
- (BOOL)isValid
{
return [self.validator validateInput:self];
}
@end

View file

@ -1,15 +0,0 @@
extension UIWindow {
private func findFirstResponder(view: UIView) -> UIResponder? {
guard !view.isFirstResponder else { return view }
for subView in view.subviews {
if let responder = findFirstResponder(view: subView) {
return responder
}
}
return nil
}
@objc func firstResponder() -> UIResponder? {
return findFirstResponder(view: self)
}
}

View file

@ -39,12 +39,10 @@ final class BCCreateCategoryAlert: MWMAlert {
alert.callback = callback
alert.process(state: .tooFewSymbols)
alert.formatCharactersCountText()
MWMKeyboard.add(alert)
return alert
}
@IBAction private func leftButtonTap() {
MWMKeyboard.remove(self)
close(nil)
}
@ -55,7 +53,6 @@ final class BCCreateCategoryAlert: MWMAlert {
}
if callback(text) {
MWMKeyboard.remove(self)
close(nil)
} else {
process(state: .nameAlreadyExists)
@ -138,14 +135,3 @@ extension BCCreateCategoryAlert: UITextFieldDelegate {
return true
}
}
extension BCCreateCategoryAlert: MWMKeyboardObserver {
func onKeyboardAnimation() {
centerHorizontaly.constant = -MWMKeyboard.keyboardHeight() / 2
layoutIfNeeded()
}
func onKeyboardWillAnimate() {
setNeedsLayout()
}
}

View file

@ -1,7 +1,6 @@
#import "MWMPlaceDoesntExistAlert.h"
#import "MWMKeyboard.h"
@interface MWMPlaceDoesntExistAlert ()<MWMKeyboardObserver>
@interface MWMPlaceDoesntExistAlert()
@property(weak, nonatomic) IBOutlet UITextField * textField;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * centerHorizontaly;
@ -16,7 +15,6 @@
MWMPlaceDoesntExistAlert * alert =
[NSBundle.mainBundle loadNibNamed:[self className] owner:nil options:nil].firstObject;
alert.block = block;
[MWMKeyboard addObserver:alert];
return alert;
}
@ -34,13 +32,4 @@
[self close:nil];
}
#pragma mark - MWMKeyboard
- (void)onKeyboardAnimation
{
self.centerHorizontaly.constant = -[MWMKeyboard keyboardHeight] / 2;
[self layoutIfNeeded];
}
- (void)onKeyboardWillAnimate { [self setNeedsLayout]; }
@end

View file

@ -10,13 +10,6 @@
#include "platform/platform.hpp"
#include "private.h"
typedef NS_OPTIONS(NSUInteger, MWMFieldCorrect) {
MWMFieldCorrectNO = 0,
MWMFieldCorrectLogin = 1 << 0,
MWMFieldCorrectPassword = 1 << 1,
MWMFieldCorrectAll = MWMFieldCorrectLogin | MWMFieldCorrectPassword
};
using namespace osm;
@interface MWMAuthorizationOSMLoginViewController ()<UITextFieldDelegate>
@ -27,8 +20,6 @@ using namespace osm;
@property(weak, nonatomic) IBOutlet UIButton * forgotButton;
@property(weak, nonatomic) IBOutlet UIView * spinnerView;
@property(nonatomic) MWMFieldCorrect isCorrect;
@property(nonatomic) MWMCircularProgress * spinner;
@end
@ -39,7 +30,6 @@ using namespace osm;
{
[super viewDidLoad];
self.title = L(@"osm_account").capitalizedString;
self.isCorrect = MWMFieldCorrectNO;
[self checkConnection];
[self stopSpinner];
}
@ -53,34 +43,9 @@ using namespace osm;
- (BOOL)shouldAutorotate { return NO; }
- (void)checkConnection { self.forgotButton.enabled = Platform::IsConnected(); }
#pragma mark - UITextFieldDelegate
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)string
{
NSString * newString =
[textField.text stringByReplacingCharactersInRange:range withString:string];
BOOL const isValid = [textField.validator validateString:newString];
if ([textField isEqual:self.loginTextField])
{
if (isValid)
self.isCorrect |= MWMFieldCorrectLogin;
else
self.isCorrect &= ~MWMFieldCorrectLogin;
}
else if ([textField isEqual:self.passwordTextField])
{
if (isValid)
self.isCorrect |= MWMFieldCorrectPassword;
else
self.isCorrect &= ~MWMFieldCorrectPassword;
}
return YES;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if ([textField isEqual:self.loginTextField])
@ -179,12 +144,4 @@ using namespace osm;
[self openUrl:@(OsmOAuth::ServerAuth().GetResetPasswordURL().c_str())];
}
#pragma mark - Properties
- (void)setIsCorrect:(MWMFieldCorrect)isCorrect
{
_isCorrect = isCorrect;
self.loginButton.enabled = isCorrect == MWMFieldCorrectAll;
}
@end

View file

@ -1,5 +0,0 @@
#import "MWMInputValidator.h"
@interface MWMInputEmailValidator : MWMInputValidator
@end

View file

@ -1,32 +0,0 @@
#import "MWMInputEmailValidator.h"
static NSString * const kEmailRegexPattern = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}";
@implementation MWMInputEmailValidator
- (BOOL)validateString:(NSString *)string
{
if (![super validateString:string])
return NO;
NSError * err;
NSRegularExpression * regex =
[NSRegularExpression regularExpressionWithPattern:kEmailRegexPattern
options:NSRegularExpressionCaseInsensitive
error:&err];
NSAssert(!err, @"Invalid regular expression");
NSMutableArray<NSString *> * matches = [@[] mutableCopy];
NSRange range = NSMakeRange(0, string.length);
[regex enumerateMatchesInString:string
options:NSMatchingReportProgress
range:range
usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags,
BOOL * _Nonnull stop)
{
[matches addObject:[string substringWithRange:result.range]];
}];
if (matches.count != 1)
return NO;
return [matches[0] isEqualToString:string];
}
@end

View file

@ -1,5 +0,0 @@
#import "MWMInputValidator.h"
@interface MWMInputLoginValidator : MWMInputValidator
@end

View file

@ -1,14 +0,0 @@
#import "MWMInputLoginValidator.h"
static NSUInteger const minLoginLength = 3;
@implementation MWMInputLoginValidator
- (BOOL)validateString:(NSString *)string
{
if (![super validateString:string])
return NO;
return string.length >= minLoginLength;
}
@end

View file

@ -1,5 +0,0 @@
#import "MWMInputValidator.h"
@interface MWMInputPasswordValidator : MWMInputValidator
@end

View file

@ -1,14 +0,0 @@
#import "MWMInputPasswordValidator.h"
static NSUInteger const minPasswordLength = 8;
@implementation MWMInputPasswordValidator
- (BOOL)validateString:(NSString *)string
{
if (![super validateString:string])
return NO;
return string.length >= minPasswordLength;
}
@end

View file

@ -1,6 +0,0 @@
@interface MWMInputValidator : NSObject
- (BOOL)validateInput:(UITextField *)input;
- (BOOL)validateString:(NSString *)string;
@end

View file

@ -1,15 +0,0 @@
#import "MWMInputValidator.h"
@implementation MWMInputValidator
- (BOOL)validateInput:(UITextField *)input
{
return [self validateString:input.text];
}
- (BOOL)validateString:(NSString *)string
{
return YES;
}
@end

View file

@ -1,7 +0,0 @@
#import "MWMInputValidator.h"
@interface MWMInputValidatorFactory : NSObject
+ (MWMInputValidator *)validator:(NSString *)validator;
@end

View file

@ -1,23 +0,0 @@
#import "MWMInputEmailValidator.h"
#import "MWMInputLoginValidator.h"
#import "MWMInputPasswordValidator.h"
#import "MWMInputValidator.h"
#import "MWMInputValidatorFactory.h"
@implementation MWMInputValidatorFactory
+ (MWMInputValidator *)validator:(NSString *)validator
{
if ([validator isEqualToString:[MWMInputLoginValidator className]])
return [[MWMInputLoginValidator alloc] init];
if ([validator isEqualToString:[MWMInputPasswordValidator className]])
return [[MWMInputPasswordValidator alloc] init];
if ([validator isEqualToString:[MWMInputEmailValidator className]])
return [[MWMInputEmailValidator alloc] init];
if ([validator isEqualToString:[MWMInputValidator className]])
return [[MWMInputValidator alloc] init];
NSAssert(false, @"Invalid validator requested.");
return [[MWMInputValidator alloc] init];
}
@end

View file

@ -21,7 +21,7 @@
}
- (void)dealloc {
[NSNotificationCenter.defaultCenter removeObserver:self name:UITextViewTextDidChangeNotification object:nil];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (UILabel *)placeholderView {

View file

@ -67,7 +67,6 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
@end
@interface MapViewController () <MWMFrameworkDrapeObserver,
MWMKeyboardObserver,
MWMBookmarksObserver>
@property(nonatomic, readwrite) MWMMapViewControlsManager *controlsManager;
@ -81,10 +80,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
@property(nonatomic) BOOL skipForceTouch;
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *visibleAreaBottom;
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *visibleAreaKeyboard;
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *placePageAreaKeyboard;
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *sideButtonsAreaBottom;
@property(strong, nonatomic) IBOutlet NSLayoutConstraint *sideButtonsAreaKeyboard;
@property(strong, nonatomic) IBOutlet UIImageView *carplayPlaceholderLogo;
@property(strong, nonatomic) BookmarksCoordinator * bookmarksCoordinator;
@ -320,7 +316,6 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
[MWMRouter restoreRouteIfNeeded];
self.view.clipsToBounds = YES;
[MWMKeyboard addObserver:self];
if ([FirstSession isFirstSession])
{
@ -608,19 +603,6 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
}
}
#pragma mark - MWMKeyboard
- (void)onKeyboardWillAnimate {
[self.view setNeedsLayout];
}
- (void)onKeyboardAnimation {
auto const kbHeight = [MWMKeyboard keyboardHeight];
self.sideButtonsAreaKeyboard.constant = kbHeight;
if (IPAD) {
self.visibleAreaKeyboard.constant = kbHeight;
self.placePageAreaKeyboard.constant = kbHeight;
}
}
#pragma mark - Properties
- (MWMMapViewControlsManager *)controlsManager {

View file

@ -224,7 +224,6 @@ using namespace osm_auth_ios;
}
[MWMLocationManager applicationDidBecomeActive];
[MWMSearch addCategoriesToSpotlight];
[MWMKeyboard applicationDidBecomeActive];
[MWMTextToSpeech applicationDidBecomeActive];
LOG(LINFO, ("applicationDidBecomeActive - end"));
}

View file

@ -1,18 +0,0 @@
#import "MWMKeyboardObserver.h"
@interface MWMKeyboard : NSObject
+ (void)applicationDidBecomeActive;
+ (void)addObserver:(id<MWMKeyboardObserver>)observer;
+ (void)removeObserver:(id<MWMKeyboardObserver>)observer;
+ (CGFloat)keyboardHeight;
- (instancetype)init __attribute__((unavailable("call +manager instead")));
- (instancetype)copy __attribute__((unavailable("call +manager instead")));
- (instancetype)copyWithZone:(NSZone *)zone __attribute__((unavailable("call +manager instead")));
+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable("call +manager instead")));
+ (instancetype)new __attribute__((unavailable("call +manager instead")));
@end

View file

@ -1,98 +0,0 @@
#import "MWMKeyboard.h"
@interface MWMKeyboard ()
@property(nonatomic) NSHashTable *observers;
@property(nonatomic) CGFloat keyboardHeight;
@end
@implementation MWMKeyboard
+ (void)applicationDidBecomeActive {
[self manager];
}
+ (MWMKeyboard *)manager {
static MWMKeyboard *manager;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
manager = [[self alloc] initManager];
});
return manager;
}
- (instancetype)initManager {
self = [super init];
if (self) {
_observers = [NSHashTable weakObjectsHashTable];
NSNotificationCenter *nc = NSNotificationCenter.defaultCenter;
[nc addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[nc addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
}
return self;
}
- (void)dealloc {
[NSNotificationCenter.defaultCenter removeObserver:self];
}
+ (CGFloat)keyboardHeight {
return [self manager].keyboardHeight;
}
#pragma mark - Add/Remove Observers
+ (void)addObserver:(id<MWMKeyboardObserver>)observer {
[[self manager].observers addObject:observer];
}
+ (void)removeObserver:(id<MWMKeyboardObserver>)observer {
[[self manager].observers removeObject:observer];
}
#pragma mark - Notifications
- (void)onKeyboardWillAnimate {
for (id<MWMKeyboardObserver> observer in self.observers) {
if ([observer respondsToSelector:@selector(onKeyboardWillAnimate)])
[observer onKeyboardWillAnimate];
}
}
- (void)onKeyboardAnimation {
for (id<MWMKeyboardObserver> observer in self.observers) {
[observer onKeyboardAnimation];
}
}
- (void)keyboardWillShow:(NSNotification *)notification {
[self onKeyboardWillAnimate];
CGSize keyboardSize = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
self.keyboardHeight = MIN(keyboardSize.height, keyboardSize.width);
NSNumber *duration = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey];
NSNumber *curve = notification.userInfo[UIKeyboardAnimationCurveUserInfoKey];
[UIView animateWithDuration:duration.doubleValue
delay:0
options:curve.integerValue
animations:^{
[self onKeyboardAnimation];
}
completion:nil];
}
- (void)keyboardWillHide:(NSNotification *)notification {
[self onKeyboardWillAnimate];
self.keyboardHeight = 0;
NSNumber *duration = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey];
NSNumber *curve = notification.userInfo[UIKeyboardAnimationCurveUserInfoKey];
[UIView animateWithDuration:duration.doubleValue
delay:0
options:curve.integerValue
animations:^{
[self onKeyboardAnimation];
}
completion:nil];
}
@end

View file

@ -1,8 +0,0 @@
@protocol MWMKeyboardObserver<NSObject>
- (void)onKeyboardAnimation;
@optional
- (void)onKeyboardWillAnimate;
@end

View file

@ -465,12 +465,7 @@ void setShowLocationAlert(BOOL needShow) {
} else {
_started = NO;
[self stop];
[notificationCenter removeObserver:self
name:UIDeviceOrientationDidChangeNotification
object:nil];
[notificationCenter removeObserver:self
name:UIDeviceBatteryStateDidChangeNotification
object:nil];
[notificationCenter removeObserver:self];
}
}

View file

@ -17,7 +17,6 @@
337F98B821D3D67E00C8AC27 /* SearchHistoryQueryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 337F98B721D3D67E00C8AC27 /* SearchHistoryQueryCell.swift */; };
340416481E7BF28E00E2B6D6 /* UIView+Snapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340416461E7BF28E00E2B6D6 /* UIView+Snapshot.swift */; };
3404164C1E7BF42E00E2B6D6 /* UIView+Coordinates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3404164A1E7BF42D00E2B6D6 /* UIView+Coordinates.swift */; };
3404754D1E081A4600C92850 /* MWMKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 340475191E081A4600C92850 /* MWMKeyboard.m */; };
340475591E081A4600C92850 /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 340475271E081A4600C92850 /* WebViewController.m */; };
3404755C1E081A4600C92850 /* MWMLocationManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3404752C1E081A4600C92850 /* MWMLocationManager.mm */; };
3404755F1E081A4600C92850 /* MWMLocationPredictor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3404752F1E081A4600C92850 /* MWMLocationPredictor.mm */; };
@ -80,7 +79,6 @@
3472B5E1200F86C800DC6CD5 /* MWMEditorHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3472B5DF200F86C800DC6CD5 /* MWMEditorHelper.mm */; };
34763EE71F2F392300F4D2D3 /* MWMTextToSpeech.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34763EE51F2F392300F4D2D3 /* MWMTextToSpeech.mm */; };
34763F071F3092E700F4D2D3 /* String+Format.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34763F051F3092E700F4D2D3 /* String+Format.swift */; };
347E039A1FAC5F1D00426032 /* UIWindow+InputLanguage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347E03981FAC5F1D00426032 /* UIWindow+InputLanguage.swift */; };
34845DAF1E1649F6003D55B9 /* DownloaderNoResultsEmbedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34845DAD1E1649F6003D55B9 /* DownloaderNoResultsEmbedViewController.swift */; };
34845DB31E165E24003D55B9 /* SearchNoResultsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34845DB11E165E24003D55B9 /* SearchNoResultsViewController.swift */; };
34845DB71E166084003D55B9 /* Common.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34845DB51E166084003D55B9 /* Common.swift */; };
@ -138,10 +136,6 @@
34AB66891FC5AA330078E451 /* NavigationControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB66021FC5AA320078E451 /* NavigationControlView.swift */; };
34AB668C1FC5AA330078E451 /* NavigationStreetNameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AB66031FC5AA320078E451 /* NavigationStreetNameView.swift */; };
34ABA6171C2D185C00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA6151C2D185B00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm */; };
34ABA6211C2D517500FE1BEC /* MWMInputValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA61F1C2D517500FE1BEC /* MWMInputValidator.m */; };
34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA6231C2D551900FE1BEC /* MWMInputValidatorFactory.m */; };
34ABA6291C2D567B00FE1BEC /* MWMInputLoginValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA6271C2D567B00FE1BEC /* MWMInputLoginValidator.m */; };
34ABA62D1C2D57D500FE1BEC /* MWMInputPasswordValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA62B1C2D57D500FE1BEC /* MWMInputPasswordValidator.m */; };
34AC8FD11EFC02C000E7F910 /* MWMRoutePoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34AC8FC71EFC01F500E7F910 /* MWMRoutePoint.mm */; };
34AC8FDB1EFC07FE00E7F910 /* UILabel+NumberOfVisibleLines.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34AC8FD91EFC062400E7F910 /* UILabel+NumberOfVisibleLines.swift */; };
34B127EA1FBDD410008713D9 /* MWMRouterTransitStepInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B127E81FBDD410008713D9 /* MWMRouterTransitStepInfo.mm */; };
@ -265,7 +259,6 @@
47F86CFF20C936FC00FEE291 /* TabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47F86CFE20C936FC00FEE291 /* TabView.swift */; };
47F86D0120C93D8D00FEE291 /* TabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47F86D0020C93D8D00FEE291 /* TabViewController.swift */; };
4A300ED51C6DCFD400140018 /* countries-strings in Resources */ = {isa = PBXBuildFile; fileRef = 4A300ED31C6DCFD400140018 /* countries-strings */; };
56C74C391C74A3BC00B71B9F /* MWMInputEmailValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ABA62F1C2D58F300FE1BEC /* MWMInputEmailValidator.m */; };
6741A9421BF340DE002C974C /* sound-strings in Resources */ = {isa = PBXBuildFile; fileRef = 5605022E1B6211E100169CAD /* sound-strings */; };
6741A9451BF340DE002C974C /* classificator.txt in Resources */ = {isa = PBXBuildFile; fileRef = EE026F0511D6AC0D00645242 /* classificator.txt */; };
6741A9491BF340DE002C974C /* countries.txt in Resources */ = {isa = PBXBuildFile; fileRef = FA46DA2B12D4166E00968C36 /* countries.txt */; };
@ -703,9 +696,6 @@
337F98B721D3D67E00C8AC27 /* SearchHistoryQueryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHistoryQueryCell.swift; sourceTree = "<group>"; };
340416461E7BF28E00E2B6D6 /* UIView+Snapshot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Snapshot.swift"; sourceTree = "<group>"; };
3404164A1E7BF42D00E2B6D6 /* UIView+Coordinates.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Coordinates.swift"; sourceTree = "<group>"; };
340475181E081A4600C92850 /* MWMKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMKeyboard.h; sourceTree = "<group>"; };
340475191E081A4600C92850 /* MWMKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMKeyboard.m; sourceTree = "<group>"; };
3404751A1E081A4600C92850 /* MWMKeyboardObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMKeyboardObserver.h; sourceTree = "<group>"; };
3404751C1E081A4600C92850 /* MWMMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMacros.h; sourceTree = "<group>"; };
340475261E081A4600C92850 /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewController.h; sourceTree = "<group>"; };
340475271E081A4600C92850 /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewController.m; sourceTree = "<group>"; };
@ -820,7 +810,6 @@
34763F051F3092E700F4D2D3 /* String+Format.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Format.swift"; sourceTree = "<group>"; };
34763F0B1F30CCAC00F4D2D3 /* MWMEditorCellType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMEditorCellType.h; sourceTree = "<group>"; };
347AD8081F28B4E6007ACB68 /* MWMSearchManagerObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMSearchManagerObserver.h; sourceTree = "<group>"; };
347E03981FAC5F1D00426032 /* UIWindow+InputLanguage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIWindow+InputLanguage.swift"; sourceTree = "<group>"; };
34845DAD1E1649F6003D55B9 /* DownloaderNoResultsEmbedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloaderNoResultsEmbedViewController.swift; sourceTree = "<group>"; };
34845DB11E165E24003D55B9 /* SearchNoResultsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchNoResultsViewController.swift; sourceTree = "<group>"; };
34845DB51E166084003D55B9 /* Common.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Common.swift; sourceTree = "<group>"; };
@ -899,16 +888,6 @@
34AB66031FC5AA320078E451 /* NavigationStreetNameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationStreetNameView.swift; sourceTree = "<group>"; };
34ABA6141C2D185B00FE1BEC /* MWMAuthorizationOSMLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAuthorizationOSMLoginViewController.h; sourceTree = "<group>"; };
34ABA6151C2D185B00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAuthorizationOSMLoginViewController.mm; sourceTree = "<group>"; };
34ABA61E1C2D517500FE1BEC /* MWMInputValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputValidator.h; sourceTree = "<group>"; };
34ABA61F1C2D517500FE1BEC /* MWMInputValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMInputValidator.m; sourceTree = "<group>"; };
34ABA6221C2D551900FE1BEC /* MWMInputValidatorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputValidatorFactory.h; sourceTree = "<group>"; };
34ABA6231C2D551900FE1BEC /* MWMInputValidatorFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMInputValidatorFactory.m; sourceTree = "<group>"; };
34ABA6261C2D567B00FE1BEC /* MWMInputLoginValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputLoginValidator.h; sourceTree = "<group>"; };
34ABA6271C2D567B00FE1BEC /* MWMInputLoginValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMInputLoginValidator.m; sourceTree = "<group>"; };
34ABA62A1C2D57D500FE1BEC /* MWMInputPasswordValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputPasswordValidator.h; sourceTree = "<group>"; };
34ABA62B1C2D57D500FE1BEC /* MWMInputPasswordValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMInputPasswordValidator.m; sourceTree = "<group>"; };
34ABA62E1C2D58F300FE1BEC /* MWMInputEmailValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMInputEmailValidator.h; sourceTree = "<group>"; };
34ABA62F1C2D58F300FE1BEC /* MWMInputEmailValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMInputEmailValidator.m; sourceTree = "<group>"; };
34AC8FC71EFC01F500E7F910 /* MWMRoutePoint.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMRoutePoint.mm; sourceTree = "<group>"; };
34AC8FC81EFC01F500E7F910 /* MWMRoutePoint+CPP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWMRoutePoint+CPP.h"; sourceTree = "<group>"; };
34AC8FD91EFC062400E7F910 /* UILabel+NumberOfVisibleLines.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UILabel+NumberOfVisibleLines.swift"; sourceTree = "<group>"; };
@ -1703,7 +1682,6 @@
458287C21AD3BE2000BA8940 /* DownloadIndicatorProtocol.h */,
46F26CD610F623BA00ECCA39 /* EAGLView.h */,
46F26CD710F623BA00ECCA39 /* EAGLView.mm */,
34ABA61D1C2D514A00FE1BEC /* Input Validators */,
340475791E081B3300C92850 /* iosOGLContext.h */,
3404757A1E081B3300C92850 /* iosOGLContext.mm */,
3404757B1E081B3300C92850 /* iosOGLContextFactory.h */,
@ -1841,7 +1819,6 @@
isa = PBXGroup;
children = (
34845DB51E166084003D55B9 /* Common.swift */,
340475171E081A4600C92850 /* Keyboard */,
3404751C1E081A4600C92850 /* MWMMacros.h */,
340475261E081A4600C92850 /* WebViewController.h */,
340475271E081A4600C92850 /* WebViewController.m */,
@ -1850,16 +1827,6 @@
path = Common;
sourceTree = "<group>";
};
340475171E081A4600C92850 /* Keyboard */ = {
isa = PBXGroup;
children = (
340475181E081A4600C92850 /* MWMKeyboard.h */,
340475191E081A4600C92850 /* MWMKeyboard.m */,
3404751A1E081A4600C92850 /* MWMKeyboardObserver.h */,
);
path = Keyboard;
sourceTree = "<group>";
};
340475281E081A4600C92850 /* Core */ = {
isa = PBXGroup;
children = (
@ -2087,7 +2054,6 @@
34F7422F1E0834F400AC1FD6 /* UIViewController+Navigation.h */,
34F742301E0834F400AC1FD6 /* UIViewController+Navigation.m */,
99012846243F0D6900C72B10 /* UIViewController+alternative.swift */,
347E03981FAC5F1D00426032 /* UIWindow+InputLanguage.swift */,
4767CDA320AAF66B00BD8166 /* NSAttributedString+HTML.swift */,
47699A0621F08E37009E6585 /* NSDate+TimeDistance.h */,
47699A0721F08E37009E6585 /* NSDate+TimeDistance.m */,
@ -2379,24 +2345,6 @@
path = CustomViews/Login;
sourceTree = "<group>";
};
34ABA61D1C2D514A00FE1BEC /* Input Validators */ = {
isa = PBXGroup;
children = (
34ABA6221C2D551900FE1BEC /* MWMInputValidatorFactory.h */,
34ABA6231C2D551900FE1BEC /* MWMInputValidatorFactory.m */,
34ABA61E1C2D517500FE1BEC /* MWMInputValidator.h */,
34ABA61F1C2D517500FE1BEC /* MWMInputValidator.m */,
34ABA6261C2D567B00FE1BEC /* MWMInputLoginValidator.h */,
34ABA6271C2D567B00FE1BEC /* MWMInputLoginValidator.m */,
34ABA62A1C2D57D500FE1BEC /* MWMInputPasswordValidator.h */,
34ABA62B1C2D57D500FE1BEC /* MWMInputPasswordValidator.m */,
34ABA62E1C2D58F300FE1BEC /* MWMInputEmailValidator.h */,
34ABA62F1C2D58F300FE1BEC /* MWMInputEmailValidator.m */,
);
name = "Input Validators";
path = InputValidators;
sourceTree = "<group>";
};
34BC72091B0DECAE0012A34B /* MapViewControls */ = {
isa = PBXGroup;
children = (
@ -3964,7 +3912,6 @@
993DF10B23F6BDB100AC231A /* CheckmarkRenderer.swift in Sources */,
F6E2FED01E097BA00083EBEC /* MWMSearchFilterViewController.mm in Sources */,
34D3B01B1E389D05004100F9 /* MWMButtonCell.m in Sources */,
34ABA6291C2D567B00FE1BEC /* MWMInputLoginValidator.m in Sources */,
337F98B421D3C9F200C8AC27 /* SearchHistoryViewController.swift in Sources */,
3404F49D2028A2430090E401 /* BMCActionsCreateCell.swift in Sources */,
F6E2FD8F1E097BA00083EBEC /* MWMNoMapsViewController.mm in Sources */,
@ -4034,7 +3981,6 @@
CDB4D5012231412900104869 /* ListTemplateBuilder.swift in Sources */,
99A906F323FA95AB0005872B /* PlacePageStyleSheet.swift in Sources */,
6741A9CF1BF340DE002C974C /* MWMLocationAlert.m in Sources */,
34ABA62D1C2D57D500FE1BEC /* MWMInputPasswordValidator.m in Sources */,
F6E2FDA11E097BA00083EBEC /* MWMEditorAdditionalNamesTableViewController.mm in Sources */,
4767CDA620AB1F6200BD8166 /* LeftAlignedIconButton.swift in Sources */,
3454D7D41E07F045004AF2AD /* UIImageView+Coloring.m in Sources */,
@ -4138,7 +4084,6 @@
34D3AFEA1E378AF1004100F9 /* UINib+Init.swift in Sources */,
F63AF5131EA6250F00A1DB98 /* FilterCollectionHolderCell.swift in Sources */,
34AB663E1FC5AA330078E451 /* RouteManagerTransitioning.swift in Sources */,
56C74C391C74A3BC00B71B9F /* MWMInputEmailValidator.m in Sources */,
993DF0CB23F6BD0600AC231A /* ElevationDetailsRouter.swift in Sources */,
47CA68FC250F99E500671019 /* BookmarksListCellStrategy.swift in Sources */,
B33D21B820E130D000BAD749 /* BookmarksTabViewController.swift in Sources */,
@ -4225,7 +4170,6 @@
34AB66321FC5AA330078E451 /* RouteManagerHeaderView.swift in Sources */,
347040301EA6470700038379 /* BorderedButton.swift in Sources */,
F6E2FF4B1E097BA00083EBEC /* SettingsTableViewSwitchCell.swift in Sources */,
34ABA6211C2D517500FE1BEC /* MWMInputValidator.m in Sources */,
993DF12623F6BDB100AC231A /* SwizzleStyle.m in Sources */,
993DF10E23F6BDB100AC231A /* UIButtonRenderer.swift in Sources */,
99514BBB23E82B450085D3A7 /* ElevationProfileBuilder.swift in Sources */,
@ -4242,7 +4186,6 @@
4767CDA820AB401000BD8166 /* LinkTextView.swift in Sources */,
34763EE71F2F392300F4D2D3 /* MWMTextToSpeech.mm in Sources */,
998927402449ECC200260CE2 /* BottomMenuItemCell.swift in Sources */,
34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.m in Sources */,
F6E2FEE21E097BA00083EBEC /* MWMSearchManager.mm in Sources */,
F6E2FE221E097BA00083EBEC /* MWMOpeningHoursEditorViewController.mm in Sources */,
999FC12B23ABB4B800B0E6F9 /* FontStyleSheet.swift in Sources */,
@ -4269,7 +4212,6 @@
993DF10523F6BDB100AC231A /* UINavigationItem+styleName.swift in Sources */,
9977E69C247BFB510073780C /* SearchTextField.swift in Sources */,
4726254921C27D4B00C7BAAD /* PlacePageDescriptionViewController.swift in Sources */,
347E039A1FAC5F1D00426032 /* UIWindow+InputLanguage.swift in Sources */,
340475711E081A4600C92850 /* MWMSettings.mm in Sources */,
33046832219C57180041F3A8 /* CategorySettingsViewController.swift in Sources */,
3404756E1E081A4600C92850 /* MWMSearch.mm in Sources */,
@ -4290,7 +4232,6 @@
993DF0C923F6BD0600AC231A /* ElevationDetailsBuilder.swift in Sources */,
674A7E301C0DB10B003D48E1 /* MWMMapWidgets.mm in Sources */,
34AB66291FC5AA330078E451 /* RouteManagerViewController.swift in Sources */,
3404754D1E081A4600C92850 /* MWMKeyboard.m in Sources */,
993DF10C23F6BDB100AC231A /* MWMTableViewCellRenderer.swift in Sources */,
3457C4261F680F1900028233 /* String+BoundingRect.swift in Sources */,
34EF94291C05A6F30050B714 /* MWMSegue.m in Sources */,

View file

@ -1,7 +1,6 @@
#import "MWMNoMapsView.h"
#import "MWMKeyboard.h"
@interface MWMNoMapsView ()<MWMKeyboardObserver>
@interface MWMNoMapsView ()
@property(weak, nonatomic) IBOutlet UIImageView * image;
@property(weak, nonatomic) IBOutlet UILabel * title;
@ -33,7 +32,6 @@
{
self.containerTopOffset.active = NO;
}
[MWMKeyboard addObserver:self];
}
- (void)layoutSubviews
@ -68,14 +66,4 @@
self.containerHeight.constant = height;
}
}
#pragma mark - MWMKeyboard
- (void)onKeyboardAnimation
{
self.containerBottomOffset.constant = [MWMKeyboard keyboardHeight];
[self.superview layoutIfNeeded];
}
- (void)onKeyboardWillAnimate { [self.superview layoutIfNeeded]; }
@end

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -38,7 +38,6 @@
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular17:blackPrimaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="localizedPlaceholder" value="editor_edit_place_name_hint"/>
<userDefinedRuntimeAttribute type="string" keyPath="validatorName" value="MWMInputValidator"/>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="hfo-cP-AGX" id="jkD-0x-Ods"/>

View file

@ -1,5 +1,4 @@
#import "MWMCuisineEditorViewController.h"
#import "MWMKeyboard.h"
#import "MWMTableViewCell.h"
#import "SwiftBridge.h"
@ -19,7 +18,7 @@ std::vector<std::string> SliceKeys(std::vector<std::pair<std::string, std::strin
}
} // namespace
@interface MWMCuisineEditorViewController ()<UISearchBarDelegate, MWMKeyboardObserver>
@interface MWMCuisineEditorViewController ()<UISearchBarDelegate>
{
osm::AllCuisines m_allCuisines;
std::vector<std::string> m_selectedCuisines;
@ -42,7 +41,6 @@ std::vector<std::string> SliceKeys(std::vector<std::pair<std::string, std::strin
[self configSearchBar];
[self configData];
[self configTable];
[MWMKeyboard addObserver:self];
}
- (UIStatusBarStyle)preferredStatusBarStyle
@ -50,15 +48,6 @@ std::vector<std::string> SliceKeys(std::vector<std::pair<std::string, std::strin
return UIStatusBarStyleLightContent;
}
#pragma mark - MWMKeyboard
- (void)onKeyboardAnimation
{
UIEdgeInsets const contentInsets = {.bottom = [MWMKeyboard keyboardHeight]};
self.tableView.contentInset = contentInsets;
self.tableView.scrollIndicatorInsets = contentInsets;
}
#pragma mark - UISearchBarDelegate
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText

View file

@ -2,7 +2,6 @@
#import "MWMAuthorizationCommon.h"
#import "MWMObjectsCategorySelectorDataSource.h"
#import "MWMEditorViewController.h"
#import "MWMKeyboard.h"
#import "MWMTableViewCell.h"
#import "SwiftBridge.h"
@ -16,7 +15,7 @@ NSString * const kToEditorSegue = @"CategorySelectorToEditorSegue";
} // namespace
@interface MWMObjectsCategorySelectorController ()<UISearchBarDelegate, UITableViewDelegate,
UITableViewDataSource, MWMKeyboardObserver>
UITableViewDataSource>
{
}
@ -43,7 +42,6 @@ NSString * const kToEditorSegue = @"CategorySelectorToEditorSegue";
[self configTable];
[self configNavBar];
[self configSearchBar];
[MWMKeyboard addObserver:self];
self.dataSource = [[MWMObjectsCategorySelectorDataSource alloc] init];
}
@ -90,15 +88,6 @@ NSString * const kToEditorSegue = @"CategorySelectorToEditorSegue";
[dest setEditableMapObject:object];
}
#pragma mark - MWMKeyboard
- (void)onKeyboardAnimation
{
UIEdgeInsets const contentInsets = {.bottom = [MWMKeyboard keyboardHeight]};
self.tableView.contentInset = contentInsets;
self.tableView.scrollIndicatorInsets = contentInsets;
}
#pragma mark - Create object
- (EditableMapObject)createdObject

View file

@ -1,10 +1,8 @@
#import "MWMStreetEditorEditTableViewCell.h"
#import "UITextField+RuntimeAttributes.h"
@interface MWMStreetEditorEditTableViewCell () <UITextFieldDelegate>
@interface MWMStreetEditorEditTableViewCell ()
@property (weak, nonatomic) IBOutlet UITextField * textField;
@property (weak, nonatomic) id<MWMStreetEditorEditCellProtocol> delegate;
@end
@ -15,17 +13,21 @@
{
self.delegate = delegate;
self.textField.text = street;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textDidChange:)
name:UITextFieldTextDidChangeNotification
object:self.textField];
}
#pragma mark - UITextFieldDelegate
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
- (void)dealloc
{
NSString * newString = [textField.text stringByReplacingCharactersInRange:range withString:string];
BOOL const isCorrect = [textField.validator validateString:newString];
if (isCorrect)
[self.delegate editCellTextChanged:newString];
return YES;
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)textDidChange:(NSNotification*)notification
{
UITextField * textField = (UITextField *)[notification object];
[self.delegate editCellTextChanged:textField.text];
}
@end

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -25,7 +25,6 @@
<textInputTraits key="textInputTraits"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular17:blackPrimaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="validatorName" value="MWMInputValidator"/>
<userDefinedRuntimeAttribute type="string" keyPath="localizedPlaceholder" value="add_street"/>
</userDefinedRuntimeAttributes>
<connections>

View file

@ -3,5 +3,6 @@
@interface MWMSearchManager (Layout)
- (void)layoutTopViews;
- (void)removeKeyboardObservers;
@end

View file

@ -85,6 +85,10 @@ static CGFloat const changeModeViewOffsetKeyboard = -12;
object:nil];
}
- (void)removeKeyboardObservers {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma mark - keyboard movements
- (void)keyboardWillShow:(NSNotification *)notification {
CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;

View file

@ -485,6 +485,7 @@ using Observers = NSHashTable<Observer>;
[contentView removeFromSuperview];
[actionBarView removeFromSuperview];
[searchBarView removeFromSuperview];
[self removeKeyboardObservers];
}];
}

View file

@ -15,15 +15,5 @@ final class SearchNoResultsViewController: MWMViewController {
container.addSubview(MWMSearchNoResults.view(with: nil,
title: L("search_not_found"),
text: L("search_not_found_query")))
MWMKeyboard.add(self)
onKeyboardAnimation()
}
}
extension SearchNoResultsViewController: MWMKeyboardObserver {
func onKeyboardAnimation() {
containerBottomOffset.constant = MWMKeyboard.keyboardHeight()
view.layoutIfNeeded()
}
}

View file

@ -1,8 +1,7 @@
#import "MWMSearchTableView.h"
#import "MWMKeyboard.h"
#import "MWMSearchNoResults.h"
@interface MWMSearchTableView ()<MWMKeyboardObserver>
@interface MWMSearchTableView ()
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * noResultsBottomOffset;
@ -20,7 +19,6 @@
CALayer * sl = self.layer;
sl.shouldRasterize = YES;
sl.rasterizationScale = UIScreen.mainScreen.scale;
[MWMKeyboard addObserver:self];
}
- (void)hideNoResultsView:(BOOL)hide
@ -34,29 +32,9 @@
{
self.noResultsContainer.hidden = NO;
[self.noResultsWrapper addSubview:self.noResultsView];
[self onKeyboardAnimation];
}
}
#pragma mark - MWMKeyboard
- (void)onKeyboardAnimation
{
CGFloat const keyboardHeight = [MWMKeyboard keyboardHeight];
if (keyboardHeight >= self.height)
return;
self.noResultsBottomOffset.constant = keyboardHeight;
if (self.superview)
[self layoutIfNeeded];
}
- (void)onKeyboardWillAnimate
{
if (self.superview)
[self layoutIfNeeded];
}
- (MWMSearchNoResults *)noResultsView
{
if (!_noResultsView)

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -36,7 +36,6 @@
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedPlaceholder" value="email_or_username"/>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular17:blackPrimaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="validatorName" value="MWMInputLoginValidator"/>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="4R7-Vk-fQr" id="koP-R3-XiP"/>
@ -59,7 +58,6 @@
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="localizedPlaceholder" value="password_8_chars_min"/>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular17:blackPrimaryText"/>
<userDefinedRuntimeAttribute type="string" keyPath="validatorName" value="MWMInputPasswordValidator"/>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="delegate" destination="4R7-Vk-fQr" id="QBg-oI-jcp"/>
@ -186,10 +184,10 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="S0n-BM-V4o" userLabel="Auth view">
<rect key="frame" x="20" y="140" width="374" height="192.5"/>
<rect key="frame" x="20" y="140" width="374" height="194"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tzz-yF-441">
<rect key="frame" x="0.0" y="0.0" width="374" height="40"/>
<rect key="frame" x="0.0" y="0.0" width="374" height="41"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="sq5-AS-HML"/>
</constraints>
@ -204,7 +202,7 @@
</userDefinedRuntimeAttributes>
</label>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gqm-JS-hos">
<rect key="frame" x="0.0" y="56" width="374" height="44"/>
<rect key="frame" x="0.0" y="57" width="374" height="44"/>
<color key="backgroundColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="BfT-9z-7iV"/>
@ -218,7 +216,7 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Don't have OpenStreetMap account?" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nhm-W1-U8A">
<rect key="frame" x="0.0" y="124" width="374" height="16.5"/>
<rect key="frame" x="0.0" y="125" width="374" height="17"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="16" id="ntS-Lm-ZFB"/>
</constraints>
@ -231,7 +229,7 @@
</userDefinedRuntimeAttributes>
</label>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0p-dL-PG8">
<rect key="frame" x="0.0" y="148.5" width="374" height="44"/>
<rect key="frame" x="0.0" y="150" width="374" height="44"/>
<color key="backgroundColor" red="0.0" green="0.55294117649999996" blue="0.81568627449999997" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="4EG-ux-LH6"/>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Wns-nH-AQU">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Wns-nH-AQU">
<device id="retina6_1" orientation="landscape" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -275,13 +275,10 @@
<outlet property="carplayPlaceholderLogo" destination="Tqh-46-Yrm" id="S7m-Df-UPv"/>
<outlet property="controlsView" destination="rL1-9E-4b7" id="sfV-7X-WlR"/>
<outlet property="mapView" destination="aPn-pa-nCx" id="tCi-LW-1ll"/>
<outlet property="placePageAreaKeyboard" destination="PFs-sL-oVA" id="O3P-ia-ZlX"/>
<outlet property="placePageContainer" destination="rbx-Oj-jeo" id="aFM-qm-QHB"/>
<outlet property="searchViewContainer" destination="jio-3T-E6G" id="Rjn-UE-zFx"/>
<outlet property="sideButtonsAreaBottom" destination="VfU-Zk-8IU" id="MvP-Ki-4wP"/>
<outlet property="sideButtonsAreaKeyboard" destination="SDX-4J-Jz5" id="kv9-zX-hbD"/>
<outlet property="visibleAreaBottom" destination="OE7-Qb-J0v" id="isp-aT-LtA"/>
<outlet property="visibleAreaKeyboard" destination="YUs-MJ-9w8" id="UJP-KT-2uK"/>
<segue destination="Lfa-Zp-orR" kind="custom" identifier="Map2EditorSegue" customClass="MWMSegue" id="OEF-kR-jKi"/>
<segue destination="QlF-CJ-cEG" kind="custom" identifier="MapToCategorySelectorSegue" customClass="MWMSegue" id="4Cc-99-mlN"/>
<segue destination="5Wc-fy-NOW" kind="custom" identifier="Map2OsmLogin" customClass="MWMSegue" id="7YC-t5-0WN"/>
@ -1058,11 +1055,8 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EbW-Mp-c6s">
<rect key="frame" x="0.0" y="0.0" width="896" height="393"/>
<rect key="frame" x="44" y="0.0" width="808" height="393"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" secondItem="EbW-Mp-c6s" secondAttribute="height" multiplier="1:1" id="tBC-sb-Q3g"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Background"/>
</userDefinedRuntimeAttributes>
@ -1071,14 +1065,10 @@
<viewLayoutGuide key="safeArea" id="yK4-pW-Ads"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="centerY" secondItem="9jm-RW-DZK" secondAttribute="centerY" priority="250" id="BHf-cB-UbU"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="height" relation="lessThanOrEqual" secondItem="9jm-RW-DZK" secondAttribute="height" id="JtV-po-tD6"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="top" relation="greaterThanOrEqual" secondItem="9jm-RW-DZK" secondAttribute="top" id="O71-EO-9LT"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="width" relation="lessThanOrEqual" secondItem="9jm-RW-DZK" secondAttribute="width" id="aCG-RN-DSJ"/>
<constraint firstItem="yK4-pW-Ads" firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="EbW-Mp-c6s" secondAttribute="bottom" id="i0h-xR-pPI"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="height" secondItem="9jm-RW-DZK" secondAttribute="height" priority="750" id="r08-2f-jwK"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="centerX" secondItem="yK4-pW-Ads" secondAttribute="centerX" id="xbz-FB-nZl"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="width" secondItem="9jm-RW-DZK" secondAttribute="width" priority="750" id="zcx-oD-0Uk"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="bottom" secondItem="yK4-pW-Ads" secondAttribute="bottom" id="BHf-cB-UbU"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="top" secondItem="yK4-pW-Ads" secondAttribute="top" id="O71-EO-9LT"/>
<constraint firstItem="yK4-pW-Ads" firstAttribute="trailing" secondItem="EbW-Mp-c6s" secondAttribute="trailing" id="Tqg-dZ-SaB"/>
<constraint firstItem="EbW-Mp-c6s" firstAttribute="leading" secondItem="yK4-pW-Ads" secondAttribute="leading" id="xbz-FB-nZl"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Background"/>
@ -1086,7 +1076,6 @@
</view>
<connections>
<outlet property="container" destination="EbW-Mp-c6s" id="T6K-0M-IAe"/>
<outlet property="containerBottomOffset" destination="i0h-xR-pPI" id="TpT-gj-gr2"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="rxe-Bw-br6" userLabel="First Responder" sceneMemberID="firstResponder"/>