Inspired by the recent release of the Material Design language by Google, I put together an experimental implementation of UITextField
and UITextView
that mimic (sort of) the Material Design text fields.
MaterialTextField
and MaterialTextView
are Swift components, inspectable in Interface Builder. The components are contained in a Cocoa Touch Framework. They was developed with Xcode6 and IOS8 SDK betas.
Fortunately, a significant part of functionality (moving placeholder) was already implemented in Objective-C by the JVFloatLabeledTextField project, so I only added the bottom line decoration and the support for field validation. MaterialTextField
and MaterialTextView
are subclass of JVFloatLabeledTextField
and JVFloatLabeledTextView
respectively.
- moving placeholder
- bottom decoration line
- error state support with icon and label
- colors and line width are configurable in Interface Builder
- text view auto expand height when required (only AutoLayout supported)
MaterialTextView
has some serious scrolling issue.
Material Framework is based on JVFloatLabeledTextField. Auto expanding UITextView functionality is imported from AUIAutoGrowingTextView.
See ZFRippleButton for an UIButton with ripple effect, inspired by Google Material Design. Also written in Swift.