One file for each domain, both www.example.com and example.com need separate files:
{
"applinks": {
"apps": [],
"details": {
"9JA89QQLNQ.com.apple.wwdc": {
import UIKit | |
let scoresStringArray : [String] = ["Mike","Tom","Bily"] | |
let scoresDataArray = NSKeyedArchiver.archivedData(withRootObject: scoresStringArray) | |
//Save data | |
_ = Keychain.save(key: "scoresKey", data: scores) | |
//Load data | |
if Keychain.load(key: "scoresKey") != nil{ |
func debounce(delay: Int, queue: DispatchQueue, action: (()->()) ) -> ()->() { | |
var lastFireTime = DispatchTime.now() | |
let dispatchDelay = DispatchTimeInterval.seconds(delay) | |
return { | |
lastFireTime = DispatchTime.now() | |
let dispatchTime: DispatchTime = lastFireTime + dispatchDelay | |
queue.after(when: dispatchTime) { | |
let when: DispatchTime = lastFireTime + dispatchDelay | |
let now = DispatchTime.now() |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>File Upload example</title> | |
<link href="/Content/bootstrap.css" rel="stylesheet" /> | |
</head> | |
<body> | |
<form action="api/Upload" method="post"> | |
<div class="form-group"> |
// public interface | |
@interface UBNTDiscardableThumbnail : NSObject<NSDiscardableContent> | |
+ (instancetype)discardableThumbnailWithImage:(UIImage *)image; | |
- (instancetype)initWithImage:(UIImage *)thumbnail; | |
@property (nonatomic, readonly) UIImage *thumbnail; | |
@end |
// Actual gzipping from https://github.com/1024jp/NSData-GZIP | |
// Example: ParameterEncoding.JSON.gzipped | |
infix operator • { associativity left } | |
func • <A, B, C>(f: B -> C, g: A -> B) -> A -> C { | |
return { x in f(g(x)) } | |
} | |
extension ParameterEncoding { |
// | |
// WatchSessionManager.swift | |
// WatchConnectivityDemo | |
// | |
// Created by Natasha Murashev on 9/3/15. | |
// Copyright © 2015 NatashaTheRobot. All rights reserved. | |
// | |
import WatchConnectivity |
One file for each domain, both www.example.com and example.com need separate files:
{
"applinks": {
"apps": [],
"details": {
"9JA89QQLNQ.com.apple.wwdc": {
private func example1() { | |
let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
for i in 0..<10 { | |
dispatch_async(queue) { | |
NSLog("Start: \(i)") | |
sleep(3) | |
NSLog("End: \(i)") | |
} | |
} | |
} |
func drawOnPDF(path: String) { | |
// Get existing Pdf reference | |
let pdf = CGPDFDocumentCreateWithURL(NSURL(fileURLWithPath: path)) | |
// Get page count of pdf, so we can loop through pages and draw them accordingly | |
let pageCount = CGPDFDocumentGetNumberOfPages(pdf); | |
// Write to file | |
UIGraphicsBeginPDFContextToFile(path, CGRectZero, nil) |