Skip to content

Commit

Permalink
Change ContentView Button
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuzukihashi committed Mar 19, 2020
1 parent 7747888 commit 0e6970f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion DemoApp/DemoApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import NeumorphismUI
struct ContentView: View {
@EnvironmentObject var neumorphism: NeumorphismManager
@State private var showView: Bool = false
@State var isDark = false
var body: some View {
NavigationView {
ScrollView(.vertical, showsIndicators: false) {
Expand All @@ -13,8 +14,10 @@ struct ContentView: View {
.foregroundColor(self.neumorphism.fontColor())
.font(.title)

NeumorphismButton(shapeType: .circle, normalImage: Image(systemName: "sun.max"), selectedImage: Image(systemName: "moon"), width: 44, height: 44, imageWidth: 20, imageHeight: 20, shadowRadius: 4) {
NeumorphismBindingButton(isSelected: $isDark, shapeType: .circle, normalImage: Image(systemName: "sun.max"), selectedImage: Image(systemName: "moon"), width: 44, height: 44, imageWidth: 20, imageHeight: 20, shadowRadius: 4) {
self.neumorphism.changeMode()
}.onAppear() {
self.isDark = self.neumorphism.isDark
}
}
NeumorphismDentView(width: 300, height: 8, cornerRadius: 4)
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/DemoApp/Views/BindingButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct BindingButtonView: View {
imageHeight: 180,
shadowRadius: 4
) {
self.isDark.toggle()
self.neumorphism.changeMode()
}
}.onAppear() {
self.isDark = self.neumorphism.isDark
Expand Down

0 comments on commit 0e6970f

Please sign in to comment.