This file contains hidden or 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
| { | |
| "applinks": { | |
| "apps": [], | |
| "details": [ | |
| { | |
| "appID": “JHGFJHHYX.com.facebook.ios", | |
| "paths": [ | |
| "*" | |
| ] | |
| } |
This file contains hidden or 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 APICaller { | |
| var url:URL? | |
| var method = HTTPMethods.get | |
| var params:[String:String]? | |
| enum HTTPMethods: String { // http methods | |
| case get = "GET" | |
| case post = "POST" | |
| case put = "PUT" |
This file contains hidden or 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
| Alamofire.request("https://httpbin.org/get") | |
| .validate(statusCode: 200..<300) | |
| .validate(contentType: ["application/json"]) | |
| .responseData { response in | |
| switch response.result { | |
| case .success: | |
| print("Validation Successful") | |
| case .failure(let error): | |
| print(error) | |
| } |
This file contains hidden or 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 | |
| class LivingBeing { | |
| var age :Int? | |
| init(age:Int?) { | |
| if let age = age { | |
| self.age = age | |
| } |
This file contains hidden or 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 Player { | |
| static var totalNumberOfPlayers = 0 | |
| var name:String | |
| init(name:String) { | |
| Player.totalNumberOfPlayers += 1 | |
| self.name = name | |
| } | |
| static func printTotalNumberOfPlayers() { | |
| print("Function log --> Total no of players: \(Player.totalNumberOfPlayers)") |
This file contains hidden or 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 StepCounter { | |
| var totalSteps: Int = 0 { | |
| willSet(newTotalSteps) { | |
| print("About to set totalSteps to \(newTotalSteps)") | |
| } | |
| didSet { | |
| if totalSteps > oldValue { | |
| print("Added \(totalSteps - oldValue) steps") | |
| } | |
| } |
This file contains hidden or 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
| // | |
| // UIDeviceExtensions.swift | |
| // Template1 | |
| // | |
| // Created by Abhilash on 24/05/17. | |
| // Copyright © 2017 Mobiotics. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
This file contains hidden or 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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| struct InterviewCandidate { | |
| var isiOS:Bool? | |
| lazy var iOSResumeDescription: String = { | |
| return "I am an iOS developer" |
This file contains hidden or 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
| // | |
| // ___FILENAME___ | |
| // ___PROJECTNAME___ | |
| // | |
| // Created by ___FULLUSERNAME___ on ___DATE___. | |
| //___COPYRIGHT___ | |
| // | |
| /* | |
| DISCLAIMER |
This file contains hidden or 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
| fileprivate extension Selector { | |
| static let buttonTapped = #selector(ViewController.buttonTapped) | |
| static let deviceOrientationDidChange = #selector(ViewController.deviceOrientationDidChange) | |
| } | |
| ....... | |
| ....... | |
| NotificationCenter.default.addObserver(self, selector: .deviceOrientationDidChange, |