DeviceKit icon indicating copy to clipboard operation
DeviceKit copied to clipboard

Needs update for Xcode 7.1 Swift 2.1

Open MKGitHub opened this issue 11 years ago • 2 comments

Add: default: self = .Unspecified

Change To: let batteryLevel = Double(round(100.0 * (UIDevice.currentDevice().batteryLevel * 100.0)) / 100.0) // rounded, with 2 digits precision

MKGitHub avatar Oct 22 '15 15:10 MKGitHub

Hey :) Thanks! I've used a slightly different approach to make it compile, I've added a .TV case for the user interface idiom. So we get compiler errors if Apple adds new cases, if we used a default case those would silently misbehave. What do you think?

What is your experience with the battery level? I've just tried to get a value different from XX.0 but I'm unable ... even with your 100.0 ... I'm thinking about changing the Double to Int since it seems that it only returns integers (the UIDevice.currentDevice().batteryLevel returns only Doubles with 2 decimal places, e.g. 0.38 which is 38%). Please let me know what you experienced and think :) Thanks! 🙏

dennisweissmann avatar Nov 01 '15 17:11 dennisweissmann

Resolved by commit 99cee4c2ff4a699919e5f089bb79af2d3617a332.

dennisweissmann avatar Dec 22 '15 13:12 dennisweissmann