How can we make a property optional in swift?



How can we make a property optional in swift?..

Answer / Aziz Aslam Siddique

"In Swift, you can make a property optional by appending a question mark (?) after the variable type. For example: var myOptionalString: String?"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Swift Interview Questions

Is swift a good language to learn?

1 Answers  


What is init() in swift?

1 Answers  


What is difference between weak and strong in swift?

1 Answers  


Explain me what is swift?

1 Answers  


Consider the following code: let op1: Int = 1 let op2: UInt = 2 let op3: Double = 3.34 var result = op1 + op2 + op3 Where is the error and why? How can it be fixed?

1 Answers  


What are the advantages of using swift for ios development?

1 Answers  


Is swift open source?

1 Answers  


What is extension in swift?

1 Answers  


What is retain in swift?

1 Answers  


What are structures in swift?

1 Answers  


Explain completion handler?

1 Answers  


How do you make a bridging header in swift?

1 Answers  


Categories