Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow private(set) on IBOutlets #777

Merged

Conversation

HaloZero
Copy link
Contributor

Added a configuration to the private_outlet rule to allow for private(set).

private(set) can be useful. Sometimes you can have components that can expose their views for information retrieval, modification of components (say alpha transparency), or maybe setting callbacks on view components for later reuse but shouldn't allow their full write modification.

I made it a configuration to allow people to control it or not, by default false as the rule is more specifically geared toward private outlets.

@jpsim
Copy link
Collaborator

jpsim commented Aug 25, 2016

This is fantastic! Stellar work @HaloZero 👏 . Tests pass locally for me, so I'm happy to get this in.

@jpsim jpsim merged commit 6a9a091 into realm:master Aug 25, 2016
@@ -47,8 +47,13 @@ public struct PrivateOutletRule: ASTRule, OptInRule, ConfigurationProviderRule {

// Check if private
let accessibility = (dictionary["key.accessibility"] as? String) ?? ""
let setterAccesiblity = (dictionary["key.setter_accessibility"] as? String) ?? ""
Copy link

Choose a reason for hiding this comment

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

typo: setterAccessibility

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks, fixed in 1ed079e

@keith
Copy link
Contributor

keith commented Sep 6, 2016

Should this be configurable at all? It seems like private(set) is a sensible default for everyone since it solves the possible problem of allowing external callers to overwrite outlets, and it isn't something you would add accidentally since it isn't a default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants