Skip to content

Commit 5c05759

Browse files
committed
Update README and delete DeviceIdentificator.podspec
1 parent 1527999 commit 5c05759

File tree

2 files changed

+18
-47
lines changed

2 files changed

+18
-47
lines changed

DeviceIdentificator.podspec

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,38 @@
88

99

1010
## Introduction
11-
UIDevice extension to fetch current device info such commercial name (iPhone X instead of iPhone10,3).
11+
Use `DeviceModel` to get some usefull information about some Apple devices (specially iPhones and iPads).
12+
13+
> Currently the Mac models available in this library correspond only to those that use Apple Silicon chips
1214
1315
## Platforms
14-
Support for iOS and tvOS
16+
Support for iOS, iPadOS, macOS and tvOS
1517

1618
## Support
1719
For Swift 4 please use v1
1820

1921
For Swift 5 please use v2+
2022

2123
## Installation
22-
This framework is compatible with Carthage or Cocoapods, use one of both.
23-
### Carthage
24-
Add this into your `Cartfile`:
25-
```ogdl
26-
github "sebastianvarela/DeviceIdentificator"
24+
### Swift Package Manager
25+
Add the package using Xcode or copy this into your `Package.swift` file:
26+
```swift
27+
.package(url: "https://github.com/sebastianvarela/DeviceIdentificator", from: "3.0.5")
2728
```
28-
### Cocoapods
29-
Add this into your `Podfile`:
30-
```ogdl
31-
pod 'DeviceIdentificator'
29+
30+
### Manually
31+
To install it manually, drag the DeviceIdentificator folder into your app project in Xcode. You can also add it as a git submodule by running the following command:
32+
```zsh
33+
$ git submodule add https://github.com/sebastianvarela/DeviceIdentificator.git
3234
```
3335

3436
## Usage
35-
Swift:
3637
```swift
37-
let deviceModel = UIDevice.current.deviceModel
38-
print("Current device: \(deviceModel.name)")
38+
import DeviceIdentificator
3939

40-
let isIpad = UIDevice.current.isIpad
41-
let isSimulator = UIDevice.current.isSimulator
42-
```
40+
let deviceModel = DeviceModel.current
41+
print("Current device: \(deviceModel.name)")
4342

44-
Objective-C:
45-
```objectivec
46-
NSString *deviceModelName = [UIDevice currentDevice].deviceModelName;
47-
NSLog(@"Current device: %@", [UIDevice currentDevice].deviceModelName);
48-
49-
BOOL isIpad = [UIDevice currentDevice].isIpad;
50-
BOOL isSimulator = [UIDevice currentDevice].isSimulator;
43+
let isIpad = deviceModel.isIpad
44+
let isSimulator = deviceModel.isSimulator
5145
```

0 commit comments

Comments
 (0)