Skip to content

Instantly share code, notes, and snippets.

View abhimuralidharan's full-sized avatar
🍎
Apple Developer

Abhilash KM abhimuralidharan

🍎
Apple Developer
View GitHub Profile
{
"applinks": {
"apps": [],
"details": [
{
"appID": “JHGFJHHYX.com.facebook.ios",
"paths": [
"*"
]
}
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"
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)
}
import Foundation
class LivingBeing {
var age :Int?
init(age:Int?) {
if let age = age {
self.age = age
}
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)")
class StepCounter {
var totalSteps: Int = 0 {
willSet(newTotalSteps) {
print("About to set totalSteps to \(newTotalSteps)")
}
didSet {
if totalSteps > oldValue {
print("Added \(totalSteps - oldValue) steps")
}
}
//
// UIDeviceExtensions.swift
// Template1
//
// Created by Abhilash on 24/05/17.
// Copyright © 2017 Mobiotics. All rights reserved.
//
import Foundation
import UIKit
//: 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"
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//
/*
DISCLAIMER
fileprivate extension Selector {
static let buttonTapped = #selector(ViewController.buttonTapped)
static let deviceOrientationDidChange = #selector(ViewController.deviceOrientationDidChange)
}
.......
.......
NotificationCenter.default.addObserver(self, selector: .deviceOrientationDidChange,