Commit 909c99d2 by Daniel Dahan

development: updated for Xcode 8.3

parent 5e81df5a
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.6.0' s.version = '2.6.1'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'An animation and graphics framework for Material Design in Swift.' s.summary = 'An animation and graphics framework for Material Design in Swift.'
s.homepage = 'http://materialswift.com' s.homepage = 'http://materialswift.com'
......
...@@ -504,6 +504,7 @@ ...@@ -504,6 +504,7 @@
96BCB7571CB40DC500C806FE /* iOS */ = { 96BCB7571CB40DC500C806FE /* iOS */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96EF418E1E835E850012CA1C /* Animation */,
961E6BDD1DDA2A7E004E6C93 /* Application */, 961E6BDD1DDA2A7E004E6C93 /* Application */,
96264BE41D833C8400576F37 /* Bar */, 96264BE41D833C8400576F37 /* Bar */,
962DDD081D6FBBD0001C307C /* BottomTabBar */, 962DDD081D6FBBD0001C307C /* BottomTabBar */,
...@@ -665,8 +666,6 @@ ...@@ -665,8 +666,6 @@
children = ( children = (
96BFC1671E61D9FD0075DE1F /* Material+Motion.swift */, 96BFC1671E61D9FD0075DE1F /* Material+Motion.swift */,
96BFC1691E61DAA10075DE1F /* Material+MotionAnimation.swift */, 96BFC1691E61DAA10075DE1F /* Material+MotionAnimation.swift */,
96BCB7821CB40DC500C806FE /* PulseAnimation.swift */,
965532281E47E388005C2792 /* SpringAnimation.swift */,
); );
name = Motion; name = Motion;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -734,6 +733,15 @@ ...@@ -734,6 +733,15 @@
path = Sources; path = Sources;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96EF418E1E835E850012CA1C /* Animation */ = {
isa = PBXGroup;
children = (
96BCB7821CB40DC500C806FE /* PulseAnimation.swift */,
965532281E47E388005C2792 /* SpringAnimation.swift */,
);
name = Animation;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */ /* Begin PBXHeadersBuildPhase section */
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0820" LastUpgradeVersion = "0830"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.6.0</string> <string>2.6.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -97,7 +97,7 @@ private class FontLoader { ...@@ -97,7 +97,7 @@ private class FontLoader {
if !CTFontManagerRegisterGraphicsFont(font, &error) { if !CTFontManagerRegisterGraphicsFont(font, &error) {
let errorDescription = CFErrorCopyDescription(error!.takeUnretainedValue()) let errorDescription = CFErrorCopyDescription(error!.takeUnretainedValue())
let nsError = error!.takeUnretainedValue() as Any as! Error let nsError = error!.takeUnretainedValue() as Any as! Error
NSException(name: .internalInconsistencyException, reason: errorDescription as? String, userInfo: [NSUnderlyingErrorKey: nsError as Any]).raise() NSException(name: .internalInconsistencyException, reason: errorDescription as String?, userInfo: [NSUnderlyingErrorKey: nsError as Any]).raise()
} }
} }
} }
......
...@@ -44,7 +44,7 @@ extension Array where Element: Equatable { ...@@ -44,7 +44,7 @@ extension Array where Element: Equatable {
} }
guard -1 < start else { guard -1 < start else {
fatalError("Range out of bounds for \(start) - \(end), should be 0 - \(count).") fatalError("Range out of bounds for \(start) - \(end ?? 0), should be 0 - \(count).")
} }
var diff = abs(e - start) var diff = abs(e - start)
......
...@@ -374,10 +374,10 @@ extension UIView { ...@@ -374,10 +374,10 @@ extension UIView {
/// Computes the rotation of the view. /// Computes the rotation of the view.
open var motionRotationAngle: CGFloat { open var motionRotationAngle: CGFloat {
get { get {
return CGFloat(atan2f(Float(transform.b), Float(transform.a))) * 180 / CGFloat(M_PI) return CGFloat(atan2f(Float(transform.b), Float(transform.a))) * 180 / CGFloat(Double.pi)
} }
set(value) { set(value) {
transform = CGAffineTransform(rotationAngle: CGFloat(M_PI) * value / 180) transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi) * value / 180)
} }
} }
...@@ -506,7 +506,7 @@ extension Motion { ...@@ -506,7 +506,7 @@ extension Motion {
*/ */
public static func rotation(angle: CGFloat) -> CABasicAnimation { public static func rotation(angle: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotation) let animation = CABasicAnimation(keyPath: .rotation)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * angle / 180)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * angle / 180))
return animation return animation
} }
...@@ -517,7 +517,7 @@ extension Motion { ...@@ -517,7 +517,7 @@ extension Motion {
*/ */
public static func rotationX(angle: CGFloat) -> CABasicAnimation { public static func rotationX(angle: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotationX) let animation = CABasicAnimation(keyPath: .rotationX)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * angle / 180)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * angle / 180))
return animation return animation
} }
...@@ -528,7 +528,7 @@ extension Motion { ...@@ -528,7 +528,7 @@ extension Motion {
*/ */
public static func rotationY(angle: CGFloat) -> CABasicAnimation { public static func rotationY(angle: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotationY) let animation = CABasicAnimation(keyPath: .rotationY)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * angle / 180)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * angle / 180))
return animation return animation
} }
...@@ -539,7 +539,7 @@ extension Motion { ...@@ -539,7 +539,7 @@ extension Motion {
*/ */
public static func rotationZ(angle: CGFloat) -> CABasicAnimation { public static func rotationZ(angle: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotationZ) let animation = CABasicAnimation(keyPath: .rotationZ)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * angle / 180)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * angle / 180))
return animation return animation
} }
...@@ -550,7 +550,7 @@ extension Motion { ...@@ -550,7 +550,7 @@ extension Motion {
*/ */
public static func spin(rotations: CGFloat) -> CABasicAnimation { public static func spin(rotations: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotation) let animation = CABasicAnimation(keyPath: .rotation)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * 2 * rotations)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * 2 * rotations))
return animation return animation
} }
...@@ -561,7 +561,7 @@ extension Motion { ...@@ -561,7 +561,7 @@ extension Motion {
*/ */
public static func spinX(rotations: CGFloat) -> CABasicAnimation { public static func spinX(rotations: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotationX) let animation = CABasicAnimation(keyPath: .rotationX)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * 2 * rotations)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * 2 * rotations))
return animation return animation
} }
...@@ -572,7 +572,7 @@ extension Motion { ...@@ -572,7 +572,7 @@ extension Motion {
*/ */
public static func spinY(rotations: CGFloat) -> CABasicAnimation { public static func spinY(rotations: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotationY) let animation = CABasicAnimation(keyPath: .rotationY)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * 2 * rotations)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * 2 * rotations))
return animation return animation
} }
...@@ -583,7 +583,7 @@ extension Motion { ...@@ -583,7 +583,7 @@ extension Motion {
*/ */
public static func spinZ(rotations: CGFloat) -> CABasicAnimation { public static func spinZ(rotations: CGFloat) -> CABasicAnimation {
let animation = CABasicAnimation(keyPath: .rotationZ) let animation = CABasicAnimation(keyPath: .rotationZ)
animation.toValue = NSNumber(value: Double(CGFloat(M_PI) * 2 * rotations)) animation.toValue = NSNumber(value: Double(CGFloat(Double.pi) * 2 * rotations))
return animation return animation
} }
......
...@@ -39,7 +39,7 @@ extension UIFont { ...@@ -39,7 +39,7 @@ extension UIFont {
- Returns a CGSize. - Returns a CGSize.
*/ */
open func stringSize(string: String, constrainedTo width: CGFloat) -> CGSize { open func stringSize(string: String, constrainedTo width: CGFloat) -> CGSize {
return string.boundingRect(with: CGSize(width: width, height: CGFloat(DBL_MAX)), return string.boundingRect(with: CGSize(width: width, height: CGFloat(Double.greatestFiniteMagnitude)),
options: NSStringDrawingOptions.usesLineFragmentOrigin, options: NSStringDrawingOptions.usesLineFragmentOrigin,
attributes: [NSFontAttributeName: self], attributes: [NSFontAttributeName: self],
context: nil).size context: nil).size
......
...@@ -227,13 +227,13 @@ extension UIImage { ...@@ -227,13 +227,13 @@ extension UIImage {
switch imageOrientation { switch imageOrientation {
case .down, .downMirrored: case .down, .downMirrored:
transform = transform.translatedBy(x: size.width, y: size.height) transform = transform.translatedBy(x: size.width, y: size.height)
transform = transform.rotated(by: CGFloat(M_PI)) transform = transform.rotated(by: CGFloat(Double.pi))
case .left, .leftMirrored: case .left, .leftMirrored:
transform = transform.translatedBy(x: size.width, y: 0) transform = transform.translatedBy(x: size.width, y: 0)
transform = transform.rotated(by: CGFloat(M_PI_2)) transform = transform.rotated(by: CGFloat(Double.pi / 2))
case .right, .rightMirrored: case .right, .rightMirrored:
transform = transform.translatedBy(x: 0, y: size.height) transform = transform.translatedBy(x: 0, y: size.height)
transform = transform.rotated(by: -CGFloat(M_PI_2)) transform = transform.rotated(by: -CGFloat(Double.pi / 2))
default:break default:break
} }
...@@ -296,8 +296,8 @@ extension UIImage { ...@@ -296,8 +296,8 @@ extension UIImage {
let screenScale = Screen.scale let screenScale = Screen.scale
let imageRect = CGRect(origin: .zero, size: size) let imageRect = CGRect(origin: .zero, size: size)
let hasBlur = radius > CGFloat(FLT_EPSILON) let hasBlur = radius > CGFloat(Float.ulpOfOne)
let hasSaturationChange = fabs(saturationDeltaFactor - 1.0) > CGFloat(FLT_EPSILON) let hasSaturationChange = fabs(saturationDeltaFactor - 1.0) > CGFloat(Float.ulpOfOne)
if hasBlur || hasSaturationChange { if hasBlur || hasSaturationChange {
UIGraphicsBeginImageContextWithOptions(size, false, screenScale) UIGraphicsBeginImageContextWithOptions(size, false, screenScale)
...@@ -315,7 +315,7 @@ extension UIImage { ...@@ -315,7 +315,7 @@ extension UIImage {
var outBuffer = createEffectBuffer(context: outContext) var outBuffer = createEffectBuffer(context: outContext)
if hasBlur { if hasBlur {
let a = sqrt(2 * M_PI) let a = sqrt(2 * .pi)
let b = CGFloat(a) / 4 let b = CGFloat(a) / 4
let c = radius * screenScale let c = radius * screenScale
let d = c * 3.0 * b let d = c * 3.0 * b
......
/* /*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>. * Copyright (C) 2015 - 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment