sean7512 / RestEssentials

Lightweight REST and JSON library for Swift.
MIT License
37 stars 12 forks source link

Private scoping error xcode9 #14

Closed MattSich closed 6 years ago

MattSich commented 6 years ago

If trying to use restEssentials in my project, I get an error in JSON.swift at line 192 screen shot 2017-09-25 at 4 29 39 pm

raw should be set to fileprivate I believe

@sean7512

sean7512 commented 6 years ago

@MattSich @aravasio I cannot reproduce this. I have even created new test projects from scratch to no avail.

What version of cocoapods are you using? Ensure you have the latest version that supports Xcode 9 and swift 4.

sean7512 commented 6 years ago

@MattSich @aravasio Under the Pods project, select the RestEssentials target and then go to build settings and ensure that the "Swift Language Version" is set to 4.0 If you are not using the latest Cocoapods, you WILL have to set this, as Cocoapods 1.3.1 added support for Xcode 9 and Swift 4. I would recommend updating cocoapods and re-installing your pods. If you can't do that then try changing the swift language manually.

restessentials

sean7512 commented 6 years ago

@MattSich As of Swift4, private works in the same file for extensions. That is documented here:

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html

"Private access restricts the use of an entity to the enclosing declaration, and to extensions of that declaration that are in the same file. Use private access to hide the implementation details of a specific piece of functionality when those details are used only within a single declaration."

aravasio commented 6 years ago

@sean7512 you're totally right. It was my Cocoapods that was outdated. Either proposed solution works. This should be considered resolved and be closed.

sean7512 commented 6 years ago

@aravasio glad that fixed it for you, I will close this issue now.