From 36cee1c3f3f9081fe8210222a0fc6a5acea2ea71 Mon Sep 17 00:00:00 2001 From: Jason Luo Date: Wed, 9 May 2018 12:38:55 +0800 Subject: [PATCH] characters deprecated fix --- Spring/Misc.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Spring/Misc.swift b/Spring/Misc.swift index b2a27ce..902e7b3 100644 --- a/Spring/Misc.swift +++ b/Spring/Misc.swift @@ -23,7 +23,7 @@ import UIKit public extension String { - public var length: Int { return self.characters.count } + public var length: Int { return self.count } public func toURL() -> NSURL? { return NSURL(string: self) @@ -73,7 +73,7 @@ public extension UIColor { let scanner = Scanner(string: hex) var hexValue: CUnsignedLongLong = 0 if scanner.scanHexInt64(&hexValue) { - switch (hex.characters.count) { + switch (hex.count) { case 3: red = CGFloat((hexValue & 0xF00) >> 8) / 15.0 green = CGFloat((hexValue & 0x0F0) >> 4) / 15.0