Skip to content

Instantly share code, notes, and snippets.

View rldaulton's full-sized avatar
®️
Makin' Apps and Laughs

Ryan Daulton rldaulton

®️
Makin' Apps and Laughs
View GitHub Profile
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
#killyourdependencies
@Sorix
Sorix / AsynchronousOperation.swift
Last active May 22, 2024 07:15
Subclass of NSOperation (Operation) to make it asynchronous in Swift 3, 4, 5
// Created by Vasily Ulianov on 09.02.17, updated in 2019.
// License: MIT
import Foundation
/// Subclass of `Operation` that adds support of asynchronous operations.
/// 1. Call `super.main()` when override `main` method.
/// 2. When operation is finished or cancelled set `state = .finished` or `finish()`
open class AsynchronousOperation: Operation {
public override var isAsynchronous: Bool {
@0xmachos
0xmachos / Keychain.md
Last active October 10, 2024 11:32
Useful resources for working with iOS/ macOS Keychain API

Keychain API

kSecAttrAccessible Mapping

Protection Domain (pdmn) Keychain Accessibility Values
ck kSecAttrAccessibleAfterFirstUnlock
cku kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
dk kSecAttrAccessibleAlways
akpu kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
@danielgalasko
danielgalasko / RepeatingTimer.swift
Last active September 5, 2024 07:07
A repeating GCD timer that can run on a background queue
/// RepeatingTimer mimics the API of DispatchSourceTimer but in a way that prevents
/// crashes that occur from calling resume multiple times on a timer that is
/// already resumed (noted by https://github.com/SiftScience/sift-ios/issues/52
class RepeatingTimer {
let timeInterval: TimeInterval
init(timeInterval: TimeInterval) {
self.timeInterval = timeInterval
}
@kraigspear
kraigspear / NEHotspotConfigurationManager.swift
Created October 11, 2017 09:19
Connect to a WIFI hotspot programmatically in iOS 11
//
// ViewController.swift
// NetworkTest
//
// Created by Kraig Spear on 10/10/17.
// Copyright © 2017 spearware. All rights reserved.
//
import UIKit
import NetworkExtension
/**
This sample code is available under the MIT license.
*/
@available(iOS 12.0, *)
public final class ShortcutManager {
/**
This enum specifies the different intents available in our app and their various properties for the `INIntent`.
Replace this with your own shortcuts.
@DnyaneshwarWagh
DnyaneshwarWagh / UIView+Accessibility.swift
Created April 25, 2019 15:55 — forked from cjnevin/UIView+Accessibility.swift
Automatically add Accessibility Labels/Identifiers to all components that extend UIView
import UIKit
private func isExcluded(_ kind: AnyClass) -> Bool {
let name = String(describing: kind)
return (name.count > 2 && name.prefix(2) == "UI") ||
(name.count > 3 && name.prefix(3) == "_UI")
}
extension UIControl {
override open var accessibilityIdentifier: String? {
@douglashill
douglashill / MenuAlignment.swift
Last active April 15, 2023 15:45
Swizzles the iOS contextual menu and share sheet to improve usability by showing the icon on the leading side. Read more: https://douglashill.co/menu-icon-swizzling/
// Douglas Hill, March 2020
// Code for the article at https://douglashill.co/menu-icon-swizzling/
import UIKit
struct MenuAlignmentFixError: Error, CustomStringConvertible {
let description: String
}
@beader
beader / InfiniteScrollChart.swift
Last active August 28, 2024 18:16
Infinite Scrollable Bar Chart using Swift Charts
//
// InfiniteScrollChart.swift
// ChartsGallery
//
// Created by beader on 2022/11/3.
//
import SwiftUI
import Charts