Session 15 Swift IOS Code

  IOS Mobile Application Development        

Session 15 Swift IOS Code

//// AccessModifier

// Internal
class A
{
 
}
//public var a = A()

// Open
open class B
{

}

//public
public var a = B()


// Private
private class C
{

}
 //var c = C()

 //fileprivate
class filebase
{

 var length : Double = 5.0
 var breadth : Double = 1.1

 fileprivate var area : Double
{
get
{
return length * breadth
}
set{
length =  newValue / breadth
}
}
}
let obj = filebase()
obj.area = 12
print(obj.area)

No comments:

Post a Comment

Fell free to write your query in comment. Your Comments will be fully encouraged.