Skip to content

Instantly share code, notes, and snippets.

View russell-archer's full-sized avatar
🏠
Working from home

Russell Archer russell-archer

🏠
Working from home
View GitHub Profile
@russell-archer
russell-archer / AppDelegate.swift
Created October 9, 2018 00:14
ShowRandomColor. Add support for the user tapping a shortcut
//
// AppDelegate.swift
// ShowRandomColor
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import UIKit
@russell-archer
russell-archer / IntentViewController.swift
Created October 8, 2018 23:56
ShowRandomColor. Implementing the app extension UI
//
// IntentViewController.swift
// ColorIntentUI
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import IntentsUI
import ColorGenerator
@russell-archer
russell-archer / IntentHandler.swift
Created October 8, 2018 23:49
ShowRandomColor. Handle the intent
//
// IntentHandler.swift
// ColorIntent
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import Intents
@russell-archer
russell-archer / ColorIntentHandler.swift
Created October 8, 2018 23:39
ShowRandomColor. The app extension code
//
// ColorIntentHandler.swift
// ColorIntent
//
// Created by Russell Archer on 06/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import Foundation
import ColorGenerator
@russell-archer
russell-archer / ViewController.swift
Created October 8, 2018 23:35
ShowRandomColor. Donate the Siri shortcut
//
// ViewController.swift
// ShowRandomColor
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import UIKit
import ColorGenerator
@russell-archer
russell-archer / ViewController.swift
Created October 8, 2018 23:13
ShowRandomColor. Use the ColorGenerator to set the UIView background color
//
// ViewController.swift
// ShowRandomColor
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import UIKit
import ColorGenerator
@russell-archer
russell-archer / Generate.swift
Created October 8, 2018 15:56
ShowRandomColor. ColorGenerator framework
//
// Generate.swift
// ColorGenerator
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import Foundation
import UIKit
@russell-archer
russell-archer / ViewController.swift
Created October 8, 2018 14:58
ShowRandomColor. Create an outlet for the UIView in the ViewController
//
// ViewController.swift
// ShowRandomColor
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var colorView: UIView!
@russell-archer
russell-archer / ShowRandomColorIntent.swift
Created October 8, 2018 14:40
ShowRandomColor. Code generated by Xcode from the Intents definition file
//
// ShowRandomColorIntent.swift
//
// This file was automatically generated and should not be edited.
// Comments removed for brevity.
//
import Foundation
import Intents
@russell-archer
russell-archer / PicSearch.entitlements
Created August 30, 2018 18:17
Demo of Siri shortcuts for iOS 12 using NSUserActivity
<?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>com.apple.developer.siri</key>
<true/>
</dict>
</plist>