Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same version as R. swift

I fixed warning, and
I checked compile (swift 4.0 and 5.0) with this visibility.

4 changes: 2 additions & 2 deletions Library/Foundation/Bundle+FileResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public extension Bundle {

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

Expand All @@ -28,7 +28,7 @@ public extension Bundle {

- returns: The full pathname for the resource file (R.file.*) or nil if the file could not be located.
*/
public func path(forResource resource: FileResourceType) -> String? {
func path(forResource resource: FileResourceType) -> String? {
return path(forResource: resource.name, ofType: resource.pathExtension)
}
}
2 changes: 1 addition & 1 deletion Library/Foundation/Data+FileResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public extension Data {

- returns: A NSData object with the contents of the specified file.
*/
public init(resource: FileResourceType) throws {
init(resource: FileResourceType) throws {
guard let url = resource.url() else { throw NoUrlForResourceError() }
try self.init(contentsOf: url)
}
Expand Down
2 changes: 1 addition & 1 deletion Library/UIKit/NibResource+UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public extension NibResourceType {

- returns: An array containing the top-level objects from the NIB
*/
public func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] {
func instantiate(withOwner ownerOrNil: Any?, options optionsOrNil: [UINib.OptionsKey : Any]? = [:]) -> [Any] {
return UINib(resource: self).instantiate(withOwner: ownerOrNil, options: optionsOrNil)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public extension StoryboardResourceWithInitialControllerType {

- returns: The initial view controller in the storyboard.
*/
public func instantiateInitialViewController() -> InitialController? {
func instantiateInitialViewController() -> InitialController? {
return UIStoryboard(resource: self).instantiateInitialViewController() as? InitialController
}
}
8 changes: 4 additions & 4 deletions Library/UIKit/UICollectionView+ReuseIdentifierProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public extension UICollectionView {

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

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

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

- parameter nibResource: A nib resource (R.nib.*) containing a object of type UICollectionReusableView. that has a reuse identifier
*/
public func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String)
func register<Resource: NibResourceType & ReuseIdentifierType>(_ nibResource: Resource, forSupplementaryViewOfKind kind: String)
where Resource.ReusableType: UICollectionReusableView
{
register(UINib(resource: nibResource), forSupplementaryViewOfKind: kind, withReuseIdentifier: nibResource.identifier)
Expand Down
2 changes: 1 addition & 1 deletion Library/UIKit/UIColor+ColorResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public extension UIColor {

- 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.
*/
public convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
convenience init?(resource: ColorResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
}
}
2 changes: 1 addition & 1 deletion Library/UIKit/UIFont+FontResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public extension UIFont {

- returns: A font object of the specified font resource and size.
*/
public convenience init?(resource: FontResourceType, size: CGFloat) {
convenience init?(resource: FontResourceType, size: CGFloat) {
self.init(name: resource.fontName, size: size)
}
}
2 changes: 1 addition & 1 deletion Library/UIKit/UIImage+ImageResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension UIImage {

- 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.
*/
public convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
convenience init?(resource: ImageResourceType, compatibleWith traitCollection: UITraitCollection? = nil) {
self.init(named: resource.name, in: resource.bundle, compatibleWith: traitCollection)
}
}
2 changes: 1 addition & 1 deletion Library/UIKit/UINib+NibResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public extension UINib {

- returns: The initialized UINib object. An exception is thrown if there were errors during initialization or the nib file could not be located.
*/
public convenience init(resource: NibResourceType) {
convenience init(resource: NibResourceType) {
self.init(nibName: resource.name, bundle: resource.bundle)
}
}
2 changes: 1 addition & 1 deletion Library/UIKit/UIStoryboard+StoryboardResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public extension UIStoryboard {

- 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....`
*/
public convenience init(resource: StoryboardResourceType) {
convenience init(resource: StoryboardResourceType) {
self.init(name: resource.name, bundle: resource.bundle)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension UIStoryboard {

- returns: The view controller corresponding to the specified resource (R.storyboard.*.*). If no view controller is associated, this method throws an exception.
*/
public func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? {
func instantiateViewController<ViewControllerResource: StoryboardViewControllerResourceType>(withResource resource: ViewControllerResource) -> ViewControllerResource.ViewControllerType? {
return self.instantiateViewController(withIdentifier: resource.identifier) as? ViewControllerResource.ViewControllerType
}
}
10 changes: 5 additions & 5 deletions Library/UIKit/UITableView+ReuseIdentifierProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public extension UITableView {

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

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

- 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.
*/
public func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
func dequeueReusableHeaderFooterView<Identifier: ReuseIdentifierType>(withIdentifier identifier: Identifier) -> Identifier.ReusableType?
where Identifier.ReusableType: UITableViewHeaderFooterView
{
return dequeueReusableHeaderFooterView(withIdentifier: identifier.identifier) as? Identifier.ReusableType
Expand All @@ -52,7 +52,7 @@ public extension UITableView {

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

Expand All @@ -61,7 +61,7 @@ public extension UITableView {

- parameter nibResource: A nib resource (R.nib.*) containing a view that has a reuse identifier
*/
public func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView {
func registerHeaderFooterView<Resource: NibResourceType>(_ nibResource: Resource) where Resource: ReuseIdentifierType, Resource.ReusableType: UIView {
register(UINib(resource: nibResource), forHeaderFooterViewReuseIdentifier: nibResource.identifier)
}
}
2 changes: 1 addition & 1 deletion Library/UIKit/UIViewController+NibResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension UIViewController {

- returns: A newly initialized UIViewController object.
*/
public convenience init(nib: NibResourceType) {
convenience init(nib: NibResourceType) {
self.init(nibName: nib.name, bundle: nib.bundle)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public extension SeguePerformerType {
- 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.
- SeeAlso: Library for typed block based segues: [tomlokhorst/SegueManager](https://github.com/tomlokhorst/SegueManager)
*/
public func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) {
func performSegue<Segue, Destination>(withIdentifier identifier: StoryboardSegueIdentifier<Segue, Self, Destination>, sender: Any?) {
performSegue(withIdentifier: identifier.identifier, sender: sender)
}
}
Expand All @@ -33,7 +33,7 @@ public extension StoryboardSegue where Source : UIViewController {
Performs this segue on the source view controller
- 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.
*/
public func performSegue(sender: Any? = nil) {
func performSegue(sender: Any? = nil) {
source.performSegue(withIdentifier: identifier.identifier, sender: sender)
}
}