Thursday, 24 March 2016

iOS Swift Latest Questions and answers

Defining Agile Development

Agile development is defined as the ability to move quickly and easily; relating to a method of project management that is characterized by the division of tasks into short phases of work and frequent reassessment and adaptation of plans.
The practices of agile development simplify mobile app development so that the resulting mobile apps are adaptable after release. The theory of agile development is sound, and there are several common characteristics of agile development teams that help put the theory into practice.


Extensions



Extensions add new functionality to an existing class, structure, enumeration, or protocol type. This includes the ability to extend types for which you do not have access to the original source code (known as retroactive modeling). Extensions are similar to categories in Objective-C. (Unlike Objective-C categories, Swift extensions do not have names.)
Extensions in Swift can:
  • Add computed properties and computed type properties
  • Define instance methods and type methods
  • Provide new initializers
  • Define subscripts
  • Define and use new nested types
  • Make an existing type conform to a protocol
In Swift, you can even extend a protocol to provide implementations of its requirements or add additional functionality that conforming types can take advantage of. For more details, see Protocol Extensions.


Extension Syntax

Declare extensions with the extension keyword
  1. extension SomeType {
  2. // new functionality to add to SomeType goes here
  3. }

Lazy Initialization

lazy property is a property whose underlying value is only initialized when the property is first accessed. Lazy properties are useful when the initial value for a property either requires complex or computationally expensive setup, or cannot be determined until after an instance’s initialization is complete.



No comments:

Setting Up Multiple App Targets in Xcode from a Single Codebase

 To create two different apps (like "Light" and "Regular") from the same codebase in Xcode, you can follow these steps b...