Skip to content

Instantly share code, notes, and snippets.

View PaulWoodIII's full-sized avatar

Paul Wood III PaulWoodIII

View GitHub Profile
@PaulWoodIII
PaulWoodIII / GraphView.swift
Created August 25, 2019 23:55
In SwiftUI use a Geometry Reader to read the position of a child view and draw other views according to the Childs frame
//
// GraphView.swift
// ParentChildLines
//
// Created by Paul Wood on 8/25/19.
// Copyright © 2019 Paul Wood. All rights reserved.
//
import SwiftUI
import SwiftUI
struct TriangleView: View {
var body: some View {
GeometryReader { proxy in
return ZStack {
Path { path in
@PaulWoodIII
PaulWoodIII / ArrayOfArrayView.swift
Last active August 23, 2019 22:12
playing around with published sequence types, you need wrapper objects
//
// ArrayOfArrayView.swift
// PublishedList
//
// Created by Paul Wood on 8/23/19.
// Copyright © 2019 Paul Wood. All rights reserved.
//
import SwiftUI
import Combine
@PaulWoodIII
PaulWoodIII / BinarySortTreeInsertionView.swift
Created August 23, 2019 18:15
Binary Sort Visualized based on insertion order you can see a different BST. This displays why you randomize insertion of a BST
//
// ContentView.swift
// BinarySearchVisualized
//
// Created by Paul Wood on 8/23/19.
// Copyright © 2019 Paul Wood. All rights reserved.
//
import SwiftUI
import Combine
@PaulWoodIII
PaulWoodIII / BinarySearchView.swift
Created August 23, 2019 01:01
Binary Search visualized on the Apple Watch, Swiftsy Bitsy Datastructures and Algorithms
//
// BinarySearchView.swift
// WatchSort WatchKit Extension
//
// Created by Paul Wood on 8/22/19.
// Copyright © 2019 Paul Wood. All rights reserved.
//
import SwiftUI
import Combine
@PaulWoodIII
PaulWoodIII / BinarySearchView.swift
Created August 22, 2019 15:49
bare minimum to simply display a representation of a binary search tree in SwiftUI with some graphical context
//
// BinarySearchView.swift
// WatchSort WatchKit Extension
//
// Created by Paul Wood on 8/22/19.
// Copyright © 2019 Paul Wood. All rights reserved.
//
import SwiftUI
import Combine
@PaulWoodIII
PaulWoodIII / InsertionSortView.swift
Created August 21, 2019 13:25
Insertion Sort Visualized on the Apple Watch using SwiftUI
//
// ContentView.swift
// WatchSort WatchKit Extension
//
// Created by Paul Wood on 8/21/19.
// Copyright © 2019 Paul Wood. All rights reserved.
//
// InsertionSortArray take from Apple's Sample Code and modified for SwiftUI
// https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/using_collection_view_compositional_layouts_and_diffable_data_sources
// Check out the talk on diffable datasources here: https://developer.apple.com/videos/play/wwdc2019/220
@PaulWoodIII
PaulWoodIII / SwapSwiftUI.swift
Created August 21, 2019 11:39
SwiftUI Swap the position of an element in a Stack View with animation
import SwiftUI
extension String: Identifiable {
public var id: String { return self }
}
struct ContentView: View {
@State var list: [String] = ["Hello", "World"]

Keybase proof

I hereby claim:

  • I am paulwoodiii on github.
  • I am paulwoodiii (https://keybase.io/paulwoodiii) on keybase.
  • I have a public key whose fingerprint is 4CFB 8CC8 7E0B B82F 81C8 36A2 2780 1CCB 13EA 9566

To claim this, I am signing this object:

@PaulWoodIII
PaulWoodIII / SingleyLinkedList.swift
Created August 19, 2019 23:57
A playground and implementation of a SingleLinkedList in Swift
//: [Previous](@previous)
import Foundation
class SingleyLinkedList: CustomStringConvertible, Sequence {
struct Iterator: Swift.IteratorProtocol {
typealias Element = Int
internal var nextValue: SLLNode?
mutating func next() -> Int? {