Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #15 #16

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions Version/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public struct Version {
}
}

public init!(_ value: Version) {
do {
self = try value
} catch let error {
print("Error: Failed to set version '\(value)': \(error)")
return nil
}
}

/// Canonicalize version by replacing nil components with their defaults
public mutating func canonicalize() {
self.minor = self.minor ?? 0
Expand Down Expand Up @@ -248,7 +257,6 @@ extension NSBundle {

extension NSProcessInfo {
/// The version of the operating system on which the process is executing.
@available(OSX, introduced=10.10)
@available(iOS, introduced=8.0)
public var operationSystemVersion: Version {
let version : NSOperatingSystemVersion = self.operatingSystemVersion
Expand All @@ -269,7 +277,7 @@ extension NSProcessInfo {
extension UIDevice {
/// The current version of the operating system.
public func systemVersion() -> Version? {
return Version(self.systemVersion())
return Version(self.systemVersion()!) //Is it recursive?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it shouldn't be. UIDevice defines a property systemVersion. I think this needs to be updated so it uses the String property instead.

}
}

Expand Down