[ios] Removed unnecessary input validators

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2023-02-18 23:42:08 +01:00 committed by Alexander Borsuk
parent 54436482af
commit b5cce77a69
19 changed files with 13 additions and 278 deletions

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

@ -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

@ -80,7 +80,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 +137,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 +260,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 */; };
@ -820,7 +814,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 +892,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 +1686,6 @@
458287C21AD3BE2000BA8940 /* DownloadIndicatorProtocol.h */,
46F26CD610F623BA00ECCA39 /* EAGLView.h */,
46F26CD710F623BA00ECCA39 /* EAGLView.mm */,
34ABA61D1C2D514A00FE1BEC /* Input Validators */,
340475791E081B3300C92850 /* iosOGLContext.h */,
3404757A1E081B3300C92850 /* iosOGLContext.mm */,
3404757B1E081B3300C92850 /* iosOGLContextFactory.h */,
@ -2087,7 +2069,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 +2360,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 +3927,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 +3996,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 +4099,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 +4185,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 +4201,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 +4227,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 */,

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

@ -22,9 +22,7 @@
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSString * newString = [textField.text stringByReplacingCharactersInRange:range withString:string];
BOOL const isCorrect = [textField.validator validateString:newString];
if (isCorrect)
[self.delegate editCellTextChanged:newString];
[self.delegate editCellTextChanged:newString];
return YES;
}

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

@ -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"/>