EMSecureInputBuilderV2 Protocol Reference

Conforms to NSObject
Declared in EMSecureInputBuilderV2.h

Overview

The input builder v2 class that enables to build a secure input UI (secure keypad).

The secure input UI does not use the native UIKit keypad component but rather draws itself based on the configuration provided.

It supports the build of the secure input UI in both full screen and dialog mode, single or double entry UI. It also provides the flexibility for the application maker to fully customize the top screen UI or even override the custom OK button behavior.

The output of the secure keypad is the EMPinAuthInput (instead of NSString) to make sure the keypad has total control of wiping sensitive data after it is used.

– buildWithScrambling:isDoubleInputField:isDialog:onFinishBlock: required method

Creates a secure input UI.

- (id<EMSecureInputUi>)buildWithScrambling:(BOOL)isScrambling isDoubleInputField:(BOOL)isDoubleInputField isDialog:(BOOL)isDialog onFinishBlock:(EMSecureInputUiOnFinish)keyEnteredBlock

Parameters

isScrambling

Indicates if the keypad would have a scrambled key locations. The scrambling is completely random and different for each time the keypad is shown.

isDoubleInputField

Indicates if the keypad would have two input fields to enter the key. This is useful in case of using the keypad for a new password and its confirmation. It’s important to be aware that the keypad itself will NOT perform any comparison of the two key. The application developer can use method [EMSecureContainer isEqual:] for an equality confirmation.

isDialog

Indicates if the keypad would be in dialog mode.

keyEnteredBlock

Callback on finish. Depends on the OK button behavior settings, the finish callback could be triggered by the user or system. For double entry mode, trigger the OK button will trigger the callback only if both input field key count hit the minimum input length.

Return Value

The secure input UI. The secure input UI view controller can be fed into a navigation controller or presented as a modal view controller in the current view.

Availability

4.4

Discussion

Warning: This method should be called once all the necessary configurations have been done. Note that the default configuration will be applied for attributes that have not been set to custom values.

See Also

Declared In

EMSecureInputBuilderV2.h

– setEncoding: required method

Sets the encoding to use when creating the EMPinAuthInput object from the text-based pin.

- (void)setEncoding:(NSStringEncoding)encoding

Parameters

encoding

The encoding method to use when generating byte array from the character password.

Availability

4.4

Discussion

Warning: This method is especially dedicated for existing applications that are currently using their own keypad and would like to use EZIO secure input UI in replacement. For those applications, the EMPinAuthInput used to be generated from a NSString object given an encoding method. So, the application developers need to make sure to use the same (or compatible) encoding method to allow the generated bytes are correct.

Declared In

EMSecureInputBuilderV2.h

– wipe required method

Wipes all the sensitive data of the secure input builder. The method would also be automatically triggered upon the release of this object on the autorelease pool of the current thread.

It’s recommended to call this method at the end of the callback block EMSecureInputUiOnFinish.
Note: Other non-sensitive configuration such as color setting and text-label setting won’t be reset in this function.

- (void)wipe

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setScreenBackgroundColor: required method

Set secure input UI screen background color.

- (void)setScreenBackgroundColor:(UIColor *)color

Parameters

color

screen background color. Screen background color cannot be nil.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setScreenBackgroundImage: required method

Set secure input UI screen background image. The screen background image will be drawn on top of screen background color.

- (void)setScreenBackgroundImage:(UIImage *)image

Parameters

image

screen background image. Screen background image cannot be nil.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– showNavigationBar: required method

Show or hide navigation bar.

- (void)showNavigationBar:(BOOL)show

Parameters

show

show or hide navigation bar.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– showTopScreen: required method

Show or hide top screen.

- (void)showTopScreen:(BOOL)show

Parameters

show

show or hide top screen. YES to show default secure input UI. NO allows developer to customize the top screen.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setLogoImage:andPosition: required method

Set logo image and position.

