Skip to content

Instantly share code, notes, and snippets.

View kwylez's full-sized avatar

Cory D. Wiles kwylez

View GitHub Profile
//
// ContextLabel.swift
// ContextLabel
//
// Created by Cory D. Wiles
// Copyright (c) 2017 Cory D. Wiles. All rights reserved.
//
import Foundation
import UIKit
@kwylez
kwylez / GHDark.dvtcolortheme
Created March 15, 2017 03:53
Xcode Sublime Text Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
import XCPlayground
class AnimatedView: UIView {
let rightLayer: CAShapeLayer = CAShapeLayer()
@kwylez
kwylez / CloudKitController.swift
Created September 18, 2016 20:57
Example of showing how to use CKDatabaseScope
import CloudKit
public enum CloudKitError: Error {
case general(String)
case emptyresult(String)
}
public enum CloudKitResult<T, ResultError: Error> {
case success(T)
case failure(ResultError)
import Foundation
import CloudKit
public enum CloudKitError: Error {
case general(String)
}
public enum CloudKitResult<T, ResultError: Error> {
case success(T)
case failure(ResultError)
//
// UserProfileImageView.swift
// Rezli
//
// Created by Cory D. Wiles on 7/27/16.
// Copyright © 2016 Rezli. All rights reserved.
//
import Foundation
#!/bin/sh
PATH_TO_CONFIGURATIONS="$SRCROOT/../Configurations"
FIRServiceAccountDevelopment="$PATH_TO_CONFIGURATIONS/FIRServiceAccounts-Dev.json"
FIRServiceAccountRelease="$PATH_TO_CONFIGURATIONS/FIRServiceAccounts-Prod.json"
FIRConfigDevelopment="$PATH_TO_CONFIGURATIONS/GoogleService-Info-Dev.plist"
FIRConfigRelease="$PATH_TO_CONFIGURATIONS/GoogleService-Info-Prod.plist"
private func listenOnChannel(channel: Firebase, handler: RealTimeDataHandler) -> Void {
var initialDataLoaded: Bool = false
let firebaseHandleRef: FirebaseHandle = channel.observeEventType(.Value, withBlock: {[unowned self] snapshot in
Log.print("listening to the channel from manager and got a response \(snapshot.key) -> \(snapshot.value) and [\(channel.description())]")
if !initialDataLoaded { return }
- (void)executeLocalNotificationWithLaunchHookKey:(NSString *)launchHookKey
hookType:(RTVNotificationHookType)hookType
userInfo:(NSDictionary *)userInfo {
NSDictionary *dict = [self.notificationConfiguration notificationHooks];
NSSet *notificationIgnoreTypes = [self.notificationConfiguration notificationTypesToIgnore];
[dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id hook, BOOL *stop) {
if ([key isEqualToString:launchHookKey] && ![notificationIgnoreTypes containsObject:key]) {
private func execute(launchKey: String, hookType: NotificationHookType, info: Dictionary<String, AnyObject>) -> Void {
guard let notificationConfiguration = self.configuration,
let notificationHooks = notificationConfiguration.notificationHooks,
let ignoreTypes = notificationConfiguration.notificationTypesToIgnore else { return }
let hook = notificationHooks.filter({ k, v in k == launchKey && !ignoreTypes.contains(k)})
if !hook.isEmpty {