I\'m having a look at the new Swift. I come from C, C++, Objective-C... I notice that in swift is not possible (?) to separate the declaration and the definition of function
About the best we can do is use protocols as Implementation declarations and mark all private methods:
protocol TestInterface {
var propertyPublic1: String { get }
func funcPublic1() -> Int
}
class Test : TestInterface {
var propertyPublic1: String = "text."
func funcPublic1() -> Int {return 754}
private var propertyPrivate1: Int = 5678
private func funcPrivate1() -> Int {return 334}
}
var t = Test()
let propPublic1 = t.propertyPublic1
The problem is that it is not provided as a standard idiom and the naming is unfortunate, I have just appended "Interface" to the class name.