BlockInputView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BlockInputView'
BlockInputView is very simple to use, to setup BlockInputView follow below step,
- Assign class BlockInputView to that UIView on with you want to make blockInput.
- Make it's outlet in ViewController
- Call following method
public func activate(widgetAppearance: WidgetAppearance = WidgetAppearance())
public func activate(widgetAppearance: WidgetAppearance = WidgetAppearance())
Function above takes WidgetAppearance Object as parameter in which you can configure following properties.
- isMandatory: Bool
- minNumberOfSections: Int
- sectionWidth: Int
- minLength: Int
- maxLength: Int
- isSecureTextEntry: Bool
- textColor: UIColor
- FontSize: CGFloat
- FontName: String
- hintColor: String
- hintText: String
- errorFontName: String
- errorFontSize: String
- errorTextColor: UIColor
- errorMessage: String
- emptyMessage: String
- bottomLineFocusOutColor: UIColor
- bottomLineFocusedColor: UIColor
- bottomLineErrorColor: UIColor
- blockSpacing: CGFloat
- cursorColor: CGFloat
- keyboardType: UIKeyboardType
- Following method will return text written in inputview.
public func getFieldText() -> String
- Following method will validate contraints (e.g maxLenght, isMandatory, minLength) and return true or false on result of validation.
public func validate() -> Bool
- Activate will initialize BlockInputView
public func activate(widgetAppearance: WidgetAppearance = WidgetAppearance())
BlockInputView provides natural way to input card number, pin, one-time password. Following are some examples.
herralimurad, herralimurad@gmail.com
BlockInputView is available under the MIT license. See the LICENSE file for more info.