Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

Commit

Permalink
Updates for Xcode 8.1 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
danthorpe authored Oct 30, 2016
1 parent 5c4f845 commit 56e4a6d
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 9 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
6 changes: 3 additions & 3 deletions Sources/ValueCoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public extension ValueCoding where Coder: NSCoding, Coder.Value == Self {
be of `Coder` type.
- returns: an optional `Self`
*/
static func decode(_ object: AnyObject?) -> Self? {
static func decode(_ object: Any?) -> Self? {
return (object as? Coder)?.value
}

Expand All @@ -89,7 +89,7 @@ public extension ValueCoding where Coder: NSCoding, Coder.Value == Self {
- parameter objects: a `SequenceType` of `AnyObject`.
- returns: the array of values which were able to be unarchived.
*/
static func decode<S: Sequence>(_ objects: S?) -> [Self] where S.Iterator.Element: AnyObject {
static func decode<S: Sequence>(_ objects: S?) -> [Self] where S.Iterator.Element: Any {
return objects?.flatMap(Self.decode) ?? []
}

Expand All @@ -99,7 +99,7 @@ public extension ValueCoding where Coder: NSCoding, Coder.Value == Self {
- parameter objects: a `SequenceType` of `SequenceType` of `AnyObject`.
- returns: the array of arrays of values which were able to be unarchived.
*/
static func decode<S: Sequence>(_ objects: S?) -> [[Self]] where S.Iterator.Element: Sequence, S.Iterator.Element.Iterator.Element: AnyObject {
static func decode<S: Sequence>(_ objects: S?) -> [[Self]] where S.Iterator.Element: Sequence, S.Iterator.Element.Iterator.Element: Any {
return objects?.flatMap(Self.decode) ?? []
}

Expand Down
1 change: 1 addition & 0 deletions Supporting Files/ValueCoding.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ LD_RUNPATH_SEARCH_PATHS_framework = @executable_path/../Frameworks @loader_path/
LD_RUNPATH_SEARCH_PATHS_xctest = @loader_path/Frameworks @executable_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks
LD_RUNPATH_SEARCH_PATHS = $(LD_RUNPATH_SEARCH_PATHS_$(WRAPPER_EXTENSION))

#include "Warnings.xcconfig"
27 changes: 27 additions & 0 deletions Supporting Files/Warnings.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// ValueCoding
//
// Copyright © 2016 ProcedureKit. All rights reserved.
//

CLANG_WARN_DOCUMENTATION_COMMENTS = YES
CLANG_WARN_BOOL_CONVERSION = YES
CLANG_WARN_CONSTANT_CONVERSION = YES
CLANG_WARN_EMPTY_BODY = YES
CLANG_WARN_ENUM_CONVERSION = YES
CLANG_WARN_INFINITE_RECURSION = YES
CLANG_WARN_INT_CONVERSION = YES
CLANG_WARN_SUSPICIOUS_MOVE = YES
CLANG_WARN_UNREACHABLE_CODE = YES
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
ENABLE_STRICT_OBJC_MSGSEND = YES
ENABLE_TESTABILITY = YES
GCC_NO_COMMON_BLOCKS = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR
GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_VARIABLE = YES
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR
CLANG_ANALYZER_NONNULL = YES
4 changes: 2 additions & 2 deletions Tests/ValueCodingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class ValueCodingTests: XCTestCase {
}

func test__multiple_archiving() {
let unarchived = Foo.decode(items.encoded)
let unarchived: [Foo] = Foo.decode(items.encoded)
XCTAssertEqual(unarchived, items)
}

func test__nested_archiving() {
let unarchived = Foo.decode(nested.encoded)
let unarchived: [[Foo]] = Foo.decode(nested.encoded)
XCTAssertEqual(unarchived.count, 1)
XCTAssertEqual(unarchived[0], nested[0])
}
Expand Down
17 changes: 14 additions & 3 deletions ValueCoding.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/* Begin PBXFileReference section */
658A7B5C1D776B7600F897C8 /* ValueCoding.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ValueCoding.framework; sourceTree = BUILT_PRODUCTS_DIR; };
658A7B651D776B7600F897C8 /* ValueCodingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ValueCodingTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
65A3B8821DC659FE0042BB95 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
65CF6F511D776BBC004B3503 /* ValueCoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueCoding.swift; sourceTree = "<group>"; };
65CF6F531D776BBC004B3503 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
65CF6F541D776BBC004B3503 /* ValueCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueCoding.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -60,8 +61,7 @@
children = (
65CF6F501D776BBC004B3503 /* Sources */,
65CF6F5A1D77744D004B3503 /* Tests */,
65CF6F521D776BBC004B3503 /* Supporting Files */,
658A7B5D1D776B7600F897C8 /* Products */,
65A3B8811DC659EA0042BB95 /* ... */,
);
sourceTree = "<group>";
};
Expand All @@ -74,6 +74,15 @@
name = Products;
sourceTree = "<group>";
};
65A3B8811DC659EA0042BB95 /* ... */ = {
isa = PBXGroup;
children = (
65CF6F521D776BBC004B3503 /* Supporting Files */,
658A7B5D1D776B7600F897C8 /* Products */,
);
name = ...;
sourceTree = "<group>";
};
65CF6F501D776BBC004B3503 /* Sources */ = {
isa = PBXGroup;
children = (
Expand All @@ -89,6 +98,7 @@
65CF6F531D776BBC004B3503 /* Info.plist */,
65CF6F591D77704D004B3503 /* ValueCoding.xcconfig */,
65CF6F581D776BD5004B3503 /* Version.xcconfig */,
65A3B8821DC659FE0042BB95 /* Warnings.xcconfig */,
);
path = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -159,7 +169,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0810;
TargetAttributes = {
658A7B5B1D776B7600F897C8 = {
CreatedOnToolsVersion = 8.0;
Expand Down Expand Up @@ -241,6 +251,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 65CF6F591D77704D004B3503 /* ValueCoding.xcconfig */;
buildSettings = {
ONLY_ACTIVE_ARCH = YES;
};
name = Debug;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 56e4a6d

Please sign in to comment.