Peter b317aab568 Add 'submodules/TelegramUI/' from commit 'fa3ac0b61a27c8dd3296518a15891a6f9750cbf2'
git-subtree-dir: submodules/TelegramUI
git-subtree-mainline: 5c1613d1048026b9e00a6ce753775cef87eb53fa
git-subtree-split: fa3ac0b61a27c8dd3296518a15891a6f9750cbf2
2019-06-11 19:00:46 +01:00

43 lines
1.5 KiB
Objective-C
Executable File

//
// STPFormTextField.h
// Stripe
//
// Created by Jack Flintermann on 7/16/15.
// Copyright (c) 2015 Stripe, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class STPFormTextField;
typedef NS_ENUM(NSInteger, STPFormTextFieldAutoFormattingBehavior) {
STPFormTextFieldAutoFormattingBehaviorNone,
STPFormTextFieldAutoFormattingBehaviorPhoneNumbers,
STPFormTextFieldAutoFormattingBehaviorCardNumbers,
STPFormTextFieldAutoFormattingBehaviorExpiration,
};
@protocol STPFormTextFieldDelegate <UITextFieldDelegate>
@optional
- (void)formTextFieldDidBackspaceOnEmpty:(nonnull STPFormTextField *)formTextField;
- (nonnull NSAttributedString *)formTextField:(nonnull STPFormTextField *)formTextField
modifyIncomingTextChange:(nonnull NSAttributedString *)input;
- (void)formTextFieldTextDidChange:(nonnull STPFormTextField *)textField;
@end
@interface STPFormTextField : UITextField
@property(nonatomic, readwrite, nullable) UIColor *defaultColor;
@property(nonatomic, readwrite, nullable) UIColor *errorColor;
@property(nonatomic, readwrite, nullable) UIColor *placeholderColor;
@property(nonatomic, readwrite, assign)BOOL selectionEnabled; // defaults to NO
@property(nonatomic, readwrite, assign)BOOL preservesContentsOnPaste; // defaults to NO
@property(nonatomic, readwrite, assign)STPFormTextFieldAutoFormattingBehavior autoFormattingBehavior;
@property(nonatomic, readwrite, assign)BOOL validText;
@property(nonatomic, readwrite, weak, nullable)id<STPFormTextFieldDelegate>formDelegate;
- (CGSize)measureTextSize;
@end