You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[x] Add shadow easily from the **storyboard** and **programmatically**.
35
-
-[x] Add a gaussian blurred projection of your view (like iOS 10 music app).
36
-
-[x] Customize the border width and border color of any view from storyboard .
36
+
-[x] Add shadow easily from the **storyboard** and **programmatically**.
37
+
-[x] Add a gaussian blurred projection of your view (like iOS 10 music app).
38
+
-[x] Customize the border width and border color of any view from storyboard .
37
39
38
40
## Requirements
39
41
40
-
- iOS 9.0+
41
-
- Xcode 8
42
+
-iOS 9.0+
43
+
-Xcode 8
42
44
43
45
## Installation
44
46
45
-
46
47
#### CocoaPods
48
+
47
49
You can use [CocoaPods](http://cocoapods.org/) to install `ShadowView` by adding it to your `Podfile`:
48
50
49
51
```ruby
@@ -56,23 +58,44 @@ pod 'ShadowView'
56
58
end
57
59
```
58
60
61
+
#### Carthage
62
+
63
+
1. Install Carthage via Homebrew
64
+
65
+
```bash
66
+
$ brew update
67
+
$ brew install carthage
68
+
```
69
+
70
+
2. Add `github "PierrePerrin/ShadowView"` to your Cartfile.
71
+
72
+
3. Run `carthage update`.
73
+
74
+
4. Drag `ShadowView.framework` from the `Carthage/Build/iOS/` directory to the `Linked Frameworks and Libraries` section of your Xcode project’s `General` settings.
75
+
76
+
5. Add `$(SRCROOT)/Carthage/Build/iOS/ShadowView.framework` to `Input Files` of Run Script Phase for Carthage.
77
+
78
+
#### Manually
79
+
80
+
1. Download and drop all files in _ShadowView_ directory in your project.
81
+
2. Nice Job the best shadow library is now installed! 🎉 🎊 🎈
82
+
83
+
#### Import
84
+
59
85
To get the full benefits import `ShadowView` wherever you import UIKit
60
86
61
-
```swift
87
+
```swift
62
88
importUIKit
63
89
importShadowView
64
90
```
65
-
#### Manually
66
-
1. Download and drop all files in *ShadowView* directory in your project.
67
-
2. Nice Job the best shadow library is now installed! 🎉 🎊 🎈
68
91
69
92
## How it works
70
93
71
94
#### Normal Shadows
72
-
73
-
This shadow framework uses default CoreGraphics shadows by adding it the the layer of the view.
74
95
75
-
```swift
96
+
This shadow framework uses default CoreGraphics shadows by adding it the the layer of the view.
97
+
98
+
```swift
76
99
layer.shadowColor: CGColor
77
100
layer.shadowRadius: CGFloat
78
101
layer.shadowOffset: CGSize
@@ -88,49 +111,51 @@ The container takes a screen of all it's subviews and then apply blur on it.
88
111
89
112
## Usage example
90
113
91
-
### With Storyboard
114
+
### With Storyboard
115
+
116
+
#### Normal Shadows
92
117
93
-
#### Normal Shadows
118
+
Any view has new paramerters in the storyboar that you can change in order to add a customize shadow to your view.
94
119
95
-
Any view has new paramerters in the storyboar that you can change in order to add a customize shadow to your view.
120
+
#### Projected Gaussian Shadows
96
121
97
-
#### Projected Gaussian Shadows
98
122
Add an UIView to you ViewController, change it class to ShadowView and insert in it all view that needs a blurred shadow.
99
-
![][exampleSTR2-image]
123
+
![][examplestr2-image]
100
124
101
-
### Programmatically
125
+
### Programmatically
102
126
103
-
#### Normal Shadows
127
+
#### Normal Shadows
104
128
105
-
Set the shadows parameters to your view and it the shadow will appear! 🌟
129
+
Set the shadows parameters to your view and it the shadow will appear! 🌟
106
130
107
-
```swift
131
+
```swift
108
132
view.shadowRadius=5
109
133
view.shadowOffset= CGSize.zero
110
134
view.shadowColor= UIColor.black.cgColor
111
-
view.shadowOpacity=0.3
135
+
view.shadowOpacity=0.3
112
136
```
113
137
114
-
#### Projected Gaussian Shadows
138
+
#### Projected Gaussian Shadows
115
139
116
140
Create you container ShadowView and then add views that need Shadows inside of it.
117
-
```swift
141
+
142
+
```swift
118
143
let exampleShadowContainerView =ShadowView()
119
144
let imageView =UIImageView(image: #imageLiteral(resourceName: "sample.jpg"))
0 commit comments