Swiftpack.co - qiwi/MaterialTextView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by qiwi.
qiwi/MaterialTextView 5.0.0
Material text view
⭐️ 9
🕓 1 year ago
iOS
.package(url: "https://github.com/qiwi/MaterialTextView.git", from: "5.0.0")

MaterialTextView

Description

This is QIWI's implementation of text field/view according to Material Design. It supports formattable input with masks since it uses FormattableTextView.

This component is highly customizable via styles in real time. You can check user input for validity manually by firing validate() method (it checks the text according to actionValidator property) or automatically during user's input by setting inputValidator property.

Placeholder has 2 modes: animatable and normal.

Requirements

  • iOS 9.0+

Installation

CocoaPods

pod 'FormattableTextView', :git => 'https://github.com/qiwi/FormattableTextView'
pod 'MaterialTextView', :git => 'https://github.com/qiwi/MaterialTextView'

Carthage

git "https://github.com/qiwi/MaterialTextView" "master"

Usage

Example 1

let tv = MaterialTextView(.init(style: .defaultStyle))

Example 2

let viewModel = MaterialTextViewModel(
	style: .defaultStyle,
	placeholder: .init(type: .alwaysOnTop, text: "Telephone number"),
	formats: ["+d (ddd) ddd-dd-dd", "+ddddddddddddddddd"]
)
viewModel.formatSelectionStrategy = .startFromFirst
let tv = MaterialTextView(viewModel)
if #available(iOS 10.0, *) {
	tv.textComponent.textContentType = .telephoneNumber
	tv.textComponent.keyboardType = .numberPad
	tv.textComponent.allowSmartSuggestions = true
}

License

Distributed under the MIT License.

GitHub

link
Stars: 9
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Help label with clickable text
1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/qiwi/MaterialTextView/compare/4.0.0...5.0.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics