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

Commit 87896b0

Browse files
authored
Merge pull request #31 from susan335/xcode10_2
Fix warning for Xcode10.2
2 parents 108e655 + 49e6441 commit 87896b0

15 files changed

+24
-24
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0
1+
4.0

Library/Foundation/Bundle+FileResource.swift

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public extension UIColor {
2020

2121
- 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.
2222
*/
23-
public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
23+
convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
2424
self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
2525
}
2626
}

Library/UIKit/UIFont+FontResource.swift

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public extension UIImage {
1818

1919
- 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.
2020
*/
21-
public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
21+
convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
2222
self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
2323
}
2424
}

Library/UIKit/UINib+NibResource.swift

Lines changed: 1 addition & 1 deletion
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
}

0 commit comments

Comments
 (0)