Skip to content

Instantly share code, notes, and snippets.

View kalub92's full-sized avatar

Caleb Stultz kalub92

View GitHub Profile
ld: warning: dylib (/Users/cstultz/Library/Developer/Xcode/DerivedData/EX-dvopbqpxtghxchfetmgezzfsuptf/Build/Products/Debug-iphonesimulator/NetworkLogger.framework/NetworkLogger) was built for newer iOS Simulator version (17.4) than being linked (16.0)
duplicate symbol '_$s18SamplePackageB_iOS0A6StructVACycfC' in:
/Users/cstultz/Library/Developer/Xcode/DerivedData/EX-dvopbqpxtghxchfetmgezzfsuptf/Build/Products/Debug-iphonesimulator/SamplePackageB-iOS.o
/Users/cstultz/Library/Developer/Xcode/DerivedData/EX-dvopbqpxtghxchfetmgezzfsuptf/Build/Products/Debug-iphonesimulator/Pods_Example_EX.framework/Pods_Example_EX(SamplePackageB-iOS.o)
duplicate symbol '_$s18SamplePackageB_iOS0A6StructVMa' in:
/Users/cstultz/Library/Developer/Xcode/DerivedData/EX-dvopbqpxtghxchfetmgezzfsuptf/Build/Products/Debug-iphonesimulator/SamplePackageB-iOS.o
/Users/cstultz/Library/Developer/Xcode/DerivedData/EX-dvopbqpxtghxchfetmgezzfsuptf/Build/Products/Debug-iphonesimulator/Pods_Example_EX.framework/Pods_Example_EX(Sampl
playVideo
.flatMapLatest({ [weak self] _ -> SafeSignal<()> in
guard let self = self else { return Signal.completed() }
return self.performLoadVideo()
})
.lane("Play Video")
.observeNext {}
.dispose(in: bag)
@kalub92
kalub92 / Codable-Example.swift
Last active October 25, 2018 18:09
Using SWAPI to test out Codable (Encodable/Decodable) for JSON in Swift 4.2
import Foundation
// Struct conforming to Codable and utilizing the CodingKeys enum to set up parameter to match how API data is organized.
struct Character: Codable {
let name: String
let height: String
let mass: String
let hairColor: String
enum CodingKeys: String, CodingKey {
@kalub92
kalub92 / SearchVC.swift
Created October 17, 2018 23:19
A search ViewController from a meal planning app I'm working on in my spare time.
//
// SearchVC.swift
// Meals
//
// Created by Caleb Stultz on 9/26/18.
// Copyright © 2018 Caleb Stultz. All rights reserved.
//
/*
Code is from a collaborative meal planning app I'm building. This ViewController allows a user to enter an ingredient as a search query into a UISearchBar instance and search for recipes with that ingredient present. Each UITableViewCell has an image of type CustomImageView that allows for synchronous image caching/loading in the background.
import Foundation
struct Stack {
private var items: [String] = []
func peek() -> String {
guard let topElement = items.first else { fatalError("This stack is empty.") }
return topElement
}
extension Stack: CustomStringConvertible {
var description: String {
let topDivider = "---Stack---\n"
let bottomDivider = "\n-----------\n"
let stackElements = array.joined(separator: "\n")
return topDivider + stackElements + bottomDivider
}
}
var nameStack = Stack()
nameStack.push("Caleb")
nameStack.push("Charles")
nameStack.push("Tina")
print(nameStack)
import Foundation
struct Stack {
private var items: [String] = []
func peek() -> String {
guard let topElement = items.first else { fatalError("This stack is empty.") }
return topElement
}
import Foundation
struct Stack {
private var items: [String] = []
func peek() -> String {
guard let topElement = items.first else { fatalError("This stack is empty.") }
return topElement
}
import Foundation
struct Stack {
private var items: [String] = []
func peek() -> String {
guard let topElement = items.first else { fatalError("This stack is empty.") }
return topElement
}
}