Skip to content

Instantly share code, notes, and snippets.

View splons's full-sized avatar

Steve Splonskowski splons

  • Oregon City, OR
View GitHub Profile
@jeandavid
jeandavid / UIResponder+ParentViewController.swift
Created December 20, 2021 10:25
Get the parent view controller by using the UIResponder chain
import UIKit
extension UIResponder {
@objc
public var parentViewController: UIViewController? {
return next as? UIViewController ?? next?.parentViewController
}
}
@sooop
sooop / StreamReader.swift
Last active June 23, 2024 22:49
Read a large text file line by line - Swift 3
import Foundation
class StreamReader {
let encoding: String.Encoding
let chunkSize: Int
let fileHandle: FileHandle
var buffer: Data
let delimPattern : Data
var isAtEOF: Bool = false