This file contains hidden or 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
| /** | |
| Purpose: | |
| Convert (or Serialize) an object to a JSON String or Dictionary. | |
| Usage: | |
| Use 'Serialize.toJSON' on instances of classes that: | |
| - Inherit from NSObject | |
| - Implement 'Serializable' protocol | |
| - Implement the property 'jsonProperties' and return an array of strings with names of all the properties to be serialized | |
| Inspiration/Alternative: | |
| https://gist.github.com/anaimi/ad336b44d718430195f8 |
This file contains hidden or 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
| //: # TimeZones | |
| import Foundation | |
| let tzs = NSTimeZone.knownTimeZoneNames() | |
| var seperated : [String:Array<String>] = [String:[String]]() | |
| func addToSeperated(_ region : String,_ place:String) -> Void { | |
| if let _ = seperated[region] { | |
This file contains hidden or 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
| // | |
| // TestSomethingCoolTests.m | |
| // TestSomethingCoolTests | |
| // | |
| // Created by Paul Wood on 9/14/16. | |
| // Copyright © 2016 Paul Wood. All rights reserved. | |
| // | |
| #import <XCTest/XCTest.h> |
This file contains hidden or 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
| #!/usr/bin/env xcrun swift | |
| import Foundation | |
| print("This is a swift script!") | |
| print("Arguments: \(ProcessInfo.processInfo.arguments)") |
This file contains hidden or 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
| // | |
| // Emoji.swift | |
| // Tipski | |
| // | |
| // Created by Paul Wood on 10/29/16. | |
| // Copyright © 2016 Paul Wood. All rights reserved. | |
| // | |
| // Assumes you have a file named emojis.json as a resource | |
| // That file can be found here: https://github.com/muan/emoji/blob/gh-pages/javascripts/emojilib/emojis.json | |
| // Thanks so much to the contributors of emojilib! |
This file contains hidden or 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 XCTest | |
| import Combine | |
| import Entwine | |
| import EntwineTest | |
| class EntwineTestSchedulerExampleTests: XCTestCase { | |
| func testSchedulerInjection() { | |
| let scheduler = TestScheduler(initialClock: 0) | |
| var didSink = false |
This file contains hidden or 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
| //: A UIKit based Playground for presenting user interface | |
| import SwiftUI | |
| import UIKit | |
| import PlaygroundSupport | |
| import Combine | |
| class ObservingSource: BindableObject { | |
| var someString: String = "" | |
| var willChange = PassthroughSubject<String,Never>() |
This file contains hidden or 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
| //: [Previous](@previous) | |
| import Foundation | |
| import SwiftUI | |
| import UIKit | |
| import PlaygroundSupport | |
| // This doesnt work because the protocol has an assoicated Type | |
| // To understand more | |
| // https://chariotsolutions.com/screencast/philly-ete-2019-rob-napier-generic-swift-it-isnt-supposed-to-hurt/ |
This file contains hidden or 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
| //: [Previous](@previous) | |
| import SwiftUI | |
| import PlaygroundSupport | |
| protocol Nameable { | |
| var name: String { get } | |
| } | |
| struct Name: Nameable { |
This file contains hidden or 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
| //: [Previous](@previous) | |
| import SwiftUI | |
| import UIKit | |
| import PlaygroundSupport | |
| struct IdentifiableActionSheet : View { | |
| @State var displaySheet: SheetTypes? = nil | |