iOS is the most common OS used mainly in US, UK and Canada. We all know about iOS, but in this blog, we will see the mobile application development platform in iOS. iOS is a bit difficult to use and it has many in-built functionalities. There many iOS mobile development in the market but when we talk about the iOS native apps it clearly gives the idea of swift and objective – C.
Objective – C
Firstly, let’s see what is swift?
New programming language for iOS, OS X, watch OS and TV OS apps.
Swift builds on the best of C and Objective-C, without the constraints of C compatibility.
Swift adopts safe programming patterns and adds modern features to make programming
The compiler is optimized for performance, and the language is optimized for development, without compromising on either.
Now we will have a look into why we use swift for the iOS mobile app development. There are few things to know about using swift for mobile development in iOS.
The first major feature of Swift is “safe by default”.
The improvements in app quality and stability over a huge developer community.
Swift includes things like more pervasive strong typing through generics and type inference.
Swift is compatible with existing Objective-C libraries.
There’s no problem with writing new modules in Swift that interoperate with existing Objective-C code bases.
Significant features of Swift Programming Language are:
Swift type inference
Implicit Fall through
Class- User defined data type that will become a building block of code where properties and methods added around certain functionality.
Difference in Classes and Structures
Inheritance – permits a category to inherit the characteristics of another class
Type casting at runtime
Free up resources
Reference count allows to refer over one to category instance Class declaration
Lazy stored properties
Global and Local variables
Two types of initialiser: Designated and Convenience
Rule 1- selected initialiser ought to call designated initialiser from immediate biological group
Rule 2 – Convenience initialiser should call another initialiser from same category