SSNeumorphicView
SSNeumorphicView is to build a Neumorphism view, button, and text filed in iOS.
Features!
- Create Neumorphic view, button and text field using the SSNeumorphicView
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- iOS 10.0+
- Xcode 9+
Installation
CocoaPods You can use CocoaPods to install SSNeumorphicView by adding it to your Podfile:
use_frameworks!
pod 'SSNeumorphicView'
Usage example
In the storyboard add a UIView and change its class to SSNeumorphicView
Import Neumorphic package to your view.
import SSNeumorphicView
Create NeumorphicView with the outer shadow.
@IBOutlet weak var viewNeumorphic: SSNeumorphicView! {
didSet {
viewNeumorphic.viewDepthType = .outerShadow
}
}
Create neumorphic text field with the Inner shadow.
@IBOutlet weak var txtSSNeumorphic: SSBaseTextField! {
didSet {
txtSSNeumorphic.txtDepthType = .innerShadow
}
}
Create neumorphic button with the Outer shadow.
@IBOutlet weak var btnNeumorphic: SSNeumorphicButton! {
didSet {
btnNeumorphic.btnDepthType = .outerShadow
}
}
Create neumorphic rounded button with the inner shadow.
@IBOutlet weak var btnRoundedNeumorphic: SSNeumorphicButton! {
didSet {
btnRoundedNeumorphic.btnDepthType = .innerShadow
btnRoundedNeumorphic.layer.masksToBounds = true
btnRoundedNeumorphic.btnNeumorphicCornerRadius = btnRoundedNeumorphic.frame.width/2
}
}
TODO
Dark mode support
License
SSNeumorphicView is available under the MIT license. See the LICENSE file for more info.