Last active
August 24, 2016 08:09
-
-
Save fitomad/c1228becacadc110dc6a4865ddb0f710 to your computer and use it in GitHub Desktop.
Usage of private access modifier in Swift 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// In *Swift 2* this works cause `private` means | |
// **inside this file** | |
// | |
// | |
// MARK: - A Class | |
// | |
internal class FilterView: UIView | |
{ | |
/// Elements returned after apply filter | |
@IBOutlet private weak var labelQuantity: UILabel! | |
... | |
} | |
// | |
// MARK: - Implements Protocol | |
// | |
extension FilterView: SomeProtocol | |
{ | |
func apply(filter: String) -> Void | |
{ | |
var quantity: Int = ... | |
// This works OK | |
self.labelQuantity.text = "Founded \(quantity) element(s)." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment