This file contains 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)registerForRemoteNotificationTypes:(NSUInteger)notificationTypes categories:(NSSet *)categories | |
{ | |
if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)] && [UIApplication instancesRespondToSelector:@selector(registerForRemoteNotifications)]) | |
{ | |
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:notificationTypes categories:categories]]; | |
[[UIApplication sharedApplication] registerForRemoteNotifications]; | |
} | |
else if ([UIApplication instancesRespondToSelector:@selector(registerForRemoteNotificationTypes:)]) | |
{ | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes]; |
This file contains 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
// | |
// ParseExtensions.h | |
// | |
// Created by Alejandro Rupérez on 9/12/14. | |
// | |
#import <Foundation/Foundation.h> | |
#import <Parse/Parse.h> | |
This file contains 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
extension MKMapView | |
{ | |
func setVisibleMapAnnotations(edgePadding: UIEdgeInsets, animated: Bool) | |
{ | |
var zoomRect = MKMapRectNull | |
for annotationObject in annotations | |
{ | |
let annotation = annotationObject as MKAnnotation | |
let annotationPoint = MKMapPointForCoordinate(annotation.coordinate) |
This file contains 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
// | |
// ARURLOperation.h | |
// ARURLOperation | |
// | |
// Created by alexruperez on 13/1/15. | |
// | |
// | |
#import <Foundation/Foundation.h> |
This file contains 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
// | |
// NSString+SnakeCaseToTitleCase.h | |
// | |
// Copyright (c) 2013 alexruperez. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSString (SnakeCaseToTitleCase) |
This file contains 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
// | |
// NSDictionary+AllKeysStartingWith.h | |
// | |
// Copyright (c) 2013 alexruperez. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSDictionary (AllKeysStartingWith) |
This file contains 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
// | |
// ARSafariViewController.h | |
// | |
// Copyright © 2016 alexruperez. The MIT License (MIT) | |
// | |
@import SafariServices; | |
@interface ARSafariViewController : SFSafariViewController |
This file contains 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 Branch | |
public protocol BranchActivityObjectDelegate: BranchActivityItemProviderDelegate {} | |
public class BranchActivityObject: BranchUniversalObject { | |
private weak var delegate: BranchActivityObjectDelegate? | |
private var params: [AnyHashable : Any]! | |
private var linkProperties: BranchLinkProperties! |
This file contains 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 | |
import Vision | |
import AVFoundation | |
class BearmojiViewController: UIViewController { | |
private lazy var drawLayer = CALayer() | |
private lazy var captureSession: AVCaptureSession = { | |
let captureSession = AVCaptureSession() | |
guard let captureDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front), |
This file contains 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 application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
if !application.isRegisteredForRemoteNotifications { | |
application.registerForRemoteNotifications() | |
} | |
return true | |
} | |
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { | |
print(deviceToken.reduce("", {$0 + String(format: "%02X", $1)})) | |
} |
OlderNewer