-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOSAvailability.swift
97 lines (84 loc) · 2.19 KB
/
OSAvailability.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// OSAvailability.swift
// Steve Lee
// http://github.com/sangstevelee/OSAvailability
//
// Created by Steve Lee on 1/19/16.
//
//
import Foundation
/// A wrapper for Availability checks in Swift for Objective-C.
@objc class OSAvailability: NSObject {
/**
Function that checks for iOS 7 availability.
- returns: Return true if iOS version is equal to or greater than 7.0. false otherwise.
*/
static func iOS7() -> Bool {
if #available(iOS 7, *) {
return true
}
else {
return false
}
}
/**
Function that checks for iOS 8 availability.
- returns: Return true if iOS version is equal to or greater than 8.0. false otherwise.
*/
static func iOS8() -> Bool {
if #available(iOS 8, *) {
return true
}
else {
return false
}
}
/**
Function that checks for iOS 9 availability.
- returns: Return true if iOS version is equal to or greater than 9.0. false otherwise.
*/
static func iOS9() -> Bool {
if #available(iOS 9, *) {
return true
}
else {
return false
}
}
/**
Function that checks for tvOS 9 availability.
- returns: Return true if tvOS version is equal to or greater than 9.0. false otherwise.
*/
static func tvOS9_0() -> Bool {
if #available(tvOS 9.0, *) {
return true
}
else {
return false
}
}
/**
Function that checks for tvOS 9.1 availability.
- returns: Return true if iOS version is equal to or greater than 9.1. false otherwise.
*/
static func tvOS9_1() -> Bool {
if #available(tvOS 9.1, *) {
return true
}
else {
return false
}
}
/**
Function that checks for tvOS 9.2 availability.
- returns: Return true if iOS version is equal to or greater than 9.1. false otherwise.
*/
static func tvOS9_2() -> Bool {
if #available(tvOS 9.2, *) {
return true
}
else {
return false
}
}
}