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 SwiftUI | |
struct ContentView: View { | |
@State private var showRedStroke = false | |
@State private var showGreenStroke = false | |
@State private var showBlueStroke = false | |
var body: some View | |
{ | |
ZStack { | |
RadialGradient (gradient: Gradient (colors: [Color.black, Color.black]), | |
center: .center, startRadius: 5, endRadius: 500) |
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
// Step 1: class ViewController: ..... URLSessionDelegate, URLSessionTaskDelegate | |
// Step 2: Usage | |
if let url = NSURL(string: "https://example.com") { | |
let session = URLSession( | |
configuration: URLSessionConfiguration.ephemeral, | |
delegate: NSURLSessionPinningDelegate(), | |
delegateQueue: nil) |
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
// | |
// Obfuscator.swift | |
// | |
// Created by Dejan Atanasov on 2017-05-31. | |
// | |
import Foundation | |
class Obfuscator: AnyObject { | |
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 CustomURLProtocol: URLProtocol { | |
struct Constants { | |
static let RequestHandledKey = "URLProtocolRequestHandled" | |
} | |
var session: URLSession? | |
var sessionTask: URLSessionDataTask? |
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 | |
/** | |
Valida el número y la(s) letra(s) de un cualquier documento nacional de identidad | |
español (NIF o NIE) utilizando una implementación del algoritmo oficial. | |
- parameter nationalID: El DNI que se validará. No distingue mayúsculas y minúsculas. | |
- returns: `true` si el DNI proporcionado es válido o `false` si no lo es. | |
*/ | |
func validateSpanishNationalIdentifier(nationalID: String) -> Bool { | |
guard nationalID.characters.count == 9 else { |
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
- (void)setupMapSnapshot | |
{ | |
CLLocationCoordinate2D coordinate = self.outlet.annotaion.coordinate; | |
MKMapSnapshotOptions* options = [MKMapSnapshotOptions new]; | |
options.size = self.mapImageView.frame.size; | |
options.scale = [[UIScreen mainScreen] scale]; | |
options.region = MKCoordinateRegionMakeWithDistance(coordinate, 2000.f, 2000.f); | |
MKMapSnapshotter* snapshotter = [[MKMapSnapshotter alloc] initWithOptions:options]; | |
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
@interface YourViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { | |
UIImageOrientation scrollOrientation; | |
CGPoint lastPos; | |
} | |
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
if (tableView.isDragging) { | |
UIView *myView = cell.contentView; | |
CALayer *layer = myView.layer; | |
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; |
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
ACTION | |
AD_HOC_CODE_SIGNING_ALLOWED | |
ALTERNATE_GROUP | |
ALTERNATE_MODE | |
ALTERNATE_OWNER | |
ALWAYS_SEARCH_USER_PATHS | |
ALWAYS_USE_SEPARATE_HEADERMAPS | |
APPLE_INTERNAL_DEVELOPER_DIR | |
APPLE_INTERNAL_DIR | |
APPLE_INTERNAL_DOCUMENTATION_DIR |
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
// | |
// AVAsset+VideoOrientation.h | |
// | |
// Created by Luca Bernardi on 19/09/12. | |
// Copyright (c) 2012 Luca Bernardi. All rights reserved. | |
// | |
#import <AVFoundation/AVFoundation.h> | |
typedef enum { | |
LBVideoOrientationUp, //Device starts recording in Portrait |
NewerOlder