All Projects → mohammadalijf → Underlinetextfield

mohammadalijf / Underlinetextfield

Licence: mit
Simple UITextfield Subclass with state

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Underlinetextfield

Tweetextfield
Lightweight set of text fields with nice animation and functionality. 🚀 Inspired by https://uimovement.com/ui/2524/input-field-help/
Stars: ✭ 421 (+169.87%)
Mutual labels:  cocoapods, carthage, textfield, uitextfield
TextInputLayout
The objective of this code is to guide you to create login screen with TextInputLayout in iOS app.
Stars: ✭ 30 (-80.77%)
Mutual labels:  input, uitextfield, textfield
Pincodeinputview
A input text view for entering pin code.
Stars: ✭ 108 (-30.77%)
Mutual labels:  cocoapods, carthage, uitextfield
Passwordtextfield
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies
Stars: ✭ 281 (+80.13%)
Mutual labels:  cocoapods, carthage, textfield
Autocompletefield
Subclass of UITextField that shows inline suggestions while typing.
Stars: ✭ 656 (+320.51%)
Mutual labels:  input, textfield, uitextfield
Uitextfield Navigation
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews
Stars: ✭ 436 (+179.49%)
Mutual labels:  cocoapods, carthage, uitextfield
Anyformatkit
Simple text formatting in Swift
Stars: ✭ 296 (+89.74%)
Mutual labels:  cocoapods, carthage, uitextfield
Wstagsfield
An iOS text field that represents tags, hashtags, tokens in general.
Stars: ✭ 1,013 (+549.36%)
Mutual labels:  cocoapods, carthage, uitextfield
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+1002.56%)
Mutual labels:  cocoapods, carthage, uitextfield
Sffocusviewlayout
UICollectionViewLayout with focused content
Stars: ✭ 1,760 (+1028.21%)
Mutual labels:  cocoapods, carthage
Natrium
A pre-build (Swift) script to alter your Xcode project at pre-build-time per environment, build configuration and target.
Stars: ✭ 131 (-16.03%)
Mutual labels:  cocoapods, carthage
Heapinspector For Ios
Find memory issues & leaks in your iOS app without instruments
Stars: ✭ 1,819 (+1066.03%)
Mutual labels:  cocoapods, carthage
Cminputview
💪之前代码是基于UITextView进行的封装,侵入性较强,不方便使用,现使用Category重构代码,支持Cocoapods
Stars: ✭ 149 (-4.49%)
Mutual labels:  cocoapods, textfield
Floatinglabeltextfieldswiftui
Floating Label TextField for SwiftUI. FloatingLabelTextFieldSwiftUI
Stars: ✭ 128 (-17.95%)
Mutual labels:  cocoapods, textfield
Color
Color utilities for macOS, iOS, tvOS, and watchOS
Stars: ✭ 145 (-7.05%)
Mutual labels:  cocoapods, carthage
Croc
Swift emoji string parsing library
Stars: ✭ 124 (-20.51%)
Mutual labels:  cocoapods, carthage
Switch
💊 An iOS switch control implemented in Swift with full Interface Builder support
Stars: ✭ 132 (-15.38%)
Mutual labels:  cocoapods, carthage
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-15.38%)
Mutual labels:  cocoapods, carthage
Adpuzzleanimation
Inspired by Fabric - Answers animation. Allows to "build" given view with pieces. Allows to "destroy" given view into pieces
Stars: ✭ 123 (-21.15%)
Mutual labels:  cocoapods, carthage
Coregpx
A library for parsing and creation of GPX location files. Purely Swift.
Stars: ✭ 132 (-15.38%)
Mutual labels:  cocoapods, carthage

Build Status Carthage Compatible CocoaPods

UnderLineTextField

Simple UITextfield Subclass with state

demo

Installation

Cocoapods

You can use cocoapods to add UnderLineTextField to your project

target 'MyApp' do
  pod 'UnderLineTextField', '~> 2.1'
end

Carthage

You can use Carthage to add UnderLineTextField to your project

To integrate UnderLineTextField into your Xcode project using Carthage, specify it in your 'Cartfile':

github "mohammadalijf/UnderLineTextField"

Run carthage update to build the framework and drag the built UnderLineTextField.framework into your Xcode project.

xcode does not support 'IBDesignable' or 'IBInspecatable' on cocoa frameworks. to work around for carthage users. created simple 'UnderLineTextFieldCarthage.swift' file. it is a wrapper around 'UnderLineTextfield' which can be used in projects for supporting 'IBDesignable' and 'IBInspecatable'. just simply drop 'UnderLineTextFieldCarthage.swift' in your project and use this class instead of 'UnderLineTextfield'.

How It Works

UnderLineTextField

each textfield have four state

  • inactive

    when textfield have no errors or warnings and is resigned from first responder

  • active

    when textfield become first responder

  • warning

    when you want show warnings to user

  • error

    when you want show error to user

by default textfield have .inactive state

textfield have diffrent kind of UnderLineTextFieldValidateType. each time tells textfield when call validate().

  • onFly

    as soon as textfield value changes

  • afterEdit

    as soon as textfield didEndEditing

  • onCommit

    manualy gets validate by user

  • always

    alway validate textfield. when become beginEditing, when value changes, when didEndEditing

by default value is .afterEdit

you can change validation type by setting validationType

 underLineTextField.validationType = .always

you can ask textfield to validate user input by calling

underLineTextField.validate()

UnderLineTextFieldDelegate

Also you have UnderLineTextFieldDelegate to help you with your textfield. when a class confirm to UnderLineTextFieldDelegate protocol, it also confirms to UITextFieldDelegate. so you have both delegate methods on hand.

  • textFieldValidate

this func is called whenever you ask the textfield to validate() user input. you usually want to set warning or error state in here.

func textFieldValidate(underLineTextField: UnderLineTextField) throws

you can either throw warrning or errors

func textFieldValidate(underLineTextField: UnderLineTextField) throws {
    throw UnderLineTextFieldErrors
                    .error(message: "error message")
    // or
    throw UnderLineTextFieldErrors
                    .warning(message: "warning message")
}
  • textFieldTextChanged

this func is called when text changes. or clear button is used.

func textFieldTextChanged(underLineTextField: UnderLineTextField)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].