Skip to content

Commit e31d341

Browse files
committed
Support Swift 4.1 on Xcode 9.3
1 parent 6e87571 commit e31d341

File tree

239 files changed

+6999
-1423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+6999
-1423
lines changed

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "Quick/Nimble" "v7.0.2"
2-
github "Quick/Quick" "v1.2.0"
1+
github "Quick/Nimble" "v7.3.1"
2+
github "Quick/Quick" "v1.3.2"

Carthage/Checkouts/Nimble/.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ Nimble.framework.zip
1111
#
1212
# Add this line if you want to avoid checking in source code from Carthage dependencies.
1313
# Carthage/Checkouts
14-
14+
Carthage/Checkouts/**/*.*
15+
Carthage/Checkouts/**/Cart*
16+
Carthage/Checkouts/**/Tests
17+
!Carthage/Checkouts/**/LICENSE.*
18+
!Carthage/Checkouts/**/*.md
19+
!Carthage/Checkouts/**/*.swift
20+
!Carthage/Checkouts/**/*.h
21+
!Carthage/Checkouts/**/*.m
22+
!Carthage/Checkouts/**/*.c
1523
Carthage/Build
1624

1725
# Swift Package Manager

Carthage/Checkouts/Nimble/.swiftlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ included:
99
- Tests
1010

1111
excluded:
12-
- Sources/Lib
12+
- Carthage/Checkouts
1313

1414
trailing_comma:
1515
mandatory_comma: true

Carthage/Checkouts/Nimble/.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ matrix:
1414
- os: osx
1515
env: TYPE=macos
1616
osx_image: xcode9
17+
- os: osx
18+
env: TYPE=macos
19+
osx_image: xcode9.1
20+
- os: osx
21+
env: TYPE=macos
22+
osx_image: xcode9.2
23+
- os: osx
24+
env: TYPE=macos
25+
osx_image: xcode9.3
26+
- os: osx
27+
env: TYPE=macos
28+
osx_image: xcode9.4
1729
- os: osx
1830
env: TYPE=swiftpm
1931
- os: osx
@@ -25,6 +37,14 @@ matrix:
2537
env: TYPE=swiftpm
2638
install:
2739
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
40+
- os: linux
41+
dist: trusty
42+
sudo: required
43+
env:
44+
- TYPE=swiftpm
45+
- SWIFT_VERSION=4.0.2
46+
install:
47+
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
2848
install:
2949
- if [[ "$TYPE" == "podspec" ]]; then sudo gem install bundler; bundle install; fi
3050
script:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "mattgallagher/CwlPreconditionTesting" "1e62a726d54c743f4585233f08fcaac7307319b5"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github "mattgallagher/CwlCatchException" "b14c111e9b33cd142bd4bc75c482cfd5c3490923"
2+
github "mattgallagher/CwlPreconditionTesting" "1e62a726d54c743f4585233f08fcaac7307319b5"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright © 2017 Matt Gallagher ( http://cocoawithlove.com ). All rights reserved.
2+
3+
Permission to use, copy, modify, and/or distribute this software for any
4+
purpose with or without fee is hereby granted, provided that the above
5+
copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10+
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
13+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "CwlCatchException",
5+
targets: [
6+
Target(name: "CwlCatchException", dependencies: ["CwlCatchExceptionSupport"]),
7+
Target(name: "CwlCatchExceptionSupport")
8+
]
9+
)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CwlCatchException
2+
A simple Swift wrapper around an Objective-C `@try`/`@catch` statement that selectively catches Objective-C exceptions by `NSException` subtype, rethrowing if any caught exception is not the expected subtype.
3+
4+
Look at [CwlCatchExceptionTests.swift](https://github.com/mattgallagher/CwlCatchException/blob/master/CwlCatchExceptionTests/CwlCatchExceptionTests.swift?ts=4) for syntax.
5+
6+
## Adding to your project
7+
8+
This project can be used by direct inclusion in your projects or through any of the Swift Package Manager, CocoaPods or Carthage.
9+
10+
Minimum requirements are iOS 8 or macOS 10.9.
11+
12+
### Manual inclusion
13+
14+
1. In a subdirectory of your project's directory, run `git clone https://github.com/mattgallagher/CwlCatchException.git`
15+
2. Drag the "CwlCatchException.xcodeproj" file from the Finder into your own project's file tree in Xcode
16+
3. Add the "CwlCatchException.framework" from the "Products" folder of the CwlCatchException project's file tree to the "Copy Files (Frameworks)" build phases of any target that you want to include this module.
17+
18+
That third step is a little tricky if you're unfamiliar with Xcode but it involves:
19+
20+
a. click on your project in the file tree
21+
b. click on the target to whih you want to add this module
22+
c. select the "Build Phases" tab
23+
d. if you don't already have a "Copy File" build phase with a "Destination: Frameworks", add one using the "+" button in the top left of the tab
24+
e. click the "+" within the "Copy File (Frameworks)" phase and from the list that appears, select the "CwlCatchException.framework" (if there are multiple frameworks with the same name, look for the one that appears *above* the corresponding macOS or iOS CwlCatchException testing target).
25+
26+
### Swift Package Manager
27+
28+
Add the following to the `dependencies` array in your "Package.swift" file:
29+
30+
.Package(url: "https://github.com/mattgallagher/CwlCatchException.git", majorVersion: 1),
31+
32+
Or, if you're using the `swift-tools-version:4.0` package manager, add the following to the `dependencies` array in your "Package.swift" file:
33+
34+
.package(url: "https://github.com/mattgallagher/CwlCatchException.git", majorVersion: 1)
35+
36+
### CocoaPods
37+
38+
Add the following to your target in your "Podfile":
39+
40+
pod 'CwlCatchException', :git => 'https://github.com/mattgallagher/CwlCatchException.git'
41+
42+
### Carthage
43+
44+
Add the following line to your Cartfile:
45+
46+
git "https://github.com/mattgallagher/CwlCatchException.git" "master"
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ import Foundation
2424
import CwlCatchExceptionSupport
2525
#endif
2626

27-
private func catchReturnTypeConverter<T: NSException>(_ instance: T, block: () -> Void) -> T? {
28-
// Get the type from an *instance*, instead of a receiving the type directly
29-
return catchExceptionOfKind(T.self, block) as? T
27+
private func catchReturnTypeConverter<T: NSException>(_ type: T.Type, block: () -> Void) -> T? {
28+
return catchExceptionOfKind(type, block) as? T
3029
}
3130

3231
extension NSException {
3332
public static func catchException(in block: () -> Void) -> Self? {
34-
// Use a dummy instance of Self to provide the type
35-
return catchReturnTypeConverter(self.init(), block: block)
33+
return catchReturnTypeConverter(self, block: block)
3634
}
3735
}

0 commit comments

Comments
 (0)