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
| 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 |
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 UIKit | |
| class Vehicle { //definition.. | |
| var model: String! | |
| var tires = 4 | |
| func drive() { | |
| } | |
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
| func someFunction(_ vehicle:Vehicle) { | |
| vehicle.model = "Toyota Etios" | |
| } | |
| var ford = Vehicle() | |
| ford.model = "Mustang" | |
| print(ford.model) // prints "Mustang" |
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 | |
| class Vehicle { | |
| var model: String! | |
| var tires = 4 | |
| var currentSpeed: Double = 0 | |
| init() { | |
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 Shape { | |
| var area: Double! | |
| func calculateArea(valA: Double,valB: Double) { | |
| } | |
| } | |
| class Triangle: Shape { | |
| override func calculateArea(valA: Double, valB: Double) { | |
| area = (valA * valB )/2 | |
| } |
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
| // | |
| // SignupViewController.swift | |
| // TestApp | |
| // | |
| // Created by Abhilash on 25/02/17. | |
| // | |
| import UIKit | |
| class SignupViewController: UIViewController, UITextFieldDelegate { | |
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 UIKit | |
| class DownloadTaskVC: UIViewController { | |
| var backgroundTask: UIBackgroundTaskIdentifier = UIBackgroundTaskInvalid | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| registerBackgroundTask() | |
| doSomeDownload() | |
| } | |
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
| #if RELEASE | |
| print("Release") | |
| #elseif BETA | |
| print("Beta") | |
| #elseif DEBUG | |
| print("Debug") | |
| #endif |
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
| // | |
| // ViewController.swift | |
| // ImagePicker | |
| // | |
| // Created by Abhilash on 15/03/17. | |
| // Copyright © 2017 Abhilash. All rights reserved. | |
| // | |
| import UIKit | |
| import MobileCoreServices |
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
| 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. |
OlderNewer