Skip to content

Instantly share code, notes, and snippets.

View annjose's full-sized avatar

Ann Catherine Jose annjose

View GitHub Profile
@annjose
annjose / XcodePlaygroundUnitTests.swift
Last active December 21, 2022 08:24
Run unit tests inside Xcode playground
//: [Previous](@previous)
import XCTest
struct TodoItem {
let title: String
let dueBy: Date?
init(title: String) {
self.title = title
@annjose
annjose / CleanerSwiftCode.swift
Last active November 22, 2016 00:20
Code sample demonstrated in Rob Napier video on writing clean Swift code
// sample code for Rob Napier's video 'Swift Legacy Functional Programming' found in Realm News
// the article also explains how to use Swift to avoid bugs and write cleaner code
// URL: https://realm.io/news/tryswift-rob-napier-swift-legacy-functional-programming/
// ============ Use Enum for OR relationship; use Struct for AND relationship =======================
struct Credential {
let username: String
let password: String
}