Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdrone committed Mar 7, 2020
1 parent 6f146a7 commit 31b77b3
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
**Neumorphic** shadow example:

```swift

let view = SurfaceView()
view.frame = ...
view.layer.cornerRadius = ...
Expand All @@ -15,3 +14,25 @@ addSubview(view)
The cast shadows moves accordingly to the device horizontal axis.

<img src="docs_/button.gif" width=140 alt="screen" />


**Convex/Concave** shadow example:


```swift
view.backgroundColor = systemBackground()
let surface = SurfaceView()
surface.frame = CGRect(x: 100, y: 100, width: 96, height: 32)
surface.layer.cornerRadius = 16
surface.surfaceLayer.shadow = Shadow(preset: .concave2)
view.addSubview(surface)

let button = SurfaceView()
button.frame = CGRect(x: 0, y: 0, width: 48, height: 32)
button.layer.cornerRadius = 16
button.surfaceLayer.shadow = Shadow(preset: .convex1)
button.backgroundColor = .white
surface.addSubview(button)
```

<img src="docs_/switch.gif" width=140 alt="screen" />

0 comments on commit 31b77b3

Please sign in to comment.