From ee478608965971c2ad1568c2c5397e0e50ddd9ec Mon Sep 17 00:00:00 2001 From: islamovic Date: Sun, 29 Oct 2017 14:00:39 +0200 Subject: [PATCH] update to swift 4 --- Format.xcodeproj/project.pbxproj | 4 ++-- Format/NumberFormatter.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Format.xcodeproj/project.pbxproj b/Format.xcodeproj/project.pbxproj index 23cd5a5..be00b1b 100644 --- a/Format.xcodeproj/project.pbxproj +++ b/Format.xcodeproj/project.pbxproj @@ -421,7 +421,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -441,7 +441,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Format; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Format/NumberFormatter.swift b/Format/NumberFormatter.swift index 87bd8b7..ed7a38d 100644 --- a/Format/NumberFormatter.swift +++ b/Format/NumberFormatter.swift @@ -90,7 +90,7 @@ open class NumberFormat { } else if formatter.modifier == NumberFormatterSpellOutKey { formattedString = nsFormatter.string(from: number) } else if formatter.modifier == NumberFormatterDistanceKey { - let distance = number as CLLocationDistance + let distance = number as! CLLocationDistance formattedString = distanceFormatter.string(fromDistance: distance) } }