bit update
Neumorphism is next design theory. This library make easy to made SwiftUI app with Neumorphism.
Open your Xcode project, select File -> Swift Packages -> Add Package Dependency.... and type this depository’s URL.
File
Swift Packages
Add Package Dependency...
let contentView = ContentView() .environment(\.nmBaseColor, Color(hex: "C1D2EB")
struct ContentView: View { @Environment(\.nmBaseColor) var baseColor: Color var body: some View { ZStack { baseColor .edgesIgnoringSafeArea(.all) Circle() .fill(baseColor) .frame(width: 300, height: 200) .modifier(NMConvexModifier()) } } }
There is detail of usage in Demo_iOS.
Demo_iOS
You can use Neumorphismic TabView.
enum Tab: String, Hashable, CaseIterable { case demo = "Demo" case settings = "Settings" func image() -> Image { switch self { case .demo: return Image(systemName: "house") case .settings: return Image(systemName: "gear") } } func view() -> some View { VStack { if self == .demo { DemosView() } else { SettingsView() } } } }
struct ContentView: View { @State var selection: Tab = .demo var body: some View { NMFloatingTabView( selection: $selection, labelText: { tab in tab.rawValue }, labelImage: { tab in tab.image() } ) { tab in tab.view() } .environment(\.nmBaseColor, Color(hex: "C1D2EB")) } }
If you want to change appearance when button highlighted, you can use it.
struct ContentView: View { @State var isSelected = false var body: some View { NMHighlightableButton(action: { self.isSelected.toggle() }) { isH in Image(systemName: self.isSelected ? "house.fill" : "house") .resizable() .aspectRatio(contentMode: .fit) .foregroundColor(.blue) .opacity(isH ? 0.6 : 1) .frame(width: isH ? 80 : 100, height: isH ? 80 : 100) } } }
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Neumorphismic
Neumorphism is next design theory. This library make easy to made SwiftUI app with Neumorphism.
Requirements
Installation
Swift Package Manager
Open your Xcode project, select
File
->Swift Packages
->Add Package Dependency...
. and type this depository’s URL.How to use
Simple way
There is detail of usage in
Demo_iOS
.FloatingTabView
You can use Neumorphismic TabView.
HighlightableButton
If you want to change appearance when button highlighted, you can use it.