NeumorphismUI

0.4.7

NeumorphismUI is a library that can be used with SwiftUI. Compatible with Swift Package Manager.
tsuzukihashi/NeumorphismUI

What's New

v0.4.7

2020-10-01T16:39:21Z

We added LibraryItem

Github stars Github forks Swift Package Manager compatible License: MIT

NeumorphismUI_Logo

NeumorphismUI is a very useful library that allows you to easily use Neumorphism designs in SwiftUI.

DemoApp

DemoApp LightDemoApp Dark

Requirements

  • iOS 13.0+
  • Xcode 11+
  • Swift 5+

Installation

Swift Package Manager

Usage

Simple

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()
        }
    }
}

Simple View Light

let neumorphism = NeumorphismManager(
    isDark: true,
    lightColor: Color(hex: "C1D2EB"),
    darkColor: Color(hex: "2C292C")
)

let contentView = ContentView()
    .environmentObject(neumorphism)

Simple View Dark

NeumorphismConcave

Rectangle()
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .rectangle, color: nil)
    .frame(width: 256, height: 100)

RoundedRectangle(cornerRadius: 16)
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .roundedRectangle(cornerRadius: 16), color: nil)
    .frame(width: 256, height: 100)

Circle()
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .circle, color: nil)
    .frame(width: 150, height: 150)

Ellipse()
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .ellipse, color: nil)
    .frame(width: 300, height: 100)

Capsule(style: .circular)
    .fill(neumorphism.color)
    .neumorphismConcave(shapeType: .capsule, color: nil)
    .frame(width: 300, height: 100)

ConcaveViewList

NeumorphismButton

NeumorphismButton(
    shapeType: .roundedRectangle(cornerRadius: 20),
    normalImage: Image(systemName: "star"),
    selectedImage: Image(systemName: "star.fill")
)

Simple Use NeumorphismButton

NeumorphismSlider

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
                }
            }
        }
    }
}

NeumorphismSlider

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Apr 03 2024 02:15:30 GMT-0900 (Hawaii-Aleutian Daylight Time)