From e63a9303929c478f4d0bf3ef8d943a98d74a3de4 Mon Sep 17 00:00:00 2001 From: 3vangelos Date: Mon, 11 Jun 2018 14:45:31 +0200 Subject: [PATCH] fixed characters deprecation warnings --- MapKitGoogleStyler/Classes/GoogleStyle.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MapKitGoogleStyler/Classes/GoogleStyle.swift b/MapKitGoogleStyler/Classes/GoogleStyle.swift index ca9877c..89f2c40 100644 --- a/MapKitGoogleStyler/Classes/GoogleStyle.swift +++ b/MapKitGoogleStyler/Classes/GoogleStyle.swift @@ -44,7 +44,7 @@ public struct GoogleStyle { style.append("undefined") } if let elementType = self.elementType { - if style.characters.last != "|" && style.characters.last != "," { + if style.last != "|" && style.last != "," { style.append("|") } style.append("s.e:") @@ -54,14 +54,14 @@ public struct GoogleStyle { for styler in stylers { for (key, value) in styler { if let stylerType = StylerType(rawValue: key) { - if style.characters.last != "|" && style.characters.last != "," { + if style.last != "|" && style.last != "," { style.append("|") } if key == "color" { if let color = value as? String { - if color.characters.count == 7 { + if color.count == 7 { style.append("\(stylerType.convertedValue):#ff\(color.replacingOccurrences(of: "#", with: ""))") - } else if color.characters.count != 9 { + } else if color.count != 9 { print("Malformed color") } else { style.append("\(stylerType.convertedValue):\(value)")