Files
purchases-ios/RevenueCatUI/Helpers/VersionDetector.swift
T
NachoSoto 2103b04762 Paywalls: added MIT license to all headers (#3084)
`Xcode` doesn't allow customizing the header (looks like maybe it worked
at some point but not anymore:
https://stackoverflow.com/questions/67614785/changing-the-default-header-comment-license-in-swift-package).

At least this adds the license to all the initial files in the package.
2023-09-14 18:28:11 -07:00

29 lines
833 B
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// VersionDetector.swift
//
// Created by Nacho Soto on 8/17/23.
import Foundation
enum VersionDetector {
static let iOS15: Bool = {
return Self.isAtLeast(version: 15) && !Self.isAtLeast(version: 16)
}()
private static func isAtLeast(version: Int) -> Bool {
return ProcessInfo.processInfo.isOperatingSystemAtLeast(.init(majorVersion: version,
minorVersion: 0,
patchVersion: 0))
}
}