Skip to content

mbigatti/MaterialDesignTest

Repository files navigation

Material Design Test

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.

image

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.

Features

  • 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)

Limits

  • MaterialTextView has some serious scrolling issue.

Acknowledgments

Material Framework is based on JVFloatLabeledTextField. Auto expanding UITextView functionality is imported from AUIAutoGrowingTextView.

See Also

See ZFRippleButton for an UIButton with ripple effect, inspired by Google Material Design. Also written in Swift.

Contact

About

Experimental Material Design UITextField and UITextView in Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published