- (void)setLogoImage:(UIImage *)image andPosition:(EMSecureInputUiLogoPosition)position

Parameters

image

logo image. Logo image cannot be nil.

position

logo position.

Availability

4.4

Discussion

Note: The logo image won’t be drawn on screen for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setLogoBarBackgroundColor: required method

Set logo bar background color.

- (void)setLogoBarBackgroundColor:(UIColor *)color

Parameters

color

logo bar background color. Logo bar background color cannot be nil.

Availability

4.4

Discussion

Note: The logo bar background won’t be drawn on screen for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setFirstLabel: required method

Sets the first label.

- (void)setFirstLabel:(NSString *)text

Parameters

text

first label. First label cannot be nil. First label is assumed to be single line. Keep the first label as short as possible.

Availability

4.4

Discussion

Note: The first label won’t be drawn on screen for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setSecondLabel: required method

Set second text. Only applicable if double-entry mode is enabled when create the secure keypad.

- (void)setSecondLabel:(NSString *)text

Parameters

text

second label. Second label cannot be nil. Second label is assumed to be single line. Keep the second label as short as possible.

Availability

4.4

Discussion

Note: The second label won’t be drawn on screen for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setLabelColor: required method

Set label color.

- (void)setLabelColor:(UIColor *)color

Parameters

color

label color. Label color cannot be nil.

Availability

4.4

Discussion

Note: The label color won’t be used for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setLabelFontSize: required method

Set label font size.

- (void)setLabelFontSize:(CGFloat)fontSize

Parameters

fontSize

label font size. Label font size shall be greater than 0.

Availability

4.4

Discussion

Note: The label font size won’t be used for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setLabelAlignment: required method

Set label alignment.

- (void)setLabelAlignment:(EMSecureInputUiLabelAlignment)alignment

Parameters

alignment

label alignment.

Availability

4.4

Discussion

Note: The label alignment won’t be used for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setInputFieldFontSize: required method

Set input field font size.

- (void)setInputFieldFontSize:(CGFloat)fontSize

Parameters

fontSize

input field font size. Input field font size shall be greater than 0.

Availability

4.4

Discussion

Note: The input field font size won’t be used for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setInputFieldBorderColor:forState: required method

Set input field border color for corresponding UI control state.

- (void)setInputFieldBorderColor:(UIColor *)color forState:(EMSecureInputUiControlFocusState)state

Parameters

color

input field border color. Input field boder color cannot be nil.

state

UI control state.

Availability

4.4

Discussion

Note: The input field border color won’t be used for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setInputFieldBackgroundColor:forState: required method

Set input field background color for corresponding UI control state.

- (void)setInputFieldBackgroundColor:(UIColor *)color forState:(EMSecureInputUiControlFocusState)state

Parameters

color

input field background color. Input field background color cannot be nil.

state

UI control state.

Availability

4.4

Discussion

Note: The input field background color won’t be used for custom top UI ([EMSecureInputBuilderV2 showTopScreen:] set to NO).

Declared In

EMSecureInputBuilderV2.h

– setMinimumInputLength:andMaximumInputLength: required method

Set minimum and maximum input length. Minimum and maximum input length shall be identical for the following OK button behavior: EMSecureInputUiOkButtonNone and EMSecureInputUiOkButtonCustom.

- (void)setMinimumInputLength:(NSInteger)minimumLength andMaximumInputLength:(NSInteger)maximumLength

Parameters

minimumLength

minimum input length. Allowed minimum input length is [0,16]. Minimum input length should be smaller than maximum input length.

maximumLength

maximum input length. Allowed maximum input length is [1,16].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setNumberOfRows:andColumns: required method

Set number of rows and columns.

- (void)setNumberOfRows:(NSInteger)numberOfRows andColumns:(NSInteger)numberOfColumns

Parameters

numberOfRows

number of rows. Allowed number of rows is [1,8].

numberOfColumns

