Tuesday, June 4, 2019

Mix Points


  • Object-oriented concepts don’t work well with structs and enums: a struct cannot inherit from another struct, neither can an enum inherit from another enum. So inheritance - one of the fundamental object-oriented concepts - cannot be applied to value types. On the other hand, value types can inherit from protocols, even multiple protocols. Thus, with Protocol Oriented Programming, value types have become first-class citizens in Swift.
  • Apple tells us: “Don’t start with a class, start with a protocol.”
  • Swift, just like many other programming languages, does not support multiple inheritances.
  • In Swift, you can extend a protocol and provide a default implementation for methods, computed properties, subscripts, and convenience initializers.
  • Swift does not allow multiple inheritances for classes. However, Swift types can adopt multiple protocols.
  • Objective-C does not support multiple inheritances, you can achieve similar functionality with protocols, as a class can adopt more than one protocol.
  • Swift 5: Enumerations can have methods associated with them.
  • One of the most important differences between structures and classes is that structures are always copied when they are passed around in your code, but classes are passed by reference.
  • Classes, enumerations, and structs can all adopt protocols.
  • You can make generic forms of functions and methods, as well as classes, enumerations, and structures.

Friday, April 5, 2019

Protocol Oriented Programming(POP) in Swift

What is Test Driven Development (TDD)

Swift - Tuples

What is Git?

Agile Methodology Tutorial

How to Increase my iOS Application Security

What is Higher Order Functions?

What is functional programming language?

Swift - Generics

Tuples, Structs and Enums:: What are the differences?