NeumorphismUI is a very useful library that allows you to easily use Neumorphism designs in SwiftUI.
- iOS 13.0+
- Xcode 11+
- Swift 5+
let neumorphism = NeumorphismManager(
isDark: false,
lightColor: Color(hex: "C1D2EB"),
darkColor: Color(hex: "2C292C")
)
let contentView = ContentView()
.environmentObject(neumorphism)
import SwiftUI
import NeumorphismUI
struct SimpleView: View {
@EnvironmentObject var neumorphism: NeumorphismManager
var body: some View {
ZStack {
neumorphism.color.edgesIgnoringSafeArea(.all)
Circle()
.fill(neumorphism.color)
.frame(width: 200, height: 200)
.neumorphismShadow()
}
}
}
let neumorphism = NeumorphismManager(
isDark: true,
lightColor: Color(hex: "C1D2EB"),
darkColor: Color(hex: "2C292C")
)
let contentView = ContentView()
.environmentObject(neumorphism)
NeumorphismButton(
shapeType: .roundedRectangle(cornerRadius: 20),
normalImage: Image(systemName: "star"),
selectedImage: Image(systemName: "star.fill")
)
Simple Usage!
struct NeumorphismSliderView: View {
@EnvironmentObject var neumorphism: NeumorphismManager
@State private var value: Double = 0
var body: some View {
ZStack {
neumorphism.color.edgesIgnoringSafeArea(.all)
VStack {
Text("VALUE: \(value)")
.foregroundColor(self.neumorphism.fontColor())
NeumorphismSlider(value: self.$value, changeHandler: {
// call change method
}) {
// call ended method
}
}
}
}
}