number of columns. Allowed number of columns is [2,8].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setKeypadHeightRatio: required method

Set keypad height ratio.

- (void)setKeypadHeightRatio:(CGFloat)ratio

Parameters

ratio

keypad height ratio. Allowed keypad height ratio is [0.25,0.5].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– swapOkAndDeleteButton required method

By default, the OK button is located at the bottom left of the secure input UI and the Delete button is located at the bottom right of the secure input UI. Swap OK and Delete button if needed.

- (void)swapOkAndDeleteButton

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setKeys: required method

Set keys.

- (void)setKeys:(NSString *)keys

Parameters

keys

keypad keys. Keys cannot be nil. Keys shall only contains alpha-numeric characters. Allowed keys length is [1,32]. Keys length shall be smaller or equals to number of keypad matrix allocated.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setKeys:andSubscripts: required method

Set keys and subscripts.

- (void)setKeys:(NSString *)keys andSubscripts:(NSArray *)subscripts

Parameters

keys

keypad keys. Keys cannot be nil. Keys shall only contains alpha-numeric characters. Allowed keys length is [1,32]. Keys length shall be smaller or equals to number of keypad matrix allocated.

subscripts

subscripts. Subscripts cannot be nil. Subscripts shall only contains alpha-numeric characters. Allowed subscripts length is [0,4].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setOkButtonText: required method

Set OK button text.

- (void)setOkButtonText:(NSString *)text

Parameters

text

OK button text. OK button text cannot be nil. Allowed OK button text length is [1,14].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setDeleteButtonText: required method

Set Delete button text.

- (void)setDeleteButtonText:(NSString *)text

Parameters

text

Delete button text. Delete button text cannot be nil. Allowed Delete button text length is [1,14].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setDistanceBetweenKeyAndSubscript: required method

Set distance between key and subscript.

- (void)setDistanceBetweenKeyAndSubscript:(CGFloat)distance

Parameters

distance

distance between key and subscript. Allowed distance between key and subscript is [0.0,4.0].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setButtonBorderWidth: required method

Set button border width.

- (void)setButtonBorderWidth:(NSInteger)width

Parameters

width

button border width. Allowed button border width is [1,10].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setButtonBorderColor: required method

Set button border color.

- (void)setButtonBorderColor:(UIColor *)color

Parameters

color

button border color. Button border color cannot be nil.

Availability

4.4

Discussion

Warning: This API is deprecated since 4.6. Use setKeypadFrameColor: and setKeypadGridGradientColors:gridGradientEndColor: instead.

Declared In

EMSecureInputBuilderV2.h

– setKeypadFrameColor: required method

Set keypad frame color.

- (void)setKeypadFrameColor:(UIColor *)color

Parameters

color

keypad frame color. Keypad frame color cannot be nil.

Availability

4.6

Declared In

EMSecureInputBuilderV2.h

– setKeypadGridGradientColors:gridGradientEndColor: required method

Set the gradient start and end color for keypad grids which separates between the keys.

- (void)setKeypadGridGradientColors:(UIColor *)startColor gridGradientEndColor:(UIColor *)endColor

Parameters

startColor

sets color at both ends of the inner keypad border.

endColor

sets color at middle of the inner keypad border.

Availability

4.6

Declared In

EMSecureInputBuilderV2.h

– setButtonPressedVisibility: required method

Set button pressed visibility.

- (void)setButtonPressedVisibility:(BOOL)visible

Parameters

visible

YES to enable the selected state of the button when it’s pressed. For security reason, it’s disabled by default. User won’t be able to see the selected state when the button is pressed.

Availability

4.4

See Also

Declared In

EMSecureInputBuilderV2.h

– setKeyFont: required method

Set key font.

- (void)setKeyFont:(UIFont *)font

Parameters

font

key font. Key font cannot be nil. Allowed key font size is [1.0,100.0].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setSubscriptFont: required method

Set subscript font.

