This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var intValue: Int = 5 | |
var doubleValue: Double = 7.0 | |
var addition = Double(intValue) + doubleValue //addition will be implicitly considered of type Double by swift compiler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
protocol Displayable { | |
//protocol requirements | |
} | |
class Person: Displayable { | |
//class implementation | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlacesMapViewController: UIViewController { | |
//PlacesMapViewController implementation | |
} | |
extension PlacesMapViewController: MKMapViewDelegate { | |
//implementation of methods releated to mapView | |
} | |
extension PlacesMapViewController: UISearchBarDelegate { | |
//implementation of methods releated to searchbar | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
typealias HSCompositeTableViewDatasourceDelegate = (UITableViewDataSource & UITableViewDelegate) | |
class ContactListViewController: UIViewController { | |
//ContactListViewController implementation | |
} | |
extension ContactListViewController: HSCompositeTableViewDatasourceDelegate { | |
//implementation of methods releated to UITableViewDataSource and UITableViewDelegate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol HSCombineTableViewDatasourceDelegate : UITableViewDataSource, UITableViewDelegate { } //empty protocol | |
class ContactListViewController: UIViewController { | |
//ContactListViewController implementation | |
} | |
extension ContactListViewController: HSCompositeTableViewDatasourceDelegate { | |
//implementation of methods releated to UITableViewDataSource and UITableViewDelegate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
protocol Displayable { | |
func displayName() | |
} | |
class Person { | |
var name: String | |
init(name: String) { | |
self.name = name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
//MARK:- Person, Super class | |
class Person { | |
var firstName: String = "Hitendra" | |
var lastName: String = "Solanki" | |
var displayString: String { | |
return "Name of person is \(firstName) \(lastName)." | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
//MARK:- Person | |
class Person { | |
var firstName: String = "Hitendra" | |
var lastName: String = "Solanki" | |
}//End: Person | |
//creating instances | objects as a person type | |
let person1: Person = Person() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
//MARK:- InformationDisplayble Protocol | |
protocol InformationDisplayble { | |
func displayInformation() | |
} | |
//MARK:- Employee Class | |
class Employee { | |
var employeeID: String = "EMP007" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class LoginViewController: UIViewController { | |
//your class implementation | |
} |
OlderNewer