From f77cfdd97422175238a92e71073cd9b0e06d4d99 Mon Sep 17 00:00:00 2001 From: Deepesh Date: Fri, 28 Dec 2018 20:41:03 +0000 Subject: [PATCH 1/2] Fixing Build issues with Xcode 10.1 and swift 4.2 Fixing warnings on module import to use canonical name , added a underscore to name --- Foo/Foo.xcodeproj/project.pbxproj | 2 ++ Foo/Foo/Bar.swift | 14 ++++++-------- Foo/Foo/Foo.private.modulemap | 2 +- Foo/Foo/FooPrivate/module.modulemap | 2 +- MyApp/ViewController.swift | 2 -- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Foo/Foo.xcodeproj/project.pbxproj b/Foo/Foo.xcodeproj/project.pbxproj index 2765460..14182a4 100644 --- a/Foo/Foo.xcodeproj/project.pbxproj +++ b/Foo/Foo.xcodeproj/project.pbxproj @@ -312,6 +312,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -351,6 +352,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Foo/Foo/Bar.swift b/Foo/Foo/Bar.swift index 10ca4fa..801ebc7 100644 --- a/Foo/Foo/Bar.swift +++ b/Foo/Foo/Bar.swift @@ -7,23 +7,21 @@ // import UIKit -import FooPrivate +import Foo_Private - -@objc(Bar) -public class Bar: NSObject { +@objc public class Bar: NSObject { - public func doSomething() { + @objc public func doSomething() { // We can access Baz, which is public: let b = Baz() - println("\(b)") + print("\(b)") // We can also access Norf, even though it is not public: let n = Norf() - println("\(n)") + print("\(n)") let q = Qux() - println("\(q)") + print("\(q)") } } diff --git a/Foo/Foo/Foo.private.modulemap b/Foo/Foo/Foo.private.modulemap index 76b1d60..6e60e5f 100644 --- a/Foo/Foo/Foo.private.modulemap +++ b/Foo/Foo/Foo.private.modulemap @@ -1,3 +1,3 @@ -module FooPrivate { +module Foo_Private { export * } diff --git a/Foo/Foo/FooPrivate/module.modulemap b/Foo/Foo/FooPrivate/module.modulemap index bb165f1..9e4eadb 100644 --- a/Foo/Foo/FooPrivate/module.modulemap +++ b/Foo/Foo/FooPrivate/module.modulemap @@ -4,7 +4,7 @@ This file lives inside a folder, and that folder is the actual module. In Xcode the SWIFT_INCLUDE_PATHS needs to include the partent directory to that folder. */ -module FooPrivate { +module Foo_Private { header "../Norf.h" export * } diff --git a/MyApp/ViewController.swift b/MyApp/ViewController.swift index 19ec861..04b6b2e 100644 --- a/MyApp/ViewController.swift +++ b/MyApp/ViewController.swift @@ -9,8 +9,6 @@ import UIKit import Foo - - class ViewController: UIViewController { override func viewDidLoad() { From 17e02a745ddc2d50fa6ebb2a8fccceb7a885afa4 Mon Sep 17 00:00:00 2001 From: Deepesh Date: Fri, 28 Dec 2018 20:50:50 +0000 Subject: [PATCH 2/2] Fixing Build issues on test target with swift 4.2 --- Foo/FooTests/FooTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foo/FooTests/FooTests.swift b/Foo/FooTests/FooTests.swift index a23d5a3..7b427bf 100644 --- a/Foo/FooTests/FooTests.swift +++ b/Foo/FooTests/FooTests.swift @@ -28,7 +28,7 @@ class FooTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock() { + self.measure() { // Put the code you want to measure the time of here. } }