1
1
# Device.swift
2
2
3
- [ ![ Language] [ lang-image ]] [ lang-url ]
4
- [ ![ License] [ license-image ]] [ license-url ]
5
3
[ ![ Platform] [ platform-image ]] [ cocoapod-url ]
6
- [ ![ Documentation] [ docs-image ]] [ docs-url ]
7
- [ ![ Pod Version] [ pod-version-image ]] [ cocoapod-url ]
8
- [ ![ Carthage Compatible] [ carthage-image ]] [ carthage-url ]
9
4
10
5
Super-lightweight library to detect used device
11
6
@@ -17,32 +12,21 @@ var deviceType: DeviceType
17
12
18
13
## Install
19
14
20
- ### Carthage
15
+ ### Swift Package Manager
21
16
22
- Add the following to your ` Cartfile ` and follow [ these instructions ] ( https://github.com/Carthage/Carthage#adding-frameworks-to-an-application )
17
+ Add the following to your ` Package.swift ` file:
23
18
24
- ``` bash
25
- github " schickling/Device.swift"
26
- ```
27
-
28
- ### CocoaPods
29
-
30
- To integrate ` Device ` into your project add the following to your ` Podfile ` :
31
-
32
- ``` ruby
33
- platform :ios , ' 8.0'
34
- use_frameworks!
35
-
36
- pod ' Device.swift'
19
+ ``` swift
20
+ dependencies: [
21
+ .package (url : " https://github.com/splitwise/device.swift" , from : " 1.2.3" )
22
+ ]
37
23
```
38
24
39
25
## Usage
40
26
41
27
``` swift
42
28
import Device
43
29
44
- // Use import Device_swift if you're using Cocoapods
45
-
46
30
let deviceType = UIDevice.current .deviceType
47
31
48
32
switch deviceType {
@@ -52,30 +36,4 @@ switch deviceType {
52
36
}
53
37
```
54
38
55
- ## How to make release
56
-
57
- - Update pod version in podspec
58
- - Add tag
59
- - Add validate pod ` pod trunk push Device.swift.podspec --allow-warnings `
60
- - Push to CocoaPods
61
- - Create release in github for with attached file for carthage
62
-
63
- ``` sh
64
- carthage build --no-skip-current
65
- carthage archive Device
66
- ```
67
-
68
- Also, check out our [ Documentation] [ docs-url ]
69
-
70
- [ carthage-image ] : https://img.shields.io/badge/Carthage-compatible-4BC51D.svg
71
- [ docs-image ] : https://img.shields.io/cocoapods/metrics/doc-percent/Device.swift.svg
72
- [ lang-image ] : https://img.shields.io/badge/swift-4.1-orange.svg
73
- [ license-image ] : https://img.shields.io/github/license/schickling/Device.swift.svg
74
39
[ platform-image ] : https://img.shields.io/cocoapods/p/Device.swift.svg
75
- [ pod-version-image ] : https://img.shields.io/cocoapods/v/Device.swift.svg
76
- [ carthage-url ] : https://github.com/Carthage/Carthage
77
- [ cocoapod-url ] : http://cocoapods.org/pods/Device.swift
78
- [ docs-url ] : http://cocoadocs.org/docsets/Device.swift
79
- [ homepage-url ] : https://github.com/schickling/Device.swift.svg
80
- [ lang-url ] : https://swift.org/
81
- [ license-url ] : LICENSE
0 commit comments