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

Commit fc22d31

Browse files
committed
Merge branch 'master' into lammertw-watchos
2 parents c6ba2bc + ae88152 commit fc22d31

17 files changed

+28
-26
lines changed

.swift-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.0

Library/Core/Validatable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct ValidationError: Error, CustomStringConvertible {
2121

2222
public protocol Validatable {
2323
/**
24-
Validates this entity and throws if it encounters a invalid situation, a validatable should also validate it sub-validatables if it has any.
24+
Validates this entity and throws if it encounters an invalid situation, a validatable should also validate it sub-validatables if it has any.
2525

2626
- throws: If there the configuration error a ValidationError is thrown
2727
*/

Library/Foundation/Bundle+FileResource.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public extension Bundle {
1717

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

@@ -28,7 +28,7 @@ public extension Bundle {
2828

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

Library/Foundation/Data+FileResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public extension Data {
2020

2121
- returns: A NSData object with the contents of the specified file.
2222
*/
23-
public init(resource: FileResourceType) throws {
23+
init(resource: FileResourceType) throws {
2424
guard let url = resource.url() else { throw NoUrlForResourceError() }
2525
try self.init(contentsOf: url)
2626
}

Library/UIKit/NibResource+UIKit.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public extension NibResourceType {
1919

2020
- returns: An array containing the top-level objects from the NIB
2121
*/
22-
public func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] {
22+
func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] {
2323
return UINib(resource: self).instantiate(withOwner: ownerOrNil, options: optionsOrNil)
2424
}
2525
}

Library/UIKit/StoryboardResourceWithInitialController+UIKit.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public extension StoryboardResourceWithInitialControllerType {
1616

1717
- returns: The initial view controller in the storyboard.
1818
*/
19-
public func instantiateInitialViewController() -> InitialController? {
19+
func instantiateInitialViewController() -> InitialController? {
2020
return UIStoryboard(resource: self).instantiateInitialViewController() as? InitialController
2121
}
2222
}

Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public extension UICollectionView {
1919

2020
- returns: A subclass of UICollectionReusableView or nil if the cast fails.
2121
*/
22-
public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
22+
func dequeueReusableCell<Identifier: ReuseIdentifierType>(withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
2323
where Identifier.ReusableType: UICollectionReusableView
2424
{
2525
return dequeueReusableCell(withReuseIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType
@@ -34,7 +34,7 @@ public extension UICollectionView {
3434

3535
- returns: A subclass of UICollectionReusableView or nil if the cast fails.
3636
*/
37-
public func dequeueReusableSupplementaryView<Identifier: ReuseIdentifierType>(ofKind elementKind: String, withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
37+
func dequeueReusableSupplementaryView<Identifier: ReuseIdentifierType>(ofKind elementKind: String, withReuseIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
3838
where Identifier.ReusableType: UICollectionReusableView
3939
{
4040
return dequeueReusableSupplementaryView(ofKind: elementKind, withReuseIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType
@@ -45,7 +45,7 @@ public extension UICollectionView {
4545

4646
- parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionViewCell that has a reuse identifier
4747
*/
48-
public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource)
48+
func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource)
4949
where Resource.ReusableType: UICollectionViewCell
5050
{
5151
register(UINib(resource: nibResource), forCellWithReuseIdentifier: nibResource.identifier)
@@ -56,7 +56,7 @@ public extension UICollectionView {
5656

5757
- parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionReusableView. that has a reuse identifier
5858
*/
59-
public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String)
59+
func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String)
6060
where Resource.ReusableType: UICollectionReusableView
6161
{
6262
register(UINib(resource: nibResource), forSupplementaryViewOfKind: kind, withReuseIdentifier: nibResource.identifier)

Library/UIKit/UIColor+ColorResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public extension UIColor {
2222

2323
- returns: A color that exactly or best matches the desired traits with the given resource (R.color.*), or nil if no suitable color was found.
2424
*/
25-
public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
25+
convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
2626
self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
2727
}
2828
#endif

Library/UIKit/UIFont+FontResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public extension UIFont {
1919

2020
- returns: A font object of the specified font resource and size.
2121
*/
22-
public convenience init?(resource: FontResourceType, size: CGFloat) {
22+
convenience init?(resource: FontResourceType, size: CGFloat) {
2323
self.init(name: resource.fontName, size: size)
2424
}
2525
}

Library/UIKit/UIImage+ImageResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public extension UIImage {
2020

2121
- returns: An image that exactly or best matches the desired traits with the given resource (R.image.*), or nil if no suitable image was found.
2222
*/
23-
public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
23+
convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
2424
self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
2525
}
2626
#endif

Library/UIKit/UINib+NibResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public extension UINib {
1717

1818
- returns: The initialized UINib object. An exception is thrown if there were errors during initialization or the nib file could not be located.
1919
*/
20-
public convenience init(resource: NibResourceType) {
20+
convenience init(resource: NibResourceType) {
2121
self.init(nibName: resource.name, bundle: resource.bundle)
2222
}
2323
}

Library/UIKit/UIStoryboard+StoryboardResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public extension UIStoryboard {
1717

1818
- returns: A storyboard object for the specified file. If no storyboard resource file matching name exists, an exception is thrown with description: `Could not find a storyboard named 'XXXXXX' in bundle....`
1919
*/
20-
public convenience init(resource: StoryboardResourceType) {
20+
convenience init(resource: StoryboardResourceType) {
2121
self.init(name: resource.name, bundle: resource.bundle)
2222
}
2323
}

Library/UIKit/UIStoryboard+StoryboardViewControllerResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public extension UIStoryboard {
1818

1919
- returns: The view controller corresponding to the specified resource (R.storyboard.*.*). If no view controller is associated, this method throws an exception.
2020
*/
21-
public func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? {
21+
func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? {
2222
return self.instantiateViewController(withIdentifier: resource.identifier) as? ViewControllerResource.ViewControllerType
2323
}
2424
}

Library/UIKit/UITableView+ReuseIdentifierProtocol.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ public extension UITableView {
2121

2222
- precondition: You must register a class or nib file using the registerNib: or registerClass:forCellReuseIdentifier: method before calling this method.
2323
*/
24-
public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
24+
func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier, for indexPath: IndexPath) -> Identifier.ReusableType?
2525
where Identifier.ReusableType: UITableViewCell
2626
{
2727
return dequeueReusableCell(withIdentifier: identifier.identifier, for: indexPath) as? Identifier.ReusableType
2828
}
2929

3030
@available(*, unavailable, message: "Use dequeueReusableCell(withIdentifier:for:) instead")
31-
public func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
31+
func dequeueReusableCell<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
3232
where Identifier.ReusableType: UITableViewCell
3333
{
3434
fatalError()
@@ -41,7 +41,7 @@ public extension UITableView {
4141

4242
- returns: A UITableViewHeaderFooterView object with the associated identifier or nil if no such object exists in the reusable view queue or if it couldn't be cast correctly.
4343
*/
44-
public func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
44+
func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
4545
where Identifier.ReusableType: UITableViewHeaderFooterView
4646
{
4747
return dequeueReusableHeaderFooterView(withIdentifier: identifier.identifier) as? Identifier.ReusableType
@@ -52,7 +52,7 @@ public extension UITableView {
5252

5353
- parameter nibResource: A nib resource (R.nib.*) containing a table view cell that has a reuse identifier
5454
*/
55-
public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UITableViewCell {
55+
func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource) where Resource.ReusableType: UITableViewCell {
5656
register(UINib(resource: nibResource), forCellReuseIdentifier: nibResource.identifier)
5757
}
5858

@@ -61,7 +61,7 @@ public extension UITableView {
6161

6262
- parameter nibResource: A nib resource (R.nib.*) containing a view that has a reuse identifier
6363
*/
64-
public func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView {
64+
func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView {
6565
register(UINib(resource: nibResource), forHeaderFooterViewReuseIdentifier: nibResource.identifier)
6666
}
6767
}

Library/UIKit/UIViewController+NibResource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public extension UIViewController {
1818

1919
- returns: A newly initialized UIViewController object.
2020
*/
21-
public convenience init(nib: NibResourceType) {
21+
convenience init(nib: NibResourceType) {
2222
self.init(nibName: nib.name, bundle: nib.bundle)
2323
}
2424
}

Library/UIKit/UIViewController+StoryboardSegueIdentifierProtocol.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public extension SeguePerformerType {
2323
- 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.
2424
- SeeAlso: Library for typed block based segues: [tomlokhorst/SegueManager](https://github.com/tomlokhorst/SegueManager)
2525
*/
26-
public func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) {
26+
func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) {
2727
performSegue(withIdentifier: identifier.identifier, sender: sender)
2828
}
2929
}
@@ -33,7 +33,7 @@ public extension StoryboardSegue where Source : UIViewController {
3333
Performs this segue on the source view controller
3434
- 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.
3535
*/
36-
public func performSegue(sender: Any? = nil) {
36+
func performSegue(sender: Any? = nil) {
3737
source.performSegue(withIdentifier: identifier.identifier, sender: sender)
3838
}
3939
}

R.swift.Library.podspec

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |spec|
22

33
spec.name = "R.swift.Library"
4-
spec.version = "5.0.0.alpha.1"
4+
spec.version = "5.0.1"
55
spec.license = "MIT"
66

77
spec.summary = "Companion library for R.swift, featuring types used to type resources"
@@ -18,6 +18,8 @@ Pod::Spec.new do |spec|
1818
spec.requires_arc = true
1919
spec.source = { :git => "https://github.com/mac-cain13/R.swift.Library.git", :tag => "v#{spec.version}" }
2020

21+
spec.pod_target_xcconfig = { 'APPLICATION_EXTENSION_API_ONLY' => 'YES' }
22+
2123
spec.ios.deployment_target = '8.0'
2224
spec.ios.source_files = "Library/**/*.swift"
2325
spec.tvos.deployment_target = '9.0'

0 commit comments

Comments
 (0)