- (void)setSubscriptFont:(UIFont *)font

Parameters

font

subscript font. subscript font cannot be nil. Allowed subscript font size is [1,key font size].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setOkButtonFont: required method

Set OK button font.

- (void)setOkButtonFont:(UIFont *)font

Parameters

font

OK button font. OK button font cannot be nil. Allowed OK button font size is [1.0,100.0].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setDeleteButtonFont: required method

Set Delete button font.

- (void)setDeleteButtonFont:(UIFont *)font

Parameters

font

Delete button font. Delete button font cannot be nil. Allowed Delete button font size is [1.0,100.0].

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setKeyColor:forState: required method

Set key color for corresponding UI state.

- (void)setKeyColor:(UIColor *)color forState:(EMSecureInputUiControlState)state

Parameters

color

key color. Key color cannot be nil.

state

UI state.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setSubscriptColor:forState: required method

Set subscript color for corresponding UI state.

- (void)setSubscriptColor:(UIColor *)color forState:(EMSecureInputUiControlState)state

Parameters

color

subscript color. Subscript color cannot be nil.

state

UI state.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setOkButtonTextColor:forState: required method

Set OK button text color for corresponding UI state.

- (void)setOkButtonTextColor:(UIColor *)color forState:(EMSecureInputUiControlState)state

Parameters

color

OK button text color. OK button text color cannot be nil.

state

UI state.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setDeleteButtonTextColor:forState: required method

Set Delete button text color for corresponding UI state.

- (void)setDeleteButtonTextColor:(UIColor *)color forState:(EMSecureInputUiControlState)state

Parameters

color

Delete button text color. Delete button text color cannot be nil.

state

UI state.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setButtonBackgroundColor:forState: required method

Set button background color for corresponding UI state.

- (void)setButtonBackgroundColor:(UIColor *)color forState:(EMSecureInputUiControlState)state

Parameters

color

button background color. Button background color cannot be nil.

state

UI state.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setButtonBackgroundImage: required method

Set button background image.

- (void)setButtonBackgroundImage:(UIImage *)image

Parameters

image

button background image. Button background image cannot be nil.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setButtonBackgroundImageOpacity:forState: required method

Set button background image opacity for corresponding UI state.

- (void)setButtonBackgroundImageOpacity:(CGFloat)opacity forState:(EMSecureInputUiControlState)state

Parameters

opacity

button background image opacity. Allowed button background image opacity is [0.0,1.0].

state

UI state. Button background image opacity for selected state is not supported.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setOkButtonImage: required method

Set OK button image.

- (void)setOkButtonImage:(UIImage *)image

Parameters

image

OK button image. OK button image cannot be nil.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setOkButtonImageOpacity:forState: required method

Set OK button image opacity for corresponding UI state.

- (void)setOkButtonImageOpacity:(CGFloat)opacity forState:(EMSecureInputUiControlState)state

Parameters

opacity

OK button image opacity. Allowed OK button image opacity is [0.0,1.0].

state

UI state. OK button image opacity for selected state is not supported.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setDeleteButtonImage: required method

Set Delete button image.

- (void)setDeleteButtonImage:(UIImage *)image

Parameters

image

Delete button image. Delete button image cannot be nil.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setDeleteButtonImageOpacity:forState: required method

Set Delete button image opacity for corresponding UI state.

- (void)setDeleteButtonImageOpacity:(CGFloat)opacity forState:(EMSecureInputUiControlState)state

Parameters

opacity

Delete button image opacity. Allowed Delete button image opacity is [0.0,1.0].

state

UI state. Delete button image opacity for selected state is not supported.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setButtonGradientColors:buttonGradientEndColor:forState: required method

Set the start and end color of the button gradient for corresponding control state.

- (void)setButtonGradientColors:(UIColor *)startColor buttonGradientEndColor:(UIColor *)endColor forState:(EMSecureInputUiControlState)state

Parameters

