From affc99654dc9b696271c811152b030c1d18c924d Mon Sep 17 00:00:00 2001 From: "Davis, Caley" Date: Wed, 10 Jan 2018 10:53:46 -0800 Subject: [PATCH 1/3] update for Swift 4 and XCode 9 compatibility --- GildedRose.xcodeproj/project.pbxproj | 6 ++++++ GildedRose/GildedRose.swift | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/GildedRose.xcodeproj/project.pbxproj b/GildedRose.xcodeproj/project.pbxproj index bcf3940..fbe7e5a 100644 --- a/GildedRose.xcodeproj/project.pbxproj +++ b/GildedRose.xcodeproj/project.pbxproj @@ -321,6 +321,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -340,6 +341,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.tomheinan.GildedRose; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -351,6 +353,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.tomheinan.GildedRoseTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -362,6 +365,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.tomheinan.GildedRoseTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -384,6 +388,7 @@ E2F4C3211B956316003632EA /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; E2F4C3221B956316003632EA /* Build configuration list for PBXNativeTarget "GildedRoseTests" */ = { isa = XCConfigurationList; @@ -392,6 +397,7 @@ E2F4C3241B956316003632EA /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/GildedRose/GildedRose.swift b/GildedRose/GildedRose.swift index bbd571f..d38ded9 100644 --- a/GildedRose/GildedRose.swift +++ b/GildedRose/GildedRose.swift @@ -8,7 +8,7 @@ public class GildedRose { - public static func updateQuality(items: Array) -> [Item] { + public static func updateQuality(_ items: [Item]) -> [Item] { var items = items for i in 0 ..< items.count { if items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert" { From 15670b77a73cf76a69d5303327c8c9f6bcde95cb Mon Sep 17 00:00:00 2001 From: Caley Davis Date: Wed, 10 Jan 2018 11:10:13 -0800 Subject: [PATCH 2/3] update for Xcode 9/Swift 4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2724076..9cd0700 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ cd gilded-rose-swift open GildedRose.xcodeproj/ ``` -The master branch contains the starting point for the exercise. You'll need Xcode 7 to run the tests (and you can run them with the **⌘U** shortcut by default). +The master branch contains the starting point for the exercise. You'll need Xcode 9 to run the tests (and you can run them with the **⌘U** shortcut by default). ## Original Text From 5a8def09cc95201c36a97fb618743396fb573304 Mon Sep 17 00:00:00 2001 From: "Davis, Caley" Date: Wed, 10 Jan 2018 11:39:24 -0800 Subject: [PATCH 3/3] Add readme to project so its visible in xcode --- GildedRose.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GildedRose.xcodeproj/project.pbxproj b/GildedRose.xcodeproj/project.pbxproj index fbe7e5a..e8957ac 100644 --- a/GildedRose.xcodeproj/project.pbxproj +++ b/GildedRose.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 177585EB20069D7C0057D202 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; E2F4C30B1B956315003632EA /* GildedRose.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GildedRose.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E2F4C3101B956315003632EA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E2F4C3151B956316003632EA /* GildedRoseTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GildedRoseTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -55,6 +56,7 @@ E2F4C3011B956315003632EA = { isa = PBXGroup; children = ( + 177585EB20069D7C0057D202 /* README.md */, E2F4C30D1B956315003632EA /* GildedRose */, E2F4C3191B956316003632EA /* GildedRoseTests */, E2F4C30C1B956315003632EA /* Products */,