Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit a039751

Browse files
committed
Updates for Xcode 8 beta 5
1 parent 4820695 commit a039751

6 files changed

+19
-19
lines changed

Diff for: Library/Core/FileResource.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public extension FileResourceType {
3232
- returns: The full pathname for this resource or nil if the file could not be located.
3333
*/
3434
func path() -> String? {
35-
return bundle.pathForResource(self)
35+
return bundle.path(forResource: self)
3636
}
3737

3838
/**
@@ -41,7 +41,7 @@ public extension FileResourceType {
4141
- returns: The file URL for this resource or nil if the file could not be located.
4242
*/
4343
func url() -> URL? {
44-
return bundle.urlForResource(self)
44+
return bundle.url(forResource: self)
4545
}
4646
}
4747

Diff for: Library/Core/StoryboardSegueIdentifierProtocol.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public struct StoryboardSegueIdentifier<Segue, Source, Destination>: StoryboardS
4444
}
4545

4646
/// Create a new StoryboardSegue based on the identifier and source view controller
47-
public func storyboardSegue(withSource sourceViewController: Source)
47+
public func storyboardSegue(withSource source: Source)
4848
-> StoryboardSegue<Segue, Source, Destination>
4949
{
50-
return StoryboardSegue(identifier: self, sourceViewController: sourceViewController)
50+
return StoryboardSegue(identifier: self, source: source)
5151
}
5252
}
5353

@@ -63,7 +63,7 @@ public struct TypedStoryboardSegueInfo<Segue, Source, Destination>: StoryboardSe
6363
public typealias DestinationType = Destination
6464

6565
/// Segue destination view controller
66-
public let destinationViewController: Destination
66+
public let destination: Destination
6767

6868
/// Segue identifier
6969
public let identifier: String
@@ -72,7 +72,7 @@ public struct TypedStoryboardSegueInfo<Segue, Source, Destination>: StoryboardSe
7272
public let segue: Segue
7373

7474
/// Segue source view controller
75-
public let sourceViewController: Source
75+
public let source: Source
7676
}
7777

7878
/// Segue with identifier and source view controller
@@ -81,15 +81,15 @@ public struct StoryboardSegue<Segue, Source, Destination> {
8181
public let identifier: StoryboardSegueIdentifier<Segue, Source, Destination>
8282

8383
/// Segue source view controller
84-
public let sourceViewController: Source
84+
public let source: Source
8585

8686
/**
8787
Create a new segue based on the identifier and source view controller
8888

8989
- returns: A new StoryboardSegue
9090
*/
91-
public init(identifier: StoryboardSegueIdentifier<Segue, Source, Destination>, sourceViewController: Source) {
91+
public init(identifier: StoryboardSegueIdentifier<Segue, Source, Destination>, source: Source) {
9292
self.identifier = identifier
93-
self.sourceViewController = sourceViewController
93+
self.source = source
9494
}
9595
}

Diff for: Library/Core/Validatable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
/// Error thrown during validation
12-
public struct ValidationError: ErrorProtocol, CustomStringConvertible {
12+
public struct ValidationError: Error, CustomStringConvertible {
1313
/// Human readable description
1414
public let description: String
1515

Diff for: Library/Foundation/Bundle+FileResource.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public extension Bundle {
1616

1717
- returns: The file URL for the resource file (R.file.*) or nil if the file could not be located.
1818
*/
19-
public func urlForResource(_ resource: FileResourceType) -> URL? {
20-
return urlForResource(resource.name, withExtension: resource.pathExtension)
19+
public func url(forResource resource: FileResourceType) -> URL? {
20+
return url(forResource: resource.name, withExtension: resource.pathExtension)
2121
}
2222

2323
/**
@@ -27,7 +27,7 @@ public extension Bundle {
2727

2828
- returns: The full pathname for the resource file (R.file.*) or nil if the file could not be located.
2929
*/
30-
public func pathForResource(_ resource: FileResourceType) -> String? {
31-
return pathForResource(resource.name, ofType: resource.pathExtension)
30+
public func path(forResource resource: FileResourceType) -> String? {
31+
return path(forResource: resource.name, ofType: resource.pathExtension)
3232
}
3333
}

Diff for: Library/UIKit/TypedStoryboardSegueInfo+UIStoryboardSegue.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ extension TypedStoryboardSegueInfo {
1818
public init?<SegueIdentifier: StoryboardSegueIdentifierType where SegueIdentifier.SegueType == Segue, SegueIdentifier.SourceType == Source, SegueIdentifier.DestinationType == Destination>(segueIdentifier: SegueIdentifier, segue: UIStoryboardSegue)
1919
{
2020
guard let identifier = segue.identifier,
21-
let sourceViewController = segue.sourceViewController as? SegueIdentifier.SourceType,
22-
let destinationViewController = segue.destinationViewController as? SegueIdentifier.DestinationType,
21+
let source = segue.source as? SegueIdentifier.SourceType,
22+
let destination = segue.destination as? SegueIdentifier.DestinationType,
2323
let segue = segue as? SegueIdentifier.SegueType, identifier == segueIdentifier.identifier
2424
else {
2525
return nil
2626
}
2727

2828
self.segue = segue
2929
self.identifier = identifier
30-
self.sourceViewController = sourceViewController
31-
self.destinationViewController = destinationViewController
30+
self.source = source
31+
self.destination = destination
3232
}
3333
}

Diff for: Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public extension StoryboardSegue where Source : UIViewController {
3535
- parameter sender: The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue.
3636
*/
3737
public func performSegue(sender: AnyObject? = nil) {
38-
sourceViewController.performSegue(withIdentifier: identifier.identifier, sender: sender)
38+
source.performSegue(withIdentifier: identifier.identifier, sender: sender)
3939
}
4040
}

0 commit comments

Comments
 (0)