diff --git a/SwiftFilePath.xcodeproj/project.pbxproj b/SwiftFilePath.xcodeproj/project.pbxproj index fa1a1a8..b34e595 100644 --- a/SwiftFilePath.xcodeproj/project.pbxproj +++ b/SwiftFilePath.xcodeproj/project.pbxproj @@ -371,24 +371,31 @@ TargetAttributes = { CC7832EB1A610124005E77C3 = { CreatedOnToolsVersion = 6.1; + LastSwiftMigration = 0800; }; CC7832F61A610125005E77C3 = { CreatedOnToolsVersion = 6.1; + LastSwiftMigration = 0800; }; D63BC3981C172BCD0071D0E2 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0800; }; D63BC3A11C172BCD0071D0E2 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0800; }; D63BC3B41C172C540071D0E2 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0800; }; D63BC3C11C172C740071D0E2 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0800; }; D63BC3CA1C172C740071D0E2 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0800; }; }; }; @@ -657,6 +664,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftFilePath; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -674,6 +682,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SwiftFilePath; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -692,6 +701,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -706,6 +716,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -725,6 +736,7 @@ PRODUCT_NAME = SwiftFilePath; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -747,6 +759,7 @@ PRODUCT_NAME = SwiftFilePath; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -762,6 +775,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.SwiftFilePath-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_VERSION = 2.3; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; @@ -777,6 +791,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.SwiftFilePath-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_VERSION = 2.3; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; @@ -798,6 +813,7 @@ PRODUCT_NAME = SwiftFilePath; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -821,6 +837,7 @@ PRODUCT_NAME = SwiftFilePath; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -845,6 +862,7 @@ PRODUCT_NAME = SwiftFilePath; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -868,6 +886,7 @@ PRODUCT_NAME = SwiftFilePath; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -884,6 +903,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.SwiftFilePath-MacTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -901,6 +921,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "me.nori0620.SwiftFilePath-MacTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -941,6 +962,7 @@ D63BC3AC1C172BCD0071D0E2 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; D63BC3AD1C172BCD0071D0E2 /* Build configuration list for PBXNativeTarget "SwiftFilePath-tvOS Tests" */ = { isa = XCConfigurationList; @@ -949,6 +971,7 @@ D63BC3AF1C172BCD0071D0E2 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; D63BC3BA1C172C540071D0E2 /* Build configuration list for PBXNativeTarget "SwiftFilePath-watchOS" */ = { isa = XCConfigurationList; @@ -957,6 +980,7 @@ D63BC3BC1C172C540071D0E2 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; D63BC3D31C172C740071D0E2 /* Build configuration list for PBXNativeTarget "SwiftFilePath-Mac" */ = { isa = XCConfigurationList; @@ -965,6 +989,7 @@ D63BC3D51C172C740071D0E2 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; D63BC3D61C172C740071D0E2 /* Build configuration list for PBXNativeTarget "SwiftFilePath-Mac Tests" */ = { isa = XCConfigurationList; @@ -973,6 +998,7 @@ D63BC3D81C172C740071D0E2 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/SwiftFilePath/PathExtensionDir.swift b/SwiftFilePath/PathExtensionDir.swift index 52dfb2e..ec05adc 100644 --- a/SwiftFilePath/PathExtensionDir.swift +++ b/SwiftFilePath/PathExtensionDir.swift @@ -72,7 +72,7 @@ extension Path: SequenceType { public func content(path_string:NSString) -> Path { return Path( NSURL(fileURLWithPath: self.path_string) - .URLByAppendingPathComponent( path_string as String ) + .URLByAppendingPathComponent( path_string as String )! .path! ) } @@ -102,7 +102,7 @@ extension Path: SequenceType { public func generate() -> AnyGenerator { assert(self.isDir,"To get iterator, path must be dir< \(path_string) >") let iterator = fileManager.enumeratorAtPath(path_string) - return anyGenerator() { + return AnyGenerator() { let optionalContent = iterator?.nextObject() as! String? if let content = optionalContent { return self.content(content) diff --git a/SwiftFilePathTests/SwiftFilePathTests.swift b/SwiftFilePathTests/SwiftFilePathTests.swift index d2bdfbf..aa01b19 100644 --- a/SwiftFilePathTests/SwiftFilePathTests.swift +++ b/SwiftFilePathTests/SwiftFilePathTests.swift @@ -257,8 +257,8 @@ class SwiftFilePathTests: XCTestCase { for content in sandboxDir { XCTAssertTrue(content.exists) - contentCount++ - if( content.isDir ){ dirCount++ } + contentCount += 1 + if( content.isDir ){ dirCount += 1 } } XCTAssertEqual( contentCount, 3) XCTAssertEqual( dirCount, 1) @@ -460,4 +460,4 @@ class SwiftFilePathTests: XCTestCase { } } -} \ No newline at end of file +}