This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String | |
let barBool: Bool | |
let foo1: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String | |
let barBool: Bool | |
let foo1: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cells: [OurStructs] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for element in cells { | |
switch element { | |
case .one(let typeOne): | |
print("\(typeOne.bar1) \(typeOne.foo1) \(typeOne.foo2) ") | |
case .two(let typeTwo): | |
print("\(typeTwo.fooString) \(typeTwo.foo1) \(typeTwo.barBool) ") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
let node1 = XMLElement(name: "first", stringValue: "Donnie") | |
let node2 = XMLElement(name: "last", stringValue: "Duck") | |
let nameNode = XMLElement(name: "name") | |
nameNode.addChild(node1) | |
nameNode.addChild(node2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hexColour = String(colour, radix: 16, uppercase: true) | |
let hexColourString = "000000\(hexColour)" | |
let range = hexColourString.index(hexColourString.endIndex, offsetBy: -6)..<hexColourString.endIndex | |
let hexHashColourString = hexColourString[range] | |
let textAttributeValue = "{font color='#\(hexHashColourString)'}{*font}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppVersion.swift | |
// | |
// Created by Gregg Jaskiewicz on 08/12/2018. | |
// Copyright © 2018 Gregg Jaskiewicz Clear Prop Ltd. All rights reserved. | |
// | |
import Foundation | |
public struct AppVersion: Comparable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension TimeInterval { | |
static var second: TimeInterval { return 1 } | |
static var minute: TimeInterval { return 60 } | |
static var hour: TimeInterval { return 60 * self.minute } | |
static var day: TimeInterval { return 24 * self.hour } | |
static var week: TimeInterval { return 7 * self.day } | |
} |