Skip to content

Commit d1542eb

Browse files
committed
[Swift 4] Update Shortest Path (Unweighted)
1 parent 1eb05ba commit d1542eb

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Shortest Path (Unweighted)/ShortestPath.playground/Pages/Shortest path example.xcplaygroundpage/Contents.swift

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// last checked with Xcode 9.0b4
2+
#if swift(>=4.0)
3+
print("Hello, Swift 4!")
4+
#endif
5+
16
func breadthFirstSearchShortestPath(graph: Graph, source: Node) -> Graph {
27
let shortestPathGraph = graph.duplicate()
38

Shortest Path (Unweighted)/Tests/ShortestPathTests.swift

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import XCTest
22

33
class ShortestPathTests: XCTestCase {
4+
5+
func testSwift4() {
6+
// last checked with Xcode 9.0b4
7+
#if swift(>=4.0)
8+
print("Hello, Swift 4!")
9+
#endif
10+
}
411

512
func testShortestPathWhenGivenTree() {
613
let tree = Graph()

Shortest Path (Unweighted)/Tests/Tests.xcodeproj/project.pbxproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
ONLY_ACTIVE_ARCH = YES;
183183
SDKROOT = macosx;
184184
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
185+
SWIFT_VERSION = 4.0;
185186
};
186187
name = Debug;
187188
};
@@ -218,6 +219,7 @@
218219
MACOSX_DEPLOYMENT_TARGET = 10.11;
219220
MTL_ENABLE_DEBUG_INFO = NO;
220221
SDKROOT = macosx;
222+
SWIFT_VERSION = 4.0;
221223
};
222224
name = Release;
223225
};
@@ -231,7 +233,7 @@
231233
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
232234
PRODUCT_NAME = "$(TARGET_NAME)";
233235
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
234-
SWIFT_VERSION = 3.0;
236+
SWIFT_VERSION = 4.0;
235237
};
236238
name = Debug;
237239
};
@@ -244,7 +246,7 @@
244246
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
245247
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
246248
PRODUCT_NAME = "$(TARGET_NAME)";
247-
SWIFT_VERSION = 3.0;
249+
SWIFT_VERSION = 4.0;
248250
};
249251
name = Release;
250252
};

0 commit comments

Comments
 (0)