Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Usage of private access modifier in Swift 2
//
// 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
You can’t perform that action at this time.