File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ - (void)setUpFromNib {
5959 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
6060 self.inputField .userInteractionEnabled = YES ;
6161
62+ #if __IPHONE_OS_MIN_VERSION_REQUIRED > __IPHONE_12_0
63+ if (@available (iOS 12.0 , *)) {
64+ self.inputField .textContentType = UITextContentTypeOneTimeCode;
65+ }
66+ #endif // __IPHONE_OS_MIN_VERSION_REQUIRED > __IPHONE_12_0
67+
6268 // Initialization code
6369 _codeEntry = [NSMutableString string ];
6470
@@ -165,10 +171,18 @@ - (CGSize)inputFieldIntrinsicContentSize {
165171
166172- (CGSize)intrinsicContentSize {
167173 CGSize textFieldSize = [self inputFieldIntrinsicContentSize ];
168-
169174 return textFieldSize;
170175}
171176
177+ - (UITextContentType)textContentType {
178+ #if __IPHONE_OS_MIN_VERSION_REQUIRED > __IPHONE_12_0
179+ if (@available (iOS 12.0 , *)) {
180+ return UITextContentTypeOneTimeCode;
181+ }
182+ #endif // __IPHONE_OS_MIN_VERSION_REQUIRED > __IPHONE_12_0
183+ return nil ;
184+ }
185+
172186@end
173187
174188NS_ASSUME_NONNULL_END
You can’t perform that action at this time.
0 commit comments