Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
/ YWTopInputField Public archive

YWTopInputField is LightWeight generic input type

License

Notifications You must be signed in to change notification settings

nsnull0/YWTopInputField

Repository files navigation

YWTopInputField

Version License Platform

Make your input value more userfriendly with easy implementation.

Will be more generic day by day

Availability

⚠️ This Library only Available to Swift > 3.0 ⚠️

DEMO V0.4.0

Demo

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'YWTopInputField', ~> "0.4"
end

Then, run the following command:

$ pod install

Swift 4.0 Compatibility for more stable version

platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
pod 'YWTopInputField', ~> "1.0"
end

Latest Version

pod 'YWTopInputField', ~> "2.0"

Initialization

var alert:YWTopInputFieldController?

self.alert = YWTopInputFieldController(_contentController: self, _andDelegate: self)


//Optional, it will setup to Default setting
alert!.setupInputField(_chooseAutoCorrectionType: .no, _chooseSpellCheckingType: .no, _chooseKeyboardType: .default, _chooseKeyboardAppearance: .alert)

//Optional, it will setup to Default setting
alert!.setupContainer(_chooseBlurStyleEffectContainer: .dark, _chooseTitleColor: .white, _chooseMessageColor: .white, _chooseFontTitle: .boldSystemFont(ofSize: 15.0), _chooseFontMessage: .systemFont(ofSize: 12.0))

Delegation

    func didShowYWInputField()

    func doneAction(resultStr: String,_withTag tag:Int)

    func didCancel()

Property Setup

//Optional, it will setup to Default setting
alert!.setupInputField(_chooseAutoCorrectionType: .no, _chooseSpellCheckingType: .no, _chooseKeyboardType: .default, _chooseKeyboardAppearance: .alert)

//Optional, it will setup to Default setting
alert!.setupContainer(_chooseBlurStyleEffectContainer: .dark, _chooseTitleColor: .white, _chooseMessageColor: .white, _chooseFontTitle: .boldSystemFont(ofSize: 15.0), _chooseFontMessage: .systemFont(ofSize: 12.0))

//Optional, it will setup to Default setting <200>
alert!.setContainer(height: 250)

Property Setup for Version > 2.0

ADDED 'customize' property as builder object

alert!.customize.setCorrectionType(_type: .no)
                .setSpellCheckType(_type: .no)
                .setKeyboardType(_type: .default)
                .setKeyboardAppearance(_type: .alert)
                .setBlurStyleEffectContainer(_type: .dark)
                .setTitleColor(_color: .white)
                .setMessageColor(_color: .white)
                .setFontTitle(_font: .boldSystemFont(ofSize: 15.0))
                .setMessageFont(_font: .systemFont(ofSize: 12.0))
                .setHeightTextContainer(_height: 400)
                .validate()

SNAPSHOT EXAMPLE

self.alert!.customize.setKeyboardType(_type: .numberPad).validate()

self.alert!.showInput(_withTitle: "", _andMessage: "", _withContentString: textField.text!, _withTag:           tagIdentity.textFieldTag.rawValue, completion: {
(finished) in

})

Support

  • Updated occasionally for more Generic and developer-friendly
  • Pull me request if you guys want to contribute too.
  • More detail about usage can be seen at example workspace.

Credits

License

  • nsnull0/YWTopInputField is licensed under MIT LICENSE