Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Hughes kylehughes

View GitHub Profile
@kylehughes
kylehughes / MediaPicker.swift
Created Sep 6, 2022
MPMediaPickerController wrapped for SwiftUI
View MediaPicker.swift
//
// MediaPicker.swift
// Music Triage
//
// Created by Kyle Hughes on 9/6/22.
//
import Foundation
import MediaPlayer
import SwiftUI
@kylehughes
kylehughes / ios-settings-deep-links.md
Last active Jan 11, 2022
Deep links in the iOS Settings app.
View ios-settings-deep-links.md
@kylehughes
kylehughes / TornRectangle.swift
Last active Jun 2, 2022
A rectangle shape for SwiftUI that can render any edge like a torn piece of paper.
View TornRectangle.swift
// Copyright 2021 Kyle Hughes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
// Software.
//
@kylehughes
kylehughes / HapticFeedback.swift
Last active May 17, 2022
Convenient Swift abstractions for generating haptic feedback on iOS.
View HapticFeedback.swift
// Copyright 2021 Kyle Hughes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
// Software.
//
@kylehughes
kylehughes / Grid.swift
Last active Jan 2, 2022
A view modifier for SwiftUI that renders a configurable grid on top of the view. It is useful while designing in code.
View Grid.swift
// Copyright 2022 Kyle Hughes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
// Software.
//
@kylehughes
kylehughes / View+Conditional.swift
Created Aug 28, 2020
SwiftUI: Conditionally Configuring Views
View View+Conditional.swift
import SwiftUI
public extension View {
// MARK: Conditionally Configuring Views
@ViewBuilder func `if`<TrueView>(
_ condition: Bool,
transform: (Self) -> TrueView
) -> some View where TrueView: View {
if condition {
@kylehughes
kylehughes / Collector.swift
Created May 27, 2020
Batch Collector Implementation
View Collector.swift
//
// Collector.swift
// InformationSuperhighway
//
// Created by Kyle Hughes on 2/26/20.
// Copyright © 2020 Kyle Hughes. All rights reserved.
//
final class Collector<Item> {
typealias FlushHandler = ([Item]) -> Void
View dbh-video.xml
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:atom="http://www.w3.org/2005/Atom/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>The Dan Benjamin Hour with Video</title>
<link>http://web.5by5.tv/dbh</link>
<pubDate>Tue, 02 Jun 2015 22:00:00 GMT</pubDate>
<description>The Dan Benjamin Hour is a live daily talk show exploring the latest in geek culture, technology, gear, and entertainment, catching emerging stories before they become headlines and skirting the mainstream with wide-ranging topics, unorthodox opinions, an offbeat in-studio crew, an expansive guest list, and calls from live listeners. Dan's irreverent sense of humor and interview style bring a fresh perspective each weekday. Hosted by Da
@kylehughes
kylehughes / .gitignore
Created Mar 23, 2013 — forked from adamgit/.gitignore
A thoroughly thought out .gitignore for Xcode projects.
View .gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,