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
CAGradientLayer *topGradientLayer = [CAGradientLayer layer];
topGradientLayer.colors = @[ (id)([UIColor blackColor].CGColor), (id)([UIColor clearColor].CGColor),(id)([UIColor clearColor].CGColor)];
topGradientLayer.locations=@[];
topGradientLayer.frame = _highlightedPosterImageView.bounds; // line it up with the layer it’s masking
[_highlightedPosterImageView.layer insertSublayer:topGradientLayer atIndex:0];//top
import UIKit
class Vehicle { //definition..
var model: String!
var tires = 4
func drive() {
}
func someFunction(_ vehicle:Vehicle) {
vehicle.model = "Toyota Etios"
}
var ford = Vehicle()
ford.model = "Mustang"
print(ford.model) // prints "Mustang"
//: Playground - noun: a place where people can play
import UIKit
class Vehicle {
var model: String!
var tires = 4
var currentSpeed: Double = 0
init() {
class Shape {
var area: Double!
func calculateArea(valA: Double,valB: Double) {
}
}
class Triangle: Shape {
override func calculateArea(valA: Double, valB: Double) {
area = (valA * valB )/2
}
//
// SignupViewController.swift
// TestApp
//
// Created by Abhilash on 25/02/17.
//
import UIKit
class SignupViewController: UIViewController, UITextFieldDelegate {
import UIKit
class DownloadTaskVC: UIViewController {
var backgroundTask: UIBackgroundTaskIdentifier = UIBackgroundTaskInvalid
override func viewDidLoad() {
super.viewDidLoad()
registerBackgroundTask()
doSomeDownload()
}
#if RELEASE
print("Release")
#elseif BETA
print("Beta")
#elseif DEBUG
print("Debug")
#endif
//
// ViewController.swift
// ImagePicker
//
// Created by Abhilash on 15/03/17.
// Copyright © 2017 Abhilash. All rights reserved.
//
import UIKit
import MobileCoreServices
let UIImagePickerControllerMediaType: String //Specifies the media type selected by the user.
let UIImagePickerControllerOriginalImage: String //Specifies the original, uncropped image selected by the user.
let UIImagePickerControllerEditedImage: String //Specifies an image edited by the user.
let UIImagePickerControllerCropRect: String //Specifies the cropping rectangle that was applied to the original image.
let UIImagePickerControllerMediaURL: String //Specifies the filesystem URL for the movie.
let UIImagePickerControllerReferenceURL: String //The Assets Library URL for the original version of the picked item.
let UIImagePickerControllerMediaMetadata: String //Metadata for a newly-captured photograph.
let UIImagePickerControllerLivePhoto: String //The Live Photo representation of the selected or captured photo.