Skip to content

Instantly share code, notes, and snippets.

Avatar

Cory D. Wiles kwylez

View GitHub Profile
@kwylez
kwylez / EXIFImage-playground.swift
Created Feb 1, 2017
Modifying EXIF Data with Swift 3
View EXIFImage-playground.swift
//: Playground - noun: a place where people can play
import UIKit
import ImageIO
import MobileCoreServices
let TEST_IMAGE: String = "replace.jpg"
let beach: UIImage = UIImage(named: TEST_IMAGE)!
let imageData: Data = UIImageJPEGRepresentation(beach, 1)!
View sample_iap_receipt.json
{
"status": 0,
"environment": "Sandbox",
"receipt": {
"receipt_type": "ProductionSandbox",
"adam_id": 0,
"app_item_id": 0,
"bundle_id": "com.example.app",
"application_version": "1950",
"download_id": 0,
@kwylez
kwylez / LinkedText.swift
Created Apr 7, 2021 — forked from mjm/LinkedText.swift
Tappable links in SwiftUI Text view
View LinkedText.swift
import SwiftUI
private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue)
struct LinkColoredText: View {
enum Component {
case text(String)
case link(String, URL)
}
View failed_swiftui_button.swift
/// works
struct QuickChatView: View {
var body: some View {
ZStack {
VStack {
HStack {
Button(action: {
@kwylez
kwylez / gist:5337918
Last active Mar 2, 2020
Example implementation of listening for iTunes/Spotify track changes and displaying information in the NotificationCenter. Article reference: http://blog.corywiles.com/now-playing-with-spotify-and-itunes
View gist:5337918
//
// AppDelegate.m
//
//
// Created by Cory D. Wiles on 10/8/12.
// Copyright (c) 2013 Cory D. Wiles. All rights reserved.
//
#import "AppDelegate.h"
#import "iTunes.h"
View SOIntent.plist
<?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>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>SignificantOtherSiriIntent</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
View fetch-cloudkit-share.swift
public func fetchShareURL(_ callback: @escaping ((_ url: URL?) -> Void)) -> Void {
if let localRecordZoneID: CKRecordZoneID = SOUser.localICloudConversationRecordID?.zoneID {
let predicate: NSPredicate = NSPredicate(format: "TRUEPREDICATE")
let query: CKQuery = CKQuery(recordType: CloudKitConverationRecordTypeName, predicate: predicate)
let cloudkitController: CloudKitController = CloudKitController(scope: .private)
cloudkitController.perform(query, inZoneWith: localRecordZoneID, completionHandler: {results, error in
View ContextLabel.swift
//
// 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 Mar 15, 2017
Xcode Sublime Text Theme
View GHDark.dvtcolortheme
<?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>
View double-stroke-animation.swift
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
import XCPlayground
class AnimatedView: UIView {
let rightLayer: CAShapeLayer = CAShapeLayer()