Skip to content

Instantly share code, notes, and snippets.

@rbrovko
rbrovko / Display.swift
Created January 24, 2020 15:48 — forked from hfossli/Display.swift
Display mode
import UIKit
public enum DisplayType {
case unknown
case iphone4
case iphone5
case iphone6
case iphone6plus
static let iphone7 = iphone6
static let iphone7plus = iphone6plus
@rbrovko
rbrovko / xcode-swift-vers
Created December 27, 2019 13:57 — forked from yamaya/xcode-swift-vers
Xcode swift version record
# Xcode 6.2 (6C131e)
Swift version 1.1 (swift-600.0.57.4)
Target: x86_64-apple-darwin14.1.0
# Xcode 6.3 (6D570)
Apple Swift version 1.2 (swiftlang-602.0.49.3 clang-clang-602.0.49)
Target: x86_64-apple-darwin14.1.0
# Xcode 6.3.1 (6D1002)
Apple Swift version 1.2 (swiftlang-602.0.49.6 clang-602.0.49)
@rbrovko
rbrovko / NoteTests.swift
Created August 9, 2019 06:11
testNote_whenImmutableNoteCopy_rateConditions
import XCTest
@testable import Notes
class NoteTests: XCTestCase {
private let uid = "123"
private let title = "title"
private let content = "text"
private let importance = Note.Importance.normal
private var sut: Note!
@rbrovko
rbrovko / NoteTests.swift
Created August 9, 2019 06:08
testNote_whenImmutableNote_rateConditions
import XCTest
@testable import Notes
class NoteTests: XCTestCase {
private let uid = "123"
private let title = "title"
private let content = "text"
private let importance = Note.Importance.normal
private var sut: Note!
@rbrovko
rbrovko / NoteTests.swift
Created August 9, 2019 06:05
testNote_whenMutableNoteCopy_rateConditions
import XCTest
@testable import Notes
class NoteTests: XCTestCase {
private let uid = "123"
private let title = "title"
private let content = "text"
private let importance = Note.Importance.normal
private var sut: Note!
@rbrovko
rbrovko / NoteTests.swift
Created August 9, 2019 06:02
testNote_whenMutableNote_rateConditions
import XCTest
@testable import Notes
class NoteTests: XCTestCase {
private let uid = "123"
private let title = "title"
private let content = "text"
private let importance = Note.Importance.normal
private var sut: Note!
@rbrovko
rbrovko / FileNotebookTests.swift
Last active July 1, 2019 16:58
iOS Unit tests for task#3 (Test target - NoteTests.swift) or Playground
//
// FileNotebookTests.swift
// NoteTests
//
// Created by Roman Brovko on 6/19/19.
// Copyright © 2019 Roman Brovko. All rights reserved.
//
import XCTest
@testable import Note
@rbrovko
rbrovko / NoteExtensionsTests.swift
Last active June 30, 2019 16:35
iOS Unit tests for task#2 (Test target - NoteTests.swift) or Playground
//
// NoteExtensionsTests.swift
// NoteTests
//
// Created by Roman Brovko on 6/18/19.
// Copyright © 2019 Roman Brovko. All rights reserved.
//
import XCTest
@testable import Note
@rbrovko
rbrovko / NoteTests.swift
Created June 19, 2019 17:44
iOS Unit tests for task#1 (Test target - NoteTests.swift) or Playground
//
// NoteTests.swift
// NoteTests
//
// Created by Roman Brovko on 6/17/19.
// Copyright © 2019 Roman Brovko. All rights reserved.
//
import XCTest
@testable import Note
@rbrovko
rbrovko / LetTheCoWGo.swift
Created February 8, 2019 13:21 — forked from drewmccormack/LetTheCoWGo.swift
Demonstrates how a Swift value constant can mutate when using Copy-on-Write (CoW) and multi-threading.
import Foundation
struct NuclearPowerStationOperator {
class Storage {
var turnOffCores: Bool = false
func copy() -> Storage {
let new = Storage()
new.turnOffCores = turnOffCores
return new