startColor

the gradient start color.

endColor

the gradient end color.

state

the control state.

Availability

4.8

Declared In

EMSecureInputBuilderV2.h

– setOkButtonGradientColors:buttonGradientEndColor:forState: required method

Set the start and end color of the OK button gradient for corresponding control state.

- (void)setOkButtonGradientColors:(UIColor *)startColor buttonGradientEndColor:(UIColor *)endColor forState:(EMSecureInputUiControlState)state

Parameters

startColor

the gradient start color.

endColor

the gradient end color.

state

the control state.

Availability

4.8

Declared In

EMSecureInputBuilderV2.h

– setDeleteButtonGradientColors:buttonGradientEndColor:forState: required method

Set the start and end color of the Delete button gradient for corresponding control state.

- (void)setDeleteButtonGradientColors:(UIColor *)startColor buttonGradientEndColor:(UIColor *)endColor forState:(EMSecureInputUiControlState)state

Parameters

startColor

the gradient start color.

endColor

the gradient end color.

state

the control state.

Availability

4.8

Declared In

EMSecureInputBuilderV2.h

– setOkButtonBehavior: required method

Set OK button behavior. Minimum and maximum input length shall be identical for the following OK button behavior: EMSecureInputUiOkButtonNone and EMSecureInputUiOkButtonCustom.

- (void)setOkButtonBehavior:(EMSecureInputUiOkButtonBehavior)behavior

Parameters

behavior

OK button behavior.

Availability

4.4

Declared In

EMSecureInputBuilderV2.h

– setIsDeleteButtonAlwaysEnabled: required method

Set delete button always enabled.

- (void)setIsDeleteButtonAlwaysEnabled:(BOOL)isAlwaysEnabled

Parameters

isAlwaysEnabled

to enable delete button irrespective of input.

Availability

4.6

Declared In

EMSecureInputBuilderV2.h

– setKeypadViewRectInPortrait: required method

Set the rect of the keypad view in portrait mode.

- (void)setKeypadViewRectInPortrait:(CGRect)rect

Parameters

rect

keypad view rect.

Availability

4.8

Declared In

EMSecureInputBuilderV2.h

– setKeypadViewRectInLandscape: required method

Set the rect of the keypad view in landscape mode.

- (void)setKeypadViewRectInLandscape:(CGRect)rect

Parameters

rect

keypad view rect.

Availability

4.8

Declared In

EMSecureInputBuilderV2.h

– setIsOkButtonDisabled: required method

Enabled or disable the OK button.

- (void)setIsOkButtonDisabled:(BOOL)disabled

Parameters

disabled

to disable the OK button or not.

Availability

5.0

Declared In

EMSecureInputBuilderV2.h

– setIsDeleteButtonVisible: required method

Display or hide the delete button.

- (void)setIsDeleteButtonVisible:(BOOL)visible

Parameters

visible

to set the delete button visible or not.

Availability

5.0

Declared In

EMSecureInputBuilderV2.h

– setButtonTouchVisualEffect: required method

Set the button visual effect.

- (void)setButtonTouchVisualEffect:(EMButtonTouchVisualEffect)buttonTouchVisualEffect

Parameters

buttonTouchVisualEffect

The visual effect.

Availability

5.0

Declared In

EMSecureInputBuilderV2.h

– setRippleEffectParameters:duration: required method

Set the visual effect parameters after setting setButtonTouchVisualEffect.

- (void)setRippleEffectParameters:(UIColor *)color duration:(long)milliseconds

Parameters

color

The color of the touch button visual effect.

milliseconds

The duration in milliseconds.

Availability

5.0

Declared In

EMSecureInputBuilderV2.h

– validateUiConfiguration required method

Validate UI configuration.

- (void)validateUiConfiguration

Availability

4.4

Discussion

Warning: This method should be called once all the necessary configurations have been done.

Declared In

EMSecureInputBuilderV2.h