Skip to content

Instantly share code, notes, and snippets.

View kwylez's full-sized avatar

Cory D. Wiles kwylez

View GitHub Profile
struct CustomSegmentControl: View {
@Binding
var selection: String
private var labels: Array<String> {
return [
"Precautions",
"Prework",
"Hazards"
//
// Trigger_Gesture_Magnification.swift
// SwiftUIAnimations
//
// Created by Mark Moeykens on 11/5/19.
// Copyright © 2019 Mark Moeykens. All rights reserved.
//
import SwiftUI
@kwylez
kwylez / LinkedText.swift
Created April 7, 2021 20:28 — forked from mjm/LinkedText.swift
Tappable links in SwiftUI Text view
import SwiftUI
private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue)
struct LinkColoredText: View {
enum Component {
case text(String)
case link(String, URL)
}
/// works
struct QuickChatView: View {
var body: some View {
ZStack {
VStack {
HStack {
Button(action: {
<?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>
{
"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,
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
@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>
//
// ContextLabel.swift
// ContextLabel
//
// Created by Cory D. Wiles
// Copyright (c) 2017 Cory D. Wiles. All rights reserved.
//
import Foundation
import UIKit
@kwylez
kwylez / EXIFImage-playground.swift
Created February 1, 2017 14:10
Modifying EXIF Data with Swift 3
//: 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)!