import PackageDescription

let package = Package(
    name: "JWTKeychain",
    dependencies: [
        .Package(url: "https://github.com/vapor/vapor.git", Version(2,0,0, prereleaseIdentifiers: ["beta"])),
        .Package(url: "https://github.com/vapor/mysql-provider.git", Version(2,0,0, prereleaseIdentifiers: ["beta"])),
        .Package(url: "https://github.com/vapor/jwt-provider.git", Version(1,0,0, prereleaseIdentifiers: ["beta"])),
        .Package(url: "https://github.com/vapor/bcrypt.git", Version(1,0,0, prereleaseIdentifiers: ["beta"])),
        .Package(url: "https://github.com/nodes-vapor/sugar.git", Version(2,0,0, prereleaseIdentifiers: ["beta"])),
        .Package(url: "https://github.com/nodes-vapor/flash.git", Version(1,0,0, prereleaseIdentifiers: ["beta"]))
    ]
)

Update dependencies for Vapor 2

import PackageDescription

let package = Package(
    name: "JWTKeychain",
    dependencies: [
        .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2),
        .Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 2),
        // TODO: update url once PR is accepted
        .Package(url: "https://github.com/siemensikkema/jwt-provider.git", majorVersion: 1),
        .Package(url: "https://github.com/vapor/bcrypt.git", majorVersion: 1),
        .Package(url: "https://github.com/nodes-vapor/sugar.git", majorVersion: 2),
        .Package(url: "https://github.com/nodes-vapor/flash.git", majorVersion: 1)
    ]
)


// swift-tools-version:3.1

import PackageDescription

let package = Package(
    name: "ReactantUI",
    targets: [
        Target(name: "Tokenizer", dependencies: []),
        Target(name: "Generator", dependencies: [
            .Target(name: "Tokenizer")
        ]),

        Target(name: "reactant-ui", dependencies: [
            .Target(name: "Generator")
        ]),
    ],
    dependencies: [
        //.Package(url: "https://github.com/Carthage/Commandant.git", versions: Version(0, 11, 3)..<Version(0, 11, .max)),
        //.Package(url: "https://github.com/jpsim/SourceKitten.git", versions: Version(0, 15, 0)..<Version(0, 17, .max)),
        .Package(url: "https://github.com/TadeasKriz/FileKit.git", Version(4, 0, 2)),
    ],
    exclude: [
        "Sources/Live",
    ]
)

Update FileKit for Swift 4

// swift-tools-version:3.1

import PackageDescription

let package = Package(
    name: "ReactantUI",
    targets: [
        Target(name: "Tokenizer", dependencies: []),
        Target(name: "Generator", dependencies: [
            .Target(name: "Tokenizer")
        ]),

        Target(name: "reactant-ui", dependencies: [
            .Target(name: "Generator")
        ]),
    ],
    dependencies: [
        //.Package(url: "https://github.com/Carthage/Commandant.git", versions: Version(0, 11, 3)..<Version(0, 11, .max)),
        //.Package(url: "https://github.com/jpsim/SourceKitten.git", versions: Version(0, 15, 0)..<Version(0, 17, .max)),
        .Package(url: "https://github.com/nvzqz/FileKit.git", versions: Version(5, 0, 0)..<Version(5, 0, .max),
    ],
    exclude: [
        "Sources/Live",
    ]
)


//
//  Store.swift
//  ToDo
//
//  Created by Julian Grosshauser on 12/08/15.
//  Copyright © 2015 Julian Grosshauser. All rights reserved.
//

import Foundation
import RealmSwift

class Store {

    //MARK: Properties

    private let realm = try! Realm()

    //MARK: Get Objects

    func objects<T: Object>(type: T.Type) -> Results<T> {
        return realm.objects(type)
    }

    //MARK: Managing Lists

    func addList(name: String) {
        let list = List()
        list.name = name

        realm.write { [unowned self] in
            self.realm.add(list)
        }
    }

    func appendTodo(text: String, list: List) {
        let todo = Todo()
        todo.text = text

        realm.write {
            list.todos.append(todo)
        }
    }

    //MARK: Managing Todos

    func deleteList(listID: String) {
        guard let list = realm.objects(List).filter("id == %@", listID).first else { return }

        realm.write { [unowned self] in
            self.realm.delete(list)
        }
    }

    func removeTodo(todoID: String, list: List) {
        guard let index = list.todos.indexOf("id == %@", todoID) else { return }
        let todo = list.todos[index]

        realm.write { [unowned self] in
            list.todos.removeAtIndex(index)
            self.realm.delete(todo)
        }
    }
}

Use convenience initializers of model classes

//
//  Store.swift
//  ToDo
//
//  Created by Julian Grosshauser on 12/08/15.
//  Copyright © 2015 Julian Grosshauser. All rights reserved.
//

import Foundation
import RealmSwift

class Store {

    //MARK: Properties

    private let realm = try! Realm()

    //MARK: Get Objects

    func objects<T: Object>(type: T.Type) -> Results<T> {
        return realm.objects(type)
    }

    //MARK: Managing Lists

    func addList(name: String) {
        let list = List(name: name)

        realm.write { [unowned self] in
            self.realm.add(list)
        }
    }

    func appendTodo(text: String, list: List) {
        let todo = Todo(text: text)

        realm.write {
            list.todos.append(todo)
        }
    }

    //MARK: Managing Todos

    func deleteList(listID: String) {
        guard let list = realm.objects(List).filter("id == %@", listID).first else { return }

        realm.write { [unowned self] in
            self.realm.delete(list)
        }
    }

    func removeTodo(todoID: String, list: List) {
        guard let index = list.todos.indexOf("id == %@", todoID) else { return }
        let todo = list.todos[index]

        realm.write { [unowned self] in
            list.todos.removeAtIndex(index)
            self.realm.delete(todo)
        }
    }
}


// swift-tools-version:4.2

import PackageDescription

let package = Package(
    name: "SteamPress",
    products: [
        .library(name: "SteamPress", targets: ["SteamPress"]),
    ],
    dependencies: [
    	.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
        .package(url: "https://github.com/scinfu/SwiftSoup.git", from: "2.0.0"),
        .package(url: "https://github.com/vapor-community/markdown.git", from: "0.4.0"),
        .package(url: "https://github.com/vapor/leaf.git", from: "3.0.0"),
        .package(url: "https://github.com/vapor/auth.git", from: "2.0.0"),
    ],
    targets: [
        .target(name: "SteamPress", dependencies: ["Vapor", "SwiftSoup", "SwiftMarkdown", "Leaf", "Authentication"]),
        .testTarget(name: "SteamPressTests", dependencies: ["SteamPress"]),
    ]
)

Set to 5.1 as that's what we now require

// swift-tools-version:5.1

import PackageDescription

let package = Package(
    name: "SteamPress",
    products: [
        .library(name: "SteamPress", targets: ["SteamPress"]),
    ],
    dependencies: [
    	.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
        .package(url: "https://github.com/scinfu/SwiftSoup.git", from: "2.0.0"),
        .package(url: "https://github.com/vapor-community/markdown.git", from: "0.4.0"),
        .package(url: "https://github.com/vapor/leaf.git", from: "3.0.0"),
        .package(url: "https://github.com/vapor/auth.git", from: "2.0.0"),
    ],
    targets: [
        .target(name: "SteamPress", dependencies: ["Vapor", "SwiftSoup", "SwiftMarkdown", "Leaf", "Authentication"]),
        .testTarget(name: "SteamPressTests", dependencies: ["SteamPress"]),
    ]
)


//  Copyright (c) 2015 Rob Rix. All rights reserved.

final class DisjointSetTests: XCTestCase {
	let set: DisjointSet<String> = [ "a", "b", "c", "d", "e" ]

	func testEveryElementIsInitiallyDisjoint() {
		var set = self.set
		if !reduce(lazy(enumerate(set))
			.map { index, _ in (index, set.find(index)) }
			.map(==), true, { $0 && $1 }) {
				failure("it didn't work")
		}
	}

	func testUnionCombinesPartitions() {
		var set = self.set
		set.union(1, 3)
		assertEqual(set.findAll().count, 4)
	}
}

// MARK: - Imports

import Assertions
import DisjointSet
import XCTest

Test new elements are disjoint.

//  Copyright (c) 2015 Rob Rix. All rights reserved.

final class DisjointSetTests: XCTestCase {
	let set: DisjointSet<String> = [ "a", "b", "c", "d", "e" ]

	func testEveryElementIsInitiallyDisjoint() {
		var set = self.set
		if !reduce(lazy(enumerate(set))
			.map { index, _ in (index, set.find(index)) }
			.map(==), true, { $0 && $1 }) {
				failure("it didn't work")
		}
	}

	func testUnionCombinesPartitions() {
		var set = self.set
		set.union(1, 3)
		assertEqual(set.findAll().count, 4)
	}

	func testAppendedElementsAreInitiallyDisjoint() {
		var set = self.set
		set.append("f")
		assert(set.find(5), ==, 5)
	}
}

// MARK: - Imports

import Assertions
import DisjointSet
import XCTest


//
// Xcore
// Copyright © 2016 Xcore
// MIT license, see LICENSE file for details
//

import UIKit

public typealias CarouselViewCellType = UICollectionViewCell & CarouselViewCellRepresentable
public typealias CarouselAccessibilityItem = (label: String, value: String)

public protocol CarouselAccessibilitySupport {
    func accessibilityItem(index: Int) -> CarouselAccessibilityItem?
}

public protocol CarouselViewModelRepresentable: CarouselAccessibilitySupport {
    associatedtype Model

    func numberOfItems() -> Int
    func itemViewModel(index: Int) -> Model?
}

public protocol CarouselViewCellRepresentable: Reusable {
    associatedtype Model

    func configure(_ model: Model)

    func didSelectItem(_ callback: @escaping () -> Void)

    /// A convenience method to specify the cell width.
    /// The default value is width of the collection view.
    func preferredWidth(collectionView: UICollectionView) -> CGFloat
}

extension CarouselViewCellRepresentable {
    public func preferredWidth(collectionView: UICollectionView) -> CGFloat {
        collectionView.frame.width
    }

    public func didSelectItem(_ callback: @escaping () -> Void) { }
}

Support additional views for CarouselAccessibilityItem

//
// Xcore
// Copyright © 2016 Xcore
// MIT license, see LICENSE file for details
//

import UIKit

public typealias CarouselViewCellType = UICollectionViewCell & CarouselViewCellRepresentable
public typealias CarouselAccessibilityItem = (label: String, value: String, additionalViews: [Any]?)

public protocol CarouselAccessibilitySupport {
    func accessibilityItem(index: Int) -> CarouselAccessibilityItem?
}

public protocol CarouselViewModelRepresentable: CarouselAccessibilitySupport {
    associatedtype Model

    func numberOfItems() -> Int
    func itemViewModel(index: Int) -> Model?
}

public protocol CarouselViewCellRepresentable: Reusable {
    associatedtype Model

    func configure(_ model: Model)

    func didSelectItem(_ callback: @escaping () -> Void)

    /// A convenience method to specify the cell width.
    /// The default value is width of the collection view.
    func preferredWidth(collectionView: UICollectionView) -> CGFloat
}

extension CarouselViewCellRepresentable {
    public func preferredWidth(collectionView: UICollectionView) -> CGFloat {
        collectionView.frame.width
    }

    public func didSelectItem(_ callback: @escaping () -> Void) { }
}


//
//  Created by Pierluigi Cifani on 05/08/15.
//  Copyright (c) 2016 Blurred Software SL. All rights reserved.
//

import Foundation

// MARK: - Endpoint

/**
 Protocol used to describe what is needed
 in order to send REST API requests.
*/
public protocol Endpoint {

    /// The path for the request
    var path: String { get }

    /// The HTTPMethod for the request
    var method: HTTPMethod { get }

    /// Optional parameters for the request
    var parameters: [String : AnyObject]? { get }

    /// How the parameters should be encoded
    var parameterEncoding: HTTPParameterEncoding { get }

    /// The HTTP headers to be sent
    var httpHeaderFields: [String : String]? { get }
}

//  This is the default implementation for Endpoint
extension Endpoint {
    public var method: HTTPMethod {
        return .GET
    }

    var parameters: [String : AnyObject]? {
        return nil
    }

    public var parameterEncoding: HTTPParameterEncoding {
        return .URL
    }

    public var httpHeaderFields: [String : String]? {
        return nil
    }
}

Make default implementation of parameters public

//
//  Created by Pierluigi Cifani on 05/08/15.
//  Copyright (c) 2016 Blurred Software SL. All rights reserved.
//

import Foundation

// MARK: - Endpoint

/**
 Protocol used to describe what is needed
 in order to send REST API requests.
*/
public protocol Endpoint {

    /// The path for the request
    var path: String { get }

    /// The HTTPMethod for the request
    var method: HTTPMethod { get }

    /// Optional parameters for the request
    var parameters: [String : AnyObject]? { get }

    /// How the parameters should be encoded
    var parameterEncoding: HTTPParameterEncoding { get }

    /// The HTTP headers to be sent
    var httpHeaderFields: [String : String]? { get }
}

//  This is the default implementation for Endpoint
extension Endpoint {
    public var method: HTTPMethod {
        return .GET
    }

    public var parameters: [String : AnyObject]? {
        return nil
    }

    public var parameterEncoding: HTTPParameterEncoding {
        return .URL
    }

    public var httpHeaderFields: [String : String]? {
        return nil
    }
}


//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
// Experimental APIs of the Swift Standard Library
//
// This library contains experimental APIs that can be subject to change or
// removal.  We don't guarantee API or ABI stability for this library.
//
//===----------------------------------------------------------------------===//

/// The function composition operator is the only user-defined operator that
/// operates on functions.  That's why the numeric value of precedence does
/// not matter right now.
infix operator ○ { associativity left precedence 100 }

/// Function composition.
///
/// ::
///
///   (g ○ f)(x) == g(f(x))
///
/// :returns: a function that applies ``g`` to the result of applying ``f``
/// to the argument of the new function.
public func ○<T, U, V>(g: U -> V, f: T -> U) -> (T -> V) {
  return { g(f($0)) }
}

Reword comment for the function composition operator

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
// Experimental APIs of the Swift Standard Library
//
// This library contains experimental APIs that can be subject to change or
// removal.  We don't guarantee API or ABI stability for this library.
//
//===----------------------------------------------------------------------===//

/// The function composition operator is the only user-defined operator that
/// operates on functions.  That's why the numeric value of precedence does
/// not matter right now.
infix operator ○ { associativity left precedence 100 }

/// Compose functions.
///
/// ::
///
///   (g ○ f)(x) == g(f(x))
///
/// :returns: a function that applies ``g`` to the result of applying ``f``
/// to the argument of the new function.
public func ○<T, U, V>(g: U -> V, f: T -> U) -> (T -> V) {
  return { g(f($0)) }
}


//
//  RequestBuilder.swift
//  BreweryDB
//
//  Created by Jake Welton on 1/30/16.
//  Copyright © 2016 Jake Welton. All rights reserved.
//

import Foundation

enum RequestEndPoint: String {
    case Beer = "beer"
    case Beers = "beers"
}
class RequestBuilder {

}

Extend NSURL to suppose RequestEndPoint type

//
//  RequestBuilder.swift
//  BreweryDB
//
//  Created by Jake Welton on 1/30/16.
//  Copyright © 2016 Jake Welton. All rights reserved.
//

import Foundation

enum RequestEndPoint: String {
    case Beer = "beer"
    case Beers = "beers"
}

extension NSURL {
    func URLByAppendingPathComponent(endPoint: RequestEndPoint) -> NSURL {
        return URLByAppendingPathComponent(endPoint.rawValue)
    }
}

class RequestBuilder {

}


// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-sil -module-name coverage_member_closure %s | FileCheck %s

class C {
  // CHECK-LABEL: sil_coverage_map {{.*}}// coverage_member_closure.C.__allocating_init
  init() {
    if (false) { // CHECK: [[@LINE]]:16 -> [[@LINE+2]]:6 : 1
      // ...
    }
  }

  // Closures in members show up at the end of the constructor's map.
  // CHECK-NOT: sil_coverage_map
  // CHECK: [[@LINE+1]]:55 -> [[@LINE+1]]:77 : 2
  var completionHandler: (String, [String]) -> Void = {(foo, bar) in return}
}

Fix whitespaces for a closure

// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-sil -module-name coverage_member_closure %s | FileCheck %s

class C {
  // CHECK-LABEL: sil_coverage_map {{.*}}// coverage_member_closure.C.__allocating_init
  init() {
    if (false) { // CHECK: [[@LINE]]:16 -> [[@LINE+2]]:6 : 1
      // ...
    }
  }

  // Closures in members show up at the end of the constructor's map.
  // CHECK-NOT: sil_coverage_map
  // CHECK: [[@LINE+1]]:55 -> [[@LINE+1]]:79 : 2
  var completionHandler: (String, [String]) -> Void = { (foo, bar) in return }
}


// swift-tools-version:5.1
import PackageDescription

let package = Package(
    name: "Tentacle",
    products: [
        .library(name: "Tentacle", targets: ["Tentacle"]),
    ],
    dependencies: [
        .package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "6.0.0"),
    ],
    targets: [
        .target(name: "Tentacle", dependencies: ["ReactiveSwift"]),
        .testTarget(name: "TentacleTests", dependencies: ["Tentacle"]),
    ],
    swiftLanguageVersions: [.v5]
)

Set Swift Tools Version to current

// swift-tools-version:5.2
import PackageDescription

let package = Package(
    name: "Tentacle",
    products: [
        .library(name: "Tentacle", targets: ["Tentacle"]),
    ],
    dependencies: [
        .package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "6.0.0"),
    ],
    targets: [
        .target(name: "Tentacle", dependencies: ["ReactiveSwift"]),
        .testTarget(name: "TentacleTests", dependencies: ["Tentacle"]),
    ],
    swiftLanguageVersions: [.v5]
)


// swift-tools-version:5.2

import PackageDescription

let package = Package(
    name: "GLib",
    products: [ .library(name: "GLib", targets: ["GLib"]) ],
    targets: [
        .systemLibrary(name: "CGLib", pkgConfig: "glib-2.0 gio-unix-2.0",
            providers: [
                .brew(["glib", "glib-networking", "gobject-introspection"]),
                .apt(["libglib2.0-dev", "glib-networking", "gobject-introspection", "libgirepository1.0-dev"])
            ]),
        .target(name: "GLib", dependencies: ["CGLib"]),
        .testTarget(name: "GLibTests", dependencies: ["GLib"]),
    ]
)

Remove the need for .build

// swift-tools-version:5.2

import PackageDescription

let package = Package(
    name: "GLib",
    products: [ .library(name: "GLib", targets: ["GLib"]) ],
    targets: [
        .systemLibrary(name: "CGLib", pkgConfig: "gio-unix-2.0",
            providers: [
                .brew(["glib", "glib-networking", "gobject-introspection"]),
                .apt(["libglib2.0-dev", "glib-networking", "gobject-introspection", "libgirepository1.0-dev"])
            ]),
        .target(name: "GLib", dependencies: ["CGLib"]),
        .testTarget(name: "GLibTests", dependencies: ["GLib"]),
    ]
)


// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
// REQUIRES: tools-release,no_asserts

struct Stringly {
  init(string: String) {}
  init(format: String, _ args: Any...) {}
  init(stringly: Stringly) {}
}

[Int](0..<1).map {
  print(Stringly(format: "%d: ", $0 * 2) + ["a", "b", "c", "d"][$0 * 2] + ",")
  // expected-error@-1 {{expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions}}
}

Make test-case for rdar://problem/20859567 slightly more complicated

// RUN: %target-typecheck-verify-swift -solver-expression-time-threshold=1
// REQUIRES: tools-release,no_asserts

struct Stringly {
  init(string: String) {}
  init(format: String, _ args: Any...) {}
  init(stringly: Stringly) {}
}

[Int](0..<1).map {
  // expected-error@-1 {{expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions}}
  print(Stringly(format: "%d: ", $0 * 2 * 42) + ["a", "b", "c", "d", "e", "f", "g"][$0 * 2] + ",")
}


//  Copyright © 2015 Rob Rix. All rights reserved.

final class DatatypeTests: XCTestCase {
	func testDatatypeWithZeroConstructorsIsUnitType() {
		assert(Datatype(constructors: []).value("A"), ==, .UnitType)
	}
}

import Assertions
@testable import Manifold
import XCTest

Test the value of single-constructor datatypes.

//  Copyright © 2015 Rob Rix. All rights reserved.

final class DatatypeTests: XCTestCase {
	func testDatatypeWithZeroConstructorsIsUnitType() {
		assert(Datatype(constructors: []).value("A"), ==, .UnitType)
	}

	func testDatatypeWithOneConstructorIsTypeOfConstructedValue() {
		assert(Datatype(constructors: [ ("a", .Argument(.BooleanType, const(.End))) ]).value("A"), ==, .lambda(.BooleanType, const(.Product(.BooleanType, .UnitType))))
	}
}

import Assertions
@testable import Manifold
import Prelude
import XCTest


protocol Logging {
  func logError(error: ErrorType)
}

Implement error and request logging

import Foundation

// MARK: - Errors

protocol ErrorLogging {
  func logError(error: ErrorType)
}

struct ErrorLogger: ErrorLogging {

  func logError(error: ErrorType) {
    NSLog("\(error)")
  }
}

// MARK: - Requests

protocol RequestLogging {
  func logRequest(request: NSURLRequest)
}

struct RequestLogger: RequestLogging {

  func logRequest(request: NSURLRequest) {
    guard let URLString = request.URL?.absoluteString else {
      return
    }

    NSLog("\(URLString)")
  }
}


//
//  ActiveRecord.swift
//  FirebaseCommunity
//
//  Created by Victor Alisson on 15/08/17.
//

import Foundation

public protocol ActiveRecord: Writeable, Deletable, Readable, Updatable, Storator {

}

Redefine joining of protocols that define Active Record

//
//  ActiveRecord.swift
//  FirebaseCommunity
//
//  Created by Victor Alisson on 15/08/17.
//

import Foundation

public protocol ActiveRecord: Writeable, Deletable, Readable, ReadableInRealTime, Updatable, Storator {

}


// swift-tools-version:4.0

// Package.swift
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See LICENSE.txt for license information:
// https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt
//

import PackageDescription

let package = Package(
  name: "SwiftProtobuf",
  products: [
    .executable(name: "protoc-gen-swift", targets: ["protoc-gen-swift"]),
    .library(name: "SwiftProtobuf", type: .static, targets: ["SwiftProtobuf"]),
    .library(name: "SwiftProtobufPluginLibrary", targets: ["SwiftProtobufPluginLibrary"]),
  ],
  targets: [
    .target(name: "SwiftProtobuf"),
    .target(name: "SwiftProtobufPluginLibrary",
            dependencies: ["SwiftProtobuf"]),
    .target(name: "protoc-gen-swift",
            dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"]),
    .target(name: "Conformance",
            dependencies: ["SwiftProtobuf"]),
    .testTarget(name: "SwiftProtobufTests",
                dependencies: ["SwiftProtobuf"]),
    .testTarget(name: "SwiftProtobufPluginLibraryTests",
                dependencies: ["SwiftProtobufPluginLibrary"]),
  ],
  swiftLanguageVersions: [3, 4]
)

Use automatic linkage for the library product

// swift-tools-version:4.0

// Package.swift
//
// Copyright (c) 2014 - 2017 Apple Inc. and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See LICENSE.txt for license information:
// https://github.com/apple/swift-protobuf/blob/master/LICENSE.txt
//

import PackageDescription

let package = Package(
  name: "SwiftProtobuf",
  products: [
    .executable(name: "protoc-gen-swift", targets: ["protoc-gen-swift"]),
    .library(name: "SwiftProtobuf", targets: ["SwiftProtobuf"]),
    .library(name: "SwiftProtobufPluginLibrary", targets: ["SwiftProtobufPluginLibrary"]),
  ],
  targets: [
    .target(name: "SwiftProtobuf"),
    .target(name: "SwiftProtobufPluginLibrary",
            dependencies: ["SwiftProtobuf"]),
    .target(name: "protoc-gen-swift",
            dependencies: ["SwiftProtobufPluginLibrary", "SwiftProtobuf"]),
    .target(name: "Conformance",
            dependencies: ["SwiftProtobuf"]),
    .testTarget(name: "SwiftProtobufTests",
                dependencies: ["SwiftProtobuf"]),
    .testTarget(name: "SwiftProtobufPluginLibraryTests",
                dependencies: ["SwiftProtobufPluginLibrary"]),
  ],
  swiftLanguageVersions: [3, 4]
)


// RUN: %swiftc_driver -driver-print-jobs -g %s 2>&1 | FileCheck %s
// XFAIL: darwin

// CHECK-NOT: warning: no such SDK:
// CHECK: bin/swift
// CHECK: Driver/sdk.swift
// CHECK: -sdk /{{ }}
// CHECK-NEXT: bin/swift
// CHECK: -sdk /{{ }}

Fix test for new filename.

// RUN: %swiftc_driver -driver-print-jobs -g %s 2>&1 | FileCheck %s
// XFAIL: darwin

// CHECK-NOT: warning: no such SDK:
// CHECK: bin/swift
// CHECK: Driver/sdk-linux.swift
// CHECK: -sdk /{{ }}
// CHECK-NEXT: bin/swift
// CHECK: -sdk /{{ }}


//
//  EnvironmentSwitcherViewController.swift
//  EnvironmentSwitcher
//
//  Created by Ben Norris on 2/12/16.
//  Copyright © 2016 OC Tanner. All rights reserved.
//

import UIKit

public protocol EnvironmentSwitcherDelegate {
    func closeSwitcher()
}

public class EnvironmentSwitcherViewController: UIViewController {

    // MARK: - Public properties

    public var delegate: EnvironmentSwitcherDelegate?
    public var appEnvironment: EnvironmentRepresentable?

    // MARK: - Internal functions

    @IBAction func saveSwitch(sender: AnyObject) {
        delegate?.closeSwitcher()
    }

    @IBAction func cancelSwitch(sender: AnyObject) {
        delegate?.closeSwitcher()
    }

}

Set up different actions for buttons

//
//  EnvironmentSwitcherViewController.swift
//  EnvironmentSwitcher
//
//  Created by Ben Norris on 2/12/16.
//  Copyright © 2016 OC Tanner. All rights reserved.
//

import UIKit

public protocol EnvironmentSwitcherDelegate {
    func save(environment: Environment)
    func cancelSwitcher()
}

public class EnvironmentSwitcherViewController: UIViewController {

    // MARK: - Public properties

    public var delegate: EnvironmentSwitcherDelegate?
    public var appEnvironment: EnvironmentRepresentable?

    // MARK: - Internal functions

    @IBAction func saveSwitch(sender: AnyObject) {
        let updatedEnvironment = Environment(name: "Staging", path: nil)
        delegate?.save(updatedEnvironment)
    }

    @IBAction func cancelSwitch(sender: AnyObject) {
        delegate?.cancelSwitcher()
    }

}


//
//  TestItemContainer.swift
//  Focus
//
//  Created by Sam Meech-Ward on 2017-02-03.
//
//

import Foundation

public class TestItemContainer<Item>: TestItemContainerType {

    public var item: Item {
        return _item
    }
    private var _item: Item!

    public required init(item: Item) {
        _item = item
    }

    public var failureHandler = Focus.failureHandler

    public var successHandler: ((StaticString, UInt) -> (Void))? = Focus.successHandler

}

Remove type from success handler

//
//  TestItemContainer.swift
//  Focus
//
//  Created by Sam Meech-Ward on 2017-02-03.
//
//

import Foundation

public class TestItemContainer<Item>: TestItemContainerType {

    public var item: Item {
        return _item
    }
    private var _item: Item!

    public required init(item: Item) {
        _item = item
    }

    public var failureHandler = Focus.failureHandler

    public var successHandler = Focus.successHandler

}


//
//  Material.swift
//  SwiftTracer
//
//  Created by Hugo Tunius on 09/08/15.
//  Copyright © 2015 Hugo Tunius. All rights reserved.
//

import Foundation

struct Material {
    let color: Color
    let ambientCoefficient: Double
    let diffuseCoefficient: Double
    let specularCoefficient: Double

    let reflectionCoefficient: Double
    var isReflective: Bool {
        get {
            return reflectionCoefficient > 0.0
        }
    }

    let refractionCoefficient: Double?
}

Change material to be a class

//
//  Material.swift
//  SwiftTracer
//
//  Created by Hugo Tunius on 09/08/15.
//  Copyright © 2015 Hugo Tunius. All rights reserved.
//

import Foundation

class Material {
    var color: Color = Color.Black
    var ambientCoefficient: Double = 0.2
    var diffuseCoefficient: Double = 0.2
    var specularCoefficient: Double = 0.0

    var reflectionCoefficient: Double = 0.0
    var isReflective: Bool {
        get {
            return reflectionCoefficient > 0.0
        }
    }

    var refractionCoefficient: Double?

    convenience init(color: Color, ambientCoefficient: Double, diffuseCoefficient: Double) {
        self.init(color: color, ambientCoefficient: ambientCoefficient, diffuseCoefficient: diffuseCoefficient, specularCoefficient: 0.0, reflectionCoefficient: 0.0, refractionCoefficient: nil)
    }

    init(color: Color, ambientCoefficient: Double, diffuseCoefficient: Double, specularCoefficient: Double, reflectionCoefficient: Double, refractionCoefficient: Double?) {
        self.color = color
        self.ambientCoefficient = ambientCoefficient
        self.diffuseCoefficient = diffuseCoefficient
        self.specularCoefficient = specularCoefficient
        self.reflectionCoefficient = reflectionCoefficient
        self.refractionCoefficient = refractionCoefficient
    }

    func copy() -> Material {
        return Material(color: color, ambientCoefficient: ambientCoefficient, diffuseCoefficient: diffuseCoefficient, specularCoefficient: specularCoefficient, reflectionCoefficient: reflectionCoefficient, refractionCoefficient: refractionCoefficient)
    }
}


// Check that the apple-names section is emitted on Darwin.
// Adapted from llvm/test/DebugInfo/X86/debugger-tune.ll
// RUN: %target-swiftc_driver -emit-object -g %s -o %t
// RUN: llvm-readobj -sections %t | %FileCheck --check-prefix=CHECK-LLDB %s

// CHECK-LLDB-NOT: debug_pubnames
// CHECK-LLDB:     apple_names
// CHECK-LLDB-NOT: debug_pubnames

// REQUIRES: OS=macosx

Update test to use dwarfdump instead of readobj

// Check that the apple-names section is emitted on Darwin.
// Adapted from llvm/test/DebugInfo/X86/debugger-tune.ll
// RUN: %target-swiftc_driver -emit-object -g %s -o %t
// RUN: %llvm-dwarfdump -a %t | %FileCheck --check-prefix=CHECK-LLDB %s

// CHECK-LLDB-NOT: debug_pubnames
// CHECK-LLDB:     apple_names
// CHECK-LLDB-NOT: debug_pubnames

// REQUIRES: OS=macosx


import XCTest

/// Helper class providing access to the currently executing XCTestCase instance, if any
@objc public final class CurrentTestCaseTracker: NSObject, XCTestObservation {
    @objc public static let shared = CurrentTestCaseTracker()

    private(set) var currentTestCase: XCTestCase?

    @objc public func testCaseWillStart(_ testCase: XCTestCase) {
        currentTestCase = testCase
    }

    @objc public func testCaseDidFinish(_ testCase: XCTestCase) {
        currentTestCase = nil
    }
}

extension XCTestCase {
    var sanitizedName: String? {
        guard let fullName = self.name else {
            return nil
        }

        let characterSet = CharacterSet(charactersIn: "[]+-")
        let name = fullName.components(separatedBy: characterSet).joined()

        if let quickClass = NSClassFromString("QuickSpec"), self.isKind(of: quickClass) {
            let className = String(describing: type(of: self))
            if let range = name.range(of: className), range.lowerBound == name.startIndex {
                return name.replacingCharacters(in: range, with: "")
                    .trimmingCharacters(in: .whitespacesAndNewlines)
            }
        }

        return name
    }
}

Remove guard since name is no longer optional

import XCTest

/// Helper class providing access to the currently executing XCTestCase instance, if any
@objc public final class CurrentTestCaseTracker: NSObject, XCTestObservation {
    @objc public static let shared = CurrentTestCaseTracker()

    private(set) var currentTestCase: XCTestCase?

    @objc public func testCaseWillStart(_ testCase: XCTestCase) {
        currentTestCase = testCase
    }

    @objc public func testCaseDidFinish(_ testCase: XCTestCase) {
        currentTestCase = nil
    }
}

extension XCTestCase {
    var sanitizedName: String? {
        let fullName = self.name
        let characterSet = CharacterSet(charactersIn: "[]+-")
        let name = fullName.components(separatedBy: characterSet).joined()

        if let quickClass = NSClassFromString("QuickSpec"), self.isKind(of: quickClass) {
            let className = String(describing: type(of: self))
            if let range = name.range(of: className), range.lowerBound == name.startIndex {
                return name.replacingCharacters(in: range, with: "")
                    .trimmingCharacters(in: .whitespacesAndNewlines)
            }
        }

        return name
    }
}


import Foundation
import UIKit
//import Raygun4iOS

@objc(RaygunNativePlugin) class RaygunNativePlugin : CDVPlugin  {
    func startNativeRaygun(_ command: CDVInvokedUrlCommand) {
//        let params: [String: Any] = command.arguments[0] as! [String: Any]
//        let user: String = params["user"] as! String
//        let apiKey: String = params["api"] as! String
//        Raygun.sharedReporter(withApiKey: apiKey)
//        (Raygun.sharedReporter() as AnyObject).identify(user)
    }

    func testCrash(_ command: CDVInvokedUrlCommand) {
        var crashWithMissingValueInDicitonary = Dictionary<Int,Int>()
        _ = crashWithMissingValueInDicitonary[1]!
    }
}

Revert "comment the native raygun provider for now"

import Foundation
import UIKit
import Raygun4iOS

@objc(RaygunNativePlugin) class RaygunNativePlugin : CDVPlugin  {
    func startNativeRaygun(_ command: CDVInvokedUrlCommand) {
        let params: [String: Any] = command.arguments[0] as! [String: Any]
        let user: String = params["user"] as! String
        let apiKey: String = params["api"] as! String
        Raygun.sharedReporter(withApiKey: apiKey)
        (Raygun.sharedReporter() as AnyObject).identify(user)
    }

    func testCrash(_ command: CDVInvokedUrlCommand) {
        var crashWithMissingValueInDicitonary = Dictionary<Int,Int>()
        _ = crashWithMissingValueInDicitonary[1]!
    }
}


//
//  CanvasView.swift
//  LinkedIdeas
//
//  Created by Felipe Espinoza Castillo on 02/11/15.
//  Copyright © 2015 Felipe Espinoza Dev. All rights reserved.
//

import Cocoa

protocol CanvasViewDelegate {
  // mouse events
  func singleClick(event:NSEvent)
}

class CanvasView: NSView {

  var delegate: CanvasViewDelegate?
  var concepts = [Concept]() {
    didSet {
      needsDisplay = true
    }
  }

  override func drawRect(dirtyRect: NSRect) {
    super.drawRect(dirtyRect)

    // Drawing code here.
    NSColor.whiteColor().set()
    NSBezierPath(rect: bounds).fill()

    for concept in concepts {
      if !concept.added {
        Swift.print("add concept view")
        let conceptView = ConceptView(frame: concept.rect)
        conceptView.concept = concept
        concept.added = true
        addSubview(conceptView)
      }
    }
  }

  override func mouseDown(theEvent: NSEvent) {
    delegate?.singleClick(theEvent)
  }

}

Add NSView.sprintf function in extension

//
//  CanvasView.swift
//  LinkedIdeas
//
//  Created by Felipe Espinoza Castillo on 02/11/15.
//  Copyright © 2015 Felipe Espinoza Dev. All rights reserved.
//

import Cocoa

protocol CanvasViewDelegate {
  // mouse events
  func singleClick(event:NSEvent)
}

class CanvasView: NSView {

  var delegate: CanvasViewDelegate?
  var concepts = [Concept]() {
    didSet {
      needsDisplay = true
    }
  }

  override func drawRect(dirtyRect: NSRect) {
    super.drawRect(dirtyRect)

    // Drawing code here.
    NSColor.whiteColor().set()
    NSBezierPath(rect: bounds).fill()

    for concept in concepts {
      if !concept.added {
        Swift.print("add concept view")
        let conceptView = ConceptView(frame: concept.rect)
        conceptView.concept = concept
        concept.added = true
        addSubview(conceptView)
      }
    }
  }

  override func mouseDown(theEvent: NSEvent) {
    delegate?.singleClick(theEvent)
  }

extension NSView {
  func sprint(message: String) {
    Swift.print(message)
  }
}


public struct Location {

  public var name: String
  public var latitude: Float?
  public var longitude: Float?

  public init(name: String, latitude: Float, longitude: Float) {
    self.name = name
    self.latitude = latitude
    self.longitude = longitude
  }

}

Refactor to use coordinate struct

public struct Location {

  public var name: String
  public var coordinate: Coordinate?

  public init(name: String, coordinate: Coordinate?) {
    self.name = name
    self.coordinate = coordinate
  }

}


import PackageDescription

let package = Package(
    name: "gir2swift",
    dependencies: [
        .Package(url: "https://github.com/rhx/SwiftLibXML.git", majorVersion: 1, minor: 2)
    ]
)

Upgrade to add Swift 4 support

import PackageDescription

let package = Package(
    name: "gir2swift",
    dependencies: [
        .Package(url: "https://github.com/rhx/SwiftLibXML.git", majorVersion: 1, minor: 2)
    ],
    swiftLanguageVersions: [3, 4]
)


// swift-tools-version:3.1

import PackageDescription

let package = Package(
  name: "AutoJSONSerialization"
)

Update to latest SPM manifest format

// swift-tools-version:4.0

import PackageDescription

let package = Package(
  name: "AutoJSONSerialization",
  targets: [
    .target(name: "AutoJSONSerialization"),
    .testTarget(name: "AutoJSONSerializationTests", dependencies: ["AutoJSONSerialization"])
  ]
)


import UIKit

class TimelineContainer: UIScrollView, ReusableView {

  var timeline: TimelineView!

  override func layoutSubviews() {
    timeline.frame = CGRect(x: 0, y: 0, width: frame.width, height: timeline.fullHeight)
  }

  func prepareForReuse() {
    timeline.prepareForReuse()
  }

  func scrollToFirstEvent() {
    let yToScroll = timeline.firstEventYPosition ?? 0
    setContentOffset(CGPoint(x: contentOffset.x, y: yToScroll), animated: true)
  }

  func scrollTo(hour24: Float) {
    let percentToScroll = CGFloat(hour24 / 24)
    let yToScroll = contentSize.height * percentToScroll
    let padding: CGFloat = 8
    setContentOffset(CGPoint(x: contentOffset.x, y: yToScroll - padding), animated: true)
  }
}

Disable autoscroll if there are no events

import UIKit

class TimelineContainer: UIScrollView, ReusableView {

  var timeline: TimelineView!

  override func layoutSubviews() {
    timeline.frame = CGRect(x: 0, y: 0, width: frame.width, height: timeline.fullHeight)
  }

  func prepareForReuse() {
    timeline.prepareForReuse()
  }

  func scrollToFirstEvent() {
    if let yToScroll = timeline.firstEventYPosition {
      setContentOffset(CGPoint(x: contentOffset.x, y: yToScroll), animated: true)
    }
  }

  func scrollTo(hour24: Float) {
    let percentToScroll = CGFloat(hour24 / 24)
    let yToScroll = contentSize.height * percentToScroll
    let padding: CGFloat = 8
    setContentOffset(CGPoint(x: contentOffset.x, y: yToScroll - padding), animated: true)
  }
}


// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -I %S/Inputs/custom-modules %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -I %S/Inputs/custom-modules -DREVERSED %s

// REQUIRES: objc_interop

// Do not import Foundation! This tests indirect visibility.
#if REVERSED
import Redeclaration
import AppKit
#else
import AppKit
import Redeclaration
#endif

let encoding: UInt = NSUTF8StringEncoding

let viaTypedef: Redeclaration.NSPoint = AppKit.NSPoint(x: 0, y: 0)
Redeclaration.NSStringToNSString(AppKit.NSStringToNSString("abc")) // expected-warning {{result of call to 'NSStringToNSString' is unused}}

/// The following error should soon be introduced by https://github.com/apple/llvm-project/pull/3497.
let viaStruct: Redeclaration.FooStruct1 = AppKit.FooStruct1() // expected-error * {{module 'AppKit' has no member named 'FooStruct1'}}
let forwardDecl: Redeclaration.Tribool = AppKit.Tribool() // expected-error {{no type named 'Tribool' in module 'Redeclaration'}}

Revert "[ClangImporter] Don't expect unmodularized structs to appear in 2 modules"

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -I %S/Inputs/custom-modules %s
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -I %S/Inputs/custom-modules -DREVERSED %s

// REQUIRES: objc_interop

// Do not import Foundation! This tests indirect visibility.
#if REVERSED
import Redeclaration
import AppKit
#else
import AppKit
import Redeclaration
#endif

let encoding: UInt = NSUTF8StringEncoding

let viaTypedef: Redeclaration.NSPoint = AppKit.NSPoint(x: 0, y: 0)
Redeclaration.NSStringToNSString(AppKit.NSStringToNSString("abc")) // expected-warning {{result of call to 'NSStringToNSString' is unused}}

let viaStruct: Redeclaration.FooStruct1 = AppKit.FooStruct1()
let forwardDecl: Redeclaration.Tribool = AppKit.Tribool() // expected-error {{no type named 'Tribool' in module 'Redeclaration'}}


//
//  MIDIInput.swift
//  Gong
//
//  Created by Daniel Clelland on 26/04/17.
//  Copyright © 2017 Daniel Clelland. All rights reserved.
//

import Foundation
import CoreMIDI

public class MIDIInput: MIDIPort {

    public func connect(_ source: MIDISource) throws {
        var context = source.reference
        try MIDIPortConnectSource(reference, source.reference, &context).midiError("Connecting MIDIInput to source")
    }

    public func disconnect(_ source: MIDISource) throws {
        try MIDIPortDisconnectSource(reference, source.reference).midiError("Disconnecting MIDIInput from source")
    }

}

Revert that; it broke things

//
//  MIDIInput.swift
//  Gong
//
//  Created by Daniel Clelland on 26/04/17.
//  Copyright © 2017 Daniel Clelland. All rights reserved.
//

import Foundation
import CoreMIDI

public class MIDIInput: MIDIPort {

    public func connect(_ source: MIDISource) throws {
        let context = UnsafeMutableRawPointer(pointee: source.reference)
        try MIDIPortConnectSource(reference, source.reference, context).midiError("Connecting MIDIInput to source")
    }

    public func disconnect(_ source: MIDISource) throws {
        try MIDIPortDisconnectSource(reference, source.reference).midiError("Disconnecting MIDIInput from source")
    }

}


/*
 *  Copyright 2019 Google LLC. All Rights Reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

struct FeatureFlags {

  static var isActionAreaEnabled: Bool = true

}

Disable New Action Area until completed

/*
 *  Copyright 2019 Google LLC. All Rights Reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

struct FeatureFlags {

  static var isActionAreaEnabled: Bool = false

}


import Foundation

public struct Post {

  var author: User
  var publishedAt: NSDate
  var text: String?
  var attachments: [Attachment]?
  var likesAmount: Int = 0
  var viewsAmount: Int = 0
  var parent: Post?
  var comments = [Post]()

  public init(author: User, publishedAt: NSDate, text: String) {
    self.author = author
    self.publishedAt = publishedAt
    self.text = text
  }
}

Use class instead of struct to avoid recursion

import Foundation

public class Post {

  var author: User
  var publishedAt: NSDate
  var text: String?
  var attachments: [Attachment]?
  var likesAmount: Int = 0
  var viewsAmount: Int = 0
  var parent: Post?
  var comments = [Post]()

  public init(author: User, publishedAt: NSDate, text: String) {
    self.author = author
    self.publishedAt = publishedAt
    self.text = text
  }
}


// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "Ashton",
    platforms: [.iOS("13.4"), .macOS(.v10_15)],
    products: [
        .library(
            name: "Ashton",
            targets: ["Ashton"]),
    ],
    targets: [
        .target(
            name: "Ashton",
            dependencies: [],
            path: "Sources"),
        .testTarget(
            name: "AshtonTests",
            dependencies: ["Ashton"],
            path: "Tests",
            exclude: ["TestFiles", "AshtonBenchmark", "Bridging.h", "AshtonBenchmarkTests.swift"]),
    ]
)

Change swift version in package to swift 5.1

// swift-tools-version:5.1
import PackageDescription

let package = Package(
    name: "Ashton",
    platforms: [.iOS("13.4"), .macOS(.v10_15)],
    products: [
        .library(
            name: "Ashton",
            targets: ["Ashton"]),
    ],
    targets: [
        .target(
            name: "Ashton",
            dependencies: [],
            path: "Sources"),
        .testTarget(
            name: "AshtonTests",
            dependencies: ["Ashton"],
            path: "Tests",
            exclude: ["TestFiles", "AshtonBenchmark", "Bridging.h", "AshtonBenchmarkTests.swift"]),
    ]
)


import PackageDescription

#if os(OSX)
let package = Package(
    name: "RxSwift",
    exclude: [
        "Sources/RxCocoa",
        "Sources/RxTests",
        "Sources/AllTests"
    ],
    targets: [
        Target(
            name: "RxSwift"
        ),
        Target(
            name: "RxTests",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "RxBlocking",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "AllTests",
            dependencies: [
                .Target(name: "RxSwift"),
                .Target(name: "RxBlocking"),
                .Target(name: "RxTests")
            ]
        )
    ]
)
#elseif os(Linux)
let package = Package(
    name: "RxSwift",
    exclude: [
        "Sources/RxCocoa",
    ],
    targets: [
        Target(
            name: "RxSwift"
        ),
        Target(
            name: "RxTests",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "RxBlocking",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "AllTests",
            dependencies: [
                .Target(name: "RxSwift"),
                .Target(name: "RxBlocking"),
                .Target(name: "RxTests")
            ]
        )
    ]
)
#endif

Update for Xcode 8 beta 5

import PackageDescription

#if os(OSX)
let package = Package(
    name: "RxSwift",
    targets: [
        Target(
            name: "RxSwift"
        ),
        Target(
            name: "RxTests",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "RxBlocking",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "AllTests",
            dependencies: [
                .Target(name: "RxSwift"),
                .Target(name: "RxBlocking"),
                .Target(name: "RxTests")
            ]
        )
    ],
    exclude: [
        "Sources/RxCocoa",
        "Sources/RxTests",
        "Sources/AllTests"
    ]
)
#elseif os(Linux)
let package = Package(
    name: "RxSwift",
    targets: [
        Target(
            name: "RxSwift"
        ),
        Target(
            name: "RxTests",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "RxBlocking",
            dependencies: [
                .Target(name: "RxSwift")
            ]
        ),
        Target(
            name: "AllTests",
            dependencies: [
                .Target(name: "RxSwift"),
                .Target(name: "RxBlocking"),
                .Target(name: "RxTests")
            ]
        )
    ],
    exclude: [
        "Sources/RxCocoa",
    ]
)
#endif


//
//  UIViewController+ErrorPresentable.swift
//  OctoPhone
//
//  Created by Josef Dolezal on 08/04/2017.
//  Copyright © 2017 Josef Dolezal. All rights reserved.
//

import UIKit

protocol ErrorPresentable {
    /// Presents error with given title and message,
    /// allow user to only dismiss the error.
    ///
    /// - Parameters:
    ///   - title: Title of error message
    ///   - message: Actual content of error message
    func presentError(title: String?, message: String?)
}

extension ErrorPresentable where Self: UIViewController {
    func presentError(title: String?, message: String?) {
        let controller = UIAlertController(title: title, message: message, preferredStyle: .alert)
        let okAction = UIAlertAction(title: tr(.ok), style: .default, handler: nil)

        controller.addAction(okAction)

        present(controller, animated: true, completion: nil)
    }
}

Add binding target for errors to controllers

//
//  UIViewController+ErrorPresentable.swift
//  OctoPhone
//
//  Created by Josef Dolezal on 08/04/2017.
//  Copyright © 2017 Josef Dolezal. All rights reserved.
//

import UIKit
import ReactiveSwift
import ReactiveCocoa

/// Represents error, which can be presented to user with alert
typealias DisplayableError = (title: String?, message: String?)

protocol ErrorPresentable {
    /// Presents error with given title and message,
    /// allow user to only dismiss the error.
    ///
    /// - Parameters:
    ///   - title: Title of error message
    ///   - message: Actual content of error message
    func presentError(title: String?, message: String?)
}

extension ErrorPresentable where Self: UIViewController {
    func presentError(title: String?, message: String?) {
        let controller = UIAlertController(title: title, message: message, preferredStyle: .alert)
        let okAction = UIAlertAction(title: tr(.ok), style: .default, handler: nil)

        controller.addAction(okAction)

        present(controller, animated: true, completion: nil)
    }
}

extension Reactive where Base: ErrorPresentable, Base: UIViewController {
    /// Creates new binding target for controllers which are able to display error,
    /// error is presented on main thread and target uses lifetime of its base.
    var displayableError: BindingTarget<DisplayableError> {
        let lifetime = base.reactive.lifetime

        return BindingTarget(on: UIScheduler(), lifetime: lifetime) { [weak base = self.base] error in
            if let base = base {
                base.presentError(title: error.title, message: error.message)
            }
        }
    }
}


import UIKit

final class LicenseViewController: UIViewController  {

    private let textView = UITextView()
    var attribution: Attribution?
    var attributionStyle = AttributionStyle()

    override func viewDidLoad() {
        super.viewDidLoad()
        textView.isScrollEnabled = false
        textView.text = try! attribution?.license.getText()
        textView.font = .systemFont(ofSize: 15)
        textView.textColor = attributionStyle.textColor
        textView.textContainerInset = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
        self.view.addSubview(textView)
        NSLayoutConstraint.activate([
            textView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
            textView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
            textView.topAnchor.constraint(equalTo: self.view.topAnchor),
            textView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
        ])
        textView.translatesAutoresizingMaskIntoConstraints = false
        textView.isScrollEnabled = true
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        title = attribution?.name
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return attributionStyle.statusBarStyle
    }

}

Fix License text view shouldn't be editable

import UIKit

final class LicenseViewController: UIViewController  {

    private let textView = UITextView()
    var attribution: Attribution?
    var attributionStyle = AttributionStyle()

    override func viewDidLoad() {
        super.viewDidLoad()
        textView.isEditable = false
        textView.isScrollEnabled = false
        textView.text = try! attribution?.license.getText()
        textView.font = .systemFont(ofSize: 15)
        textView.textColor = attributionStyle.textColor
        textView.textContainerInset = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 8)
        self.view.addSubview(textView)
        NSLayoutConstraint.activate([
            textView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
            textView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
            textView.topAnchor.constraint(equalTo: self.view.topAnchor),
            textView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
        ])
        textView.translatesAutoresizingMaskIntoConstraints = false
        textView.isScrollEnabled = true
    }

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        title = attribution?.name
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return attributionStyle.statusBarStyle
    }

}


import assert;
import io;

main {

  float x[];

  x = [1.0:2.0];
  assertEqual(x[0], 1.0, "x[0]");
  assertEqual(x[1], 2.0, "x[1]");
  assertEqual(size(x), 2, "len(x)");

  trace("x", repr(x));

  foreach y in [1.0:10.0] {
    printf("y=%f", y);
  }

  foreach z in [0:1004.9:7.5] {
    printf("z=%f", z);
  }

  foreach a in [0:0.0:0.001] {
    printf("a=%f", a);
  }

  foreach b in [0:-1.0] {
    assert(false, "Range loop should not run");
  }
}

Extend floating point range test a bit

import assert;
import io;

main {

  float x[];

  x = [1.0:2.0];
  assertEqual(x[0], 1.0, "x[0]");
  assertEqual(x[1], 2.0, "x[1]");
  assertEqual(size(x), 2, "len(x)");

  trace("x", repr(x));

  foreach y in [1.0:10.0] {
    printf("y=%f", y);
  }

  y_range = [1.0:10.0];
  assertEqual(size(y_range), 10, "size(y)");
  assertEqual(y_range[0], 1.0, "y[0]");
  assertEqual(y_range[9], 10.0, "y[9]");

  foreach z in [0:1004.9:7.5] {
    printf("z=%f", z);
  }

  z_range = [0:1004.9:7.5];
  assertEqual(size(z_range), 134, "size(z)");
  assertEqual(z_range[0], 0.0, "z[0]");
  assertEqual(z_range[20], 150.0, "z[20]");

  foreach a in [95.5:95.51:0.1] {
    printf("a=%f", a);
  }

  a_range = [95.5:95.51:0.1];
  assertEqual(size(a_range), 1, "size(a)");
  assertEqual(a_range[0], 95.5, "a[0]");

  foreach b in [0:-1.0] {
    assert(false, "Range loop should not run");
  }

  b_range = [0:-1.0];
  assertEqual(size(b_range), 0, "size(b)");

}


//
//  ReportEntry.swift
//  Incidents
//
//  © 2015 Burning Man and its contributors. All rights reserved.
//  See the file COPYRIGHT.md for terms.
//

struct ReportEntry: CustomStringConvertible, Hashable {
    var author     : Ranger
    var text       : String
    var created    : DateTime
    var systemEntry: Bool

    var hashValue: Int {
        return (
            author.hashValue      ^
            text.hashValue        ^
            created.hashValue     ^
            systemEntry.hashValue
        )
    }

    var description: String {
        if systemEntry {
            return "\(author.handle) @ \(created): \(text)"
        } else {
            return "\(author.handle) @ \(created):\n\(text)"
        }
    }

    init(
        author     : Ranger,
        text       : String,
        created    : DateTime = DateTime.now(),
        systemEntry: Bool = false
    ) {
        self.author      = author
        self.text        = text
        self.created     = created
        self.systemEntry = systemEntry
    }

}

func ==(lhs: ReportEntry, rhs: ReportEntry) -> Bool {
    return (
        lhs.author      == rhs.author      &&
        lhs.text        == rhs.text        &&
        lhs.created     == rhs.created     &&
        lhs.systemEntry == rhs.systemEntry
    )
}

Allow author to be nil.

//
//  ReportEntry.swift
//  Incidents
//
//  © 2015 Burning Man and its contributors. All rights reserved.
//  See the file COPYRIGHT.md for terms.
//

struct ReportEntry: CustomStringConvertible, Hashable {
    var author     : Ranger?
    var text       : String
    var created    : DateTime
    var systemEntry: Bool

    var hashValue: Int {
        var hash = (
            text.hashValue        ^
            created.hashValue     ^
            systemEntry.hashValue
        )
        if let h = author?.hashValue { hash ^= h }
        return hash
    }

    var description: String {
        let author: String
        if self.author == nil {
            author = "<nil>"
        } else {
            author = self.author!.handle
        }

        if systemEntry {
            return "\(author) @ \(created): \(text)"
        } else {
            return "\(author) @ \(created):\n\(text)"
        }
    }

    init(
        author     : Ranger?,
        text       : String,
        created    : DateTime = DateTime.now(),
        systemEntry: Bool = false
    ) {
        self.author      = author
        self.text        = text
        self.created     = created
        self.systemEntry = systemEntry
    }

}

func ==(lhs: ReportEntry, rhs: ReportEntry) -> Bool {
    return (
        lhs.author      == rhs.author      &&
        lhs.text        == rhs.text        &&
        lhs.created     == rhs.created     &&
        lhs.systemEntry == rhs.systemEntry
    )
}


import UIKit
import Firebase

@UIApplicationMain
class AppDelegate:UIResponder, UIApplicationDelegate
{
    var window:UIWindow?

    func application(
        _ application:UIApplication,
        didFinishLaunchingWithOptions launchOptions:
        [UIApplicationLaunchOptionsKey:Any]?) -> Bool
    {
        FirebaseApp.configure()

        let window:UIWindow = UIWindow(frame:UIScreen.main.bounds)
        window.backgroundColor = UIColor.white
        window.makeKeyAndVisible()
        self.window = window

        let parent:ControllerParent = ControllerParent()
        window.rootViewController = parent

        return true
    }
}

Set log level to min

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate:UIResponder, UIApplicationDelegate
{
    var window:UIWindow?

    func application(
        _ application:UIApplication,
        didFinishLaunchingWithOptions launchOptions:
        [UIApplicationLaunchOptionsKey:Any]?) -> Bool
    {
        FirebaseConfiguration.shared.setLoggerLevel(FirebaseLoggerLevel.min)
        FirebaseApp.configure()

        let window:UIWindow = UIWindow(frame:UIScreen.main.bounds)
        window.backgroundColor = UIColor.white
        window.makeKeyAndVisible()
        self.window = window

        let parent:ControllerParent = ControllerParent()
        window.rootViewController = parent

        return true
    }
}


import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        // Insert code here to initialize your application
    }

    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }

}

Terminate app after last window closes

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        // Insert code here to initialize your application
    }

    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }

    func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
        return true;
    }
}


//
//  NewGroupParticipantsViewController.swift
//  V
//
//  Created by Dulio Denis on 6/18/16.
//  Copyright © 2016 Dulio Denis. All rights reserved.
//

import UIKit
import CoreData

class NewGroupParticipantsViewController: UIViewController {

    var context: NSManagedObjectContext?
    var chat: Chat?
    // set this when we create our new instance of our VC
    var chatCreationDelegate: ChatCreationDelegate?

    override func viewDidLoad() {
        super.viewDidLoad()

        // set the title
        title = "Add Participants"
    }

}

Add a helper method to create a UITextField with an image holder view

//
//  NewGroupParticipantsViewController.swift
//  V
//
//  Created by Dulio Denis on 6/18/16.
//  Copyright © 2016 Dulio Denis. All rights reserved.
//

import UIKit
import CoreData

class NewGroupParticipantsViewController: UIViewController {

    var context: NSManagedObjectContext?
    var chat: Chat?
    // set this when we create our new instance of our VC
    var chatCreationDelegate: ChatCreationDelegate?

    // Used to search for contacts
    private var searchField: UITextField!

    override func viewDidLoad() {
        super.viewDidLoad()

        // set the title
        title = "Add Participants"
    }

    // MARK: Private Helper Method for searchField

    private func createSearchField() -> UITextField {
        // instantiate a UITextField using a Frame with only a height of 50
        let searchField = UITextField(frame: CGRect(x: 0, y: 0, width: 0, height: 50))
        // set a background color to our new UITextField with a custom RGB
        searchField.backgroundColor = UIColor(red: 220/255, green: 220/255, blue: 220/225, alpha: 1)
        // set a placeholder
        searchField.placeholder = "Type contact name"

        // make a left side holder view and assign it to the searchField leftView attribute
        // with an .Always display mode
        let holderView = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
        searchField.leftView = holderView
        searchField.leftViewMode = .Always

        // set up an image for our left side holder view ignoring the image asset's color
        let contactImage = UIImage(named: "contact_icon")?.imageWithRenderingMode(.AlwaysTemplate)
        // set up an ImageView to hold our image
        let contactImageView = UIImageView(image: contactImage)
        // and set a tint color on the image view since we removed the asset's color
        contactImageView.tintColor = UIColor.darkGrayColor()

        // Add our contactImageView as a subview to our holder view
        holderView.addSubview(contactImageView)

        // shutoff autoresizing mask translation into constrains so we can set them thru auto layout
        contactImageView.translatesAutoresizingMaskIntoConstraints = false

        // return our searchField
        return searchField
    }

}


//
//  UIApplication+ExtensionSafe.swift
//  Tabman-Example
//
//  Created by Oskar Groth on 2017-12-15.
//  Copyright © 2017 UI At Six. All rights reserved.
//

import Foundation
import UIKit

extension UIApplication {

    static var safeShared: UIApplication? {
        guard #available(iOSApplicationExtension 9, *) else {
            return nil
        }

        guard !Bundle.main.bundlePath.hasSuffix("appex") else {
            return nil
        }
        guard UIApplication.responds(to: Selector(("sharedApplication"))) else {
            return nil
        }
        guard let unmanagedSharedApplication = UIApplication.perform(Selector(("sharedApplication"))) else {
            return nil
        }

        return unmanagedSharedApplication.takeUnretainedValue() as? UIApplication
    }
}

Revert "Add temp fix for extension safety"

//
//  UIApplication+ExtensionSafe.swift
//  Tabman-Example
//
//  Created by Oskar Groth on 2017-12-15.
//  Copyright © 2017 UI At Six. All rights reserved.
//

import Foundation
import UIKit

extension UIApplication {

    static var safeShared: UIApplication? {
        guard !Bundle.main.bundlePath.hasSuffix("appex") else { return nil }
        guard UIApplication.respondsToSelector("sharedApplication") else { return nil }
        guard let unmanagedSharedApplication = UIApplication.performSelector("sharedApplication") else { return nil }

        return unmanagedSharedApplication.takeRetainedValue() as? UIApplication
    }

}


//
//  Command+Personalization.swift
//
//
//  Created by Vladislav Fitc on 27/05/2020.
//

import Foundation

extension Command {

  enum Personalization {

    struct Get: AlgoliaCommand {
      let callType: CallType = .read
      let urlRequest: URLRequest
      let requestOptions: RequestOptions?

      init(requestOptions: RequestOptions?) {

        self.requestOptions = requestOptions
        self.urlRequest = .init(method: .get, path: .strategies >>>  PersonalizationRoute.personalization, requestOptions: self.requestOptions)
      }

    }

    struct Set: AlgoliaCommand {

      let callType: CallType = .write
      let urlRequest: URLRequest
      let requestOptions: RequestOptions?

      init(strategy: PersonalizationStrategy, requestOptions: RequestOptions?) {
        self.requestOptions = requestOptions
        self.urlRequest = .init(method: .post, path: .strategies >>> PersonalizationRoute.personalization, body: strategy.httpBody, requestOptions: self.requestOptions)
      }

    }

  }

}

Add content type for set personalisation strategy request

//
//  Command+Personalization.swift
//
//
//  Created by Vladislav Fitc on 27/05/2020.
//

import Foundation

extension Command {

  enum Personalization {

    struct Get: AlgoliaCommand {
      let callType: CallType = .read
      let urlRequest: URLRequest
      let requestOptions: RequestOptions?

      init(requestOptions: RequestOptions?) {

        self.requestOptions = requestOptions
        self.urlRequest = .init(method: .get, path: .strategies >>>  PersonalizationRoute.personalization, requestOptions: self.requestOptions)
      }

    }

    struct Set: AlgoliaCommand {

      let callType: CallType = .write
      let urlRequest: URLRequest
      let requestOptions: RequestOptions?

      init(strategy: PersonalizationStrategy, requestOptions: RequestOptions?) {
        var requestOptions = requestOptions.unwrapOrCreate()
        requestOptions.setHeader("application/json", forKey: .contentType)
        self.requestOptions = requestOptions
        self.urlRequest = .init(method: .post, path: .strategies >>> PersonalizationRoute.personalization, body: strategy.httpBody, requestOptions: self.requestOptions)
      }

    }

  }

}


//
//  TextFieldTableViewCell.swift
//  Rocket.Chat
//
//  Created by Bruno Macabeus Aquino on 28/09/17.
//  Copyright © 2017 Rocket.Chat. All rights reserved.
//

import Foundation

class TextFieldTableViewCell: UITableViewCell, FormTableViewCellProtocol {
    static let identifier = "kTextFieldTableViewCell"
    static let xibFileName = "TextFieldTableViewCell"
    static let defaultHeight: Float = 40
    weak var delegate: FormTableViewDelegate?
    var key: String?

    @IBOutlet weak var imgLeftIcon: UIImageView!
    @IBOutlet weak var textFieldInput: UITextField!

    override func awakeFromNib() {
        super.awakeFromNib()

        textFieldInput.clearButtonMode = .whileEditing
    }

    func setPreviousValue(previous: Any) {
        if let previous = previous as? String {
            textFieldInput.text = previous
        }
    }

    @IBAction func textFieldInputEditingChanged(_ sender: Any) {
        delegate?.updateDictValue(key: key ?? "", value: textFieldInput.text ?? "")
    }
}

Change text field cell size to 44

//
//  TextFieldTableViewCell.swift
//  Rocket.Chat
//
//  Created by Bruno Macabeus Aquino on 28/09/17.
//  Copyright © 2017 Rocket.Chat. All rights reserved.
//

import Foundation

class TextFieldTableViewCell: UITableViewCell, FormTableViewCellProtocol {
    static let identifier = "kTextFieldTableViewCell"
    static let xibFileName = "TextFieldTableViewCell"
    static let defaultHeight: Float = 44
    weak var delegate: FormTableViewDelegate?
    var key: String?

    @IBOutlet weak var imgLeftIcon: UIImageView!
    @IBOutlet weak var textFieldInput: UITextField!

    override func awakeFromNib() {
        super.awakeFromNib()

        textFieldInput.clearButtonMode = .whileEditing
    }

    func setPreviousValue(previous: Any) {
        if let previous = previous as? String {
            textFieldInput.text = previous
        }
    }

    @IBAction func textFieldInputEditingChanged(_ sender: Any) {
        delegate?.updateDictValue(key: key ?? "", value: textFieldInput.text ?? "")
    }
}


//
//  day1.swift
//  AdventOfCode
//
//  Created by Markus Kauppila on 09/12/15.
//  Copyright © 2015 Markus Kauppila. All rights reserved.
//

import Foundation

func readInputFile(fileName: String) -> String {
    let path = NSBundle.mainBundle().pathForResource(fileName, ofType: "txt")
    return try! String(contentsOfFile: path!)
}

func day1() {
    let input = Array(readInputFile("day1-input").characters)

    let floorsUp = input.filter { $0 == "(" }.count
    let floorsDown = input.filter { $0 == ")" }.count

    print("answer (part 1): \(floorsUp - floorsDown)")
}

Solve part II of day 1

//
//  day1.swift
//  AdventOfCode
//
//  Created by Markus Kauppila on 09/12/15.
//  Copyright © 2015 Markus Kauppila. All rights reserved.
//

import Foundation

func readInputFile(fileName: String) -> String {
    let path = NSBundle.mainBundle().pathForResource(fileName, ofType: "txt")
    return try! String(contentsOfFile: path!)
}

func day1() {
    let input = Array(readInputFile("day1-input").characters)

    let floorsUp = input.filter { $0 == "(" }.count
    let floorsDown = input.filter { $0 == ")" }.count

    let answer = floorsUp - floorsDown
    print("answer (part 1): \(answer)")
    assert(answer == 74)

    let position = characterPositionOfDescendingToBasement(input)
    print("answer (part 2): \(position)")
    assert(position == 1795)
}

func characterPositionOfDescendingToBasement(input: Array<Character>) -> Int {
    var floorLevel = 0
    var indexOfDescent = 1
    var index = 1

    for character in input {
        if character == "(" {
            floorLevel++
        } else {
            floorLevel--
        }

        if (floorLevel < 0) {
            indexOfDescent = index
            break;
        }

        index++
    }

    return indexOfDescent
}


// RUN: %swift-format %s >%t.response
// RUN: diff -u %s.response %t.response
// RUN: %swift-format -indent-width 2 %s >%t.response
// RUN: diff -u %s.indent2.response %t.response
// RUN: %swift-format -use-tabs %s >%t.response
// RUN: diff -u %s.tabs.response %t.response
// RUN: %swift-format -line-range 12:18 %s >%t.response
// RUN: diff -u %s.lines.response %t.response

// REQUIRES: SR-XXXX

import Foundation

func collatz(n: Int) {
 var r: Int
    if n%2 == 0 {
          r = n/2
        } else {
            r = 3*n+1
    }
       print("Number: \(r)")
       if r == 1 {
           print("Reached one!")
  } else {
           collatz(r)
    }
}

Add the correct SR number to disabling string for swift-format test.

// RUN: %swift-format %s >%t.response
// RUN: diff -u %s.response %t.response
// RUN: %swift-format -indent-width 2 %s >%t.response
// RUN: diff -u %s.indent2.response %t.response
// RUN: %swift-format -use-tabs %s >%t.response
// RUN: diff -u %s.tabs.response %t.response
// RUN: %swift-format -line-range 12:18 %s >%t.response
// RUN: diff -u %s.lines.response %t.response

// REQUIRES: SR-2619

import Foundation

func collatz(n: Int) {
 var r: Int
    if n%2 == 0 {
          r = n/2
        } else {
            r = 3*n+1
    }
       print("Number: \(r)")
       if r == 1 {
           print("Reached one!")
  } else {
           collatz(r)
    }
}


import UIKit

public extension UITableView {

  public func performUpdates(records: [DeltaCollectionRecord]) {
    self.beginUpdates()
    for record in records {
      let indexPath = NSIndexPath(forRow: record.index, inSection: record.section)
      switch record.type {
      case .AddItem:
        self.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
      case .RemoveItem:
        self.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
      case .MoveItem:
        let fromIndexPath = NSIndexPath(forRow: record.fromIndex, inSection: record.section)
        self.moveRowAtIndexPath(fromIndexPath, toIndexPath: indexPath)
      case .ChangeItem, .ReloadItem:
        self.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
      case .ReloadSection:
        self.reloadSections(NSIndexSet(index: record.section), withRowAnimation: .Automatic)
      case .MoveSection:
        self.moveSection(record.fromIndex, toSection: record.index)
      case .AddSection:
        self.insertSections(NSIndexSet(index: record.section), withRowAnimation: .Automatic)
      case .RemoveSection:
        self.deleteSections(NSIndexSet(index: record.section), withRowAnimation: .Automatic)
      }
    }
    self.endUpdates()
  }

}

Add update callback to table views

import UIKit

public extension UITableView {

  public typealias TableViewUpdateCallback = (NSIndexPath, NSIndexPath) -> Void

  public func performUpdates(records: [DeltaCollectionRecord], updateCallback: TableViewUpdateCallback? = nil) {
    self.beginUpdates()
    for record in records {
      let indexPath = NSIndexPath(forRow: record.index, inSection: record.section)
      switch record.type {
      case .AddItem:
        self.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
      case .RemoveItem:
        self.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
      case .MoveItem:
        let fromIndexPath = NSIndexPath(forRow: record.fromIndex, inSection: record.section)
        self.moveRowAtIndexPath(fromIndexPath, toIndexPath: indexPath)
      case .ChangeItem, .ReloadItem:
        let newIndexPath = NSIndexPath(forRow: record.fromIndex, inSection: record.section)
        if let updateCallback = updateCallback {
          updateCallback(indexPath, newIndexPath)
        } else {
          self.reloadRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
        }
      case .ReloadSection:
        self.reloadSections(NSIndexSet(index: record.section), withRowAnimation: .Automatic)
      case .MoveSection:
        self.moveSection(record.fromIndex, toSection: record.index)
      case .AddSection:
        self.insertSections(NSIndexSet(index: record.section), withRowAnimation: .Automatic)
      case .RemoveSection:
        self.deleteSections(NSIndexSet(index: record.section), withRowAnimation: .Automatic)
      }
    }
    self.endUpdates()
  }

}


import UIKit

let CellId = "PlaylistCell"

class PlaylistViewController: UICollectionViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {

    let dataSource = PlaylistDataSource()

    // MARK: UIViewController

    override func viewDidLoad() {
        super.viewDidLoad()
        collectionView!.backgroundColor = UIColor.whiteColor()
    }

    // MARK: UICollectionViewDelegate

    override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
    }

    // MARK: UICollectionViewDelegateFlowLayout

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
        return CGSize(width: collectionView.bounds.width, height: 100)
    }

    // MARK: Init & dealloc

    override init() {
        super.init(collectionViewLayout: UICollectionViewFlowLayout())
        collectionView!.registerClass(PlaylistCell.self, forCellWithReuseIdentifier: CellId)
        collectionView!.dataSource = dataSource

        let trackService = AbletonTrackService()
        let tracks = trackService.listTracks()
        NSLog("Tracks are \(tracks)")

    }

    required init(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

Create track service on startup, query it on click

import UIKit

let CellId = "PlaylistCell"

class PlaylistViewController: UICollectionViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {

    let dataSource = PlaylistDataSource()
    let trackService : TrackService

    // MARK: UIViewController

    override func viewDidLoad() {
        super.viewDidLoad()
        collectionView!.backgroundColor = UIColor.whiteColor()
    }

    // MARK: UICollectionViewDelegate

    override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
      let tracks = trackService.listTracks()
      NSLog("Querying for tracks \(tracks)")
    }

    // MARK: UICollectionViewDelegateFlowLayout

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
        return CGSize(width: collectionView.bounds.width, height: 100)
    }

    // MARK: Init & dealloc

    override init() {
        trackService = AbletonTrackService()
        super.init(collectionViewLayout: UICollectionViewFlowLayout())
        collectionView!.registerClass(PlaylistCell.self, forCellWithReuseIdentifier: CellId)
        collectionView!.dataSource = dataSource
    }

    required init(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}


//
//  Copyright © 2016 Jake Lin. All rights reserved.
//

import UIKit

/**
 Cube Animator - To support 3D animation (Four rotation directions supported: left, right, top, bottom)
 */
public class CubeAnimator: NSObject, UIViewControllerAnimatedTransitioning, AnimatedTransitioning {
  // MARK: - AnimatorProtocol
  public var transitionAnimationType: String
  public var transitionDuration: Duration = .NaN
  public var reverseAnimationType: String?

  // MARK: - private
  private var fromDirection: TransitionFromDirection?

  init(fromDirection: TransitionFromDirection?, transitionDuration: Duration) {
    self.transitionDuration = transitionDuration
    self.fromDirection = fromDirection
    self.transitionAnimationType = String(fromDirection?.animationType)
    self.reverseAnimationType = String(fromDirection?.reverseAnimationType)
    super.init()
  }

  public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
    return transitionDuration
  }

  public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    animateWithCATransition(transitionContext, type: CATransitionType.cube, subtype: fromDirection?.stringValue)
  }
}

Remove optional fromDirection (as reverse string conversion was failing - it returns expanded optional expression which is no good)

//
//  Copyright © 2016 Jake Lin. All rights reserved.
//

import UIKit

/**
 Cube Animator - To support 3D animation (Four rotation directions supported: left, right, top, bottom)
 */
public class CubeAnimator: NSObject, UIViewControllerAnimatedTransitioning, AnimatedTransitioning {
  // MARK: - AnimatorProtocol
  public var transitionAnimationType: String
  public var transitionDuration: Duration = .NaN
  public var reverseAnimationType: String?

  // MARK: - private
  private var fromDirection: TransitionFromDirection

  init(fromDirection: TransitionFromDirection, transitionDuration: Duration) {
    self.transitionDuration = transitionDuration
    self.fromDirection = fromDirection
    self.transitionAnimationType = String(fromDirection.animationType)
    self.reverseAnimationType = String(fromDirection.reverseAnimationType)
    super.init()
  }

  public func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
    return transitionDuration
  }

  public func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    animateWithCATransition(transitionContext, type: CATransitionType.cube, subtype: fromDirection.stringValue)
  }
}


import Foundation

func _identityAsString(value: NSObject?) -> String {
    if value == nil {
        return "nil"
    }
    return NSString(format: "<%p>", value!)
}

func _arrayAsString<T>(items: [T], joiner: String = ", ") -> String {
    return items.reduce("") { accum, item in
        let prefix = (accum.isEmpty ? "" : joiner)
        return accum + prefix + "\(item)"
    }
}

@objc protocol NMBStringer {
    func NMB_stringify() -> String
}

func stringify<S: SequenceType>(value: S) -> String {
    var generator = value.generate()
    var strings = [String]()
    var value: S.Generator.Element?
    do {
        value = generator.next()
        if value != nil {
            strings.append(stringify(value))
        }
    } while value != nil
    let str = ", ".join(strings)
    return "[\(str)]"
}

extension NSArray : NMBStringer {
    func NMB_stringify() -> String {
        let str = self.componentsJoinedByString(", ")
        return "[\(str)]"
    }
}

func stringify<T>(value: T?) -> String {
    if value is Double {
        return NSString(format: "%.4f", (value as Double))
    }
    return toString(value)
}

extension Optional: Printable {
    public var description: String {
        switch self {
        case let .Some(value):
            return toString(value)
        default: return "nil"
        }
    }
}

Remove Optional:Printable extension for Swift 1.1


//
//  Premier+UILabel.swift
//  PremierKit
//
//  Created by Ricardo Pereira on 24/08/2019.
//  Copyright © 2019 Ricardo Pereira. All rights reserved.
//

import UIKit

extension UILabel {

    public convenience init(text: String, font: UIFont, color: UIColor = .white) {
        self.init(frame: .null)
        self.text = text
        self.font = font
        self.textColor = color
        self.numberOfLines = 0
    }

    public convenience init(attributedText: NSAttributedString, font: UIFont?, color: UIColor = .white) {
        self.init(frame: .null)
        self.attributedText = attributedText
        self.textColor = color
        self.numberOfLines = 0
        if let font = font {
            self.font = font
        }
    }

}

Improve UILabel convenience init passing an attributed text

//
//  Premier+UILabel.swift
//  PremierKit
//
//  Created by Ricardo Pereira on 24/08/2019.
//  Copyright © 2019 Ricardo Pereira. All rights reserved.
//

import UIKit

extension UILabel {

    public convenience init(text: String, font: UIFont, color: UIColor = .white) {
        self.init(frame: .null)
        self.text = text
        self.font = font
        self.textColor = color
        self.numberOfLines = 0
    }

    public convenience init(attributedText: NSAttributedString, font: UIFont? = nil, color: UIColor = .white) {
        self.init(frame: .null)
        self.attributedText = attributedText
        self.textColor = color
        self.numberOfLines = 0
        if let font = font {
            self.font = font
        }
    }

}


//
// Copyright (c) Badoo Trading Limited, 2010-present. All rights reserved.
//

import UIKit

@frozen
public enum InputBarMode {
    case text
    case custom
}

public protocol KeyboardEventsHandling: AnyObject {
    func onKeyboardStateDidChange(_ height: CGFloat, _ status: KeyboardStatus)
}

public protocol ScrollViewEventsHandling: AnyObject {
    func onScrollViewDidScroll(_ scrollView: UIScrollView)
    func onScrollViewDidEndDragging(_ scrollView: UIScrollView, _ decelerate: Bool)
}

public protocol ViewPresentationEventsHandling {
    func onViewDidLoad()

    func onViewWillAppear()
    func onViewDidAppear()

    func onViewWillDisappear()
    func onViewDidDisappear()
}

public protocol ChatInputBarPresentingController: UIViewController & InputPositionControlling {
    func setup(inputView: UIView)
}

public protocol ViewModelEventsHandling {
    func onViewDidUpdate()
}

public protocol BaseChatInputBarPresenterProtocol: AnyObject {

    var viewController: ChatInputBarPresentingController? { get set }

    func onViewDidUpdate() // TODO: View Model updates should not be triggered by the BaseChatViewController
}

Change ChatInputBarPresentingController inheritance for sourcery compability

//
// Copyright (c) Badoo Trading Limited, 2010-present. All rights reserved.
//

import UIKit

@frozen
public enum InputBarMode {
    case text
    case custom
}

public protocol KeyboardEventsHandling: AnyObject {
    func onKeyboardStateDidChange(_ height: CGFloat, _ status: KeyboardStatus)
}

public protocol ScrollViewEventsHandling: AnyObject {
    func onScrollViewDidScroll(_ scrollView: UIScrollView)
    func onScrollViewDidEndDragging(_ scrollView: UIScrollView, _ decelerate: Bool)
}

public protocol ViewPresentationEventsHandling {
    func onViewDidLoad()

    func onViewWillAppear()
    func onViewDidAppear()

    func onViewWillDisappear()
    func onViewDidDisappear()
}

public protocol ChatInputBarPresentingController: UIViewController, InputPositionControlling {
    func setup(inputView: UIView)
}

public protocol ViewModelEventsHandling {
    func onViewDidUpdate()
}

public protocol BaseChatInputBarPresenterProtocol: AnyObject {

    var viewController: ChatInputBarPresentingController? { get set }

    func onViewDidUpdate() // TODO: View Model updates should not be triggered by the BaseChatViewController
}


//
//  Formatters.swift
//  PRODUCTNAME
//
//  Created by LEADDEVELOPER on 11/1/16.
//  Copyright © 2017 ORGANIZATION. All rights reserved.
//

import Marshal

protocol DateFormatable {
    func string(from date: Date) -> String

    func date(from string: String) -> Date?
}

extension DateFormatter: DateFormatable {}
@available(iOS 10.0, *)
extension ISO8601DateFormatter: DateFormatable {}

enum Formatters {

    private static var formatters: [String: DateFormatable] = [:]

    private struct Keys {
        static let isoFormatter = "isoFormatter"
    }

    static var ISODateFormatter: DateFormatable {
        if let formatter = formatters[Keys.isoFormatter] {
            return formatter
        }

        if #available(iOS 10.0, *) {
            let isoformatter = ISO8601DateFormatter()
            formatters[Keys.isoFormatter] = isoformatter
            return isoformatter
        }
        else {
            let dateFormatter = DateFormatter()
            dateFormatter.locale = Locale(identifier: "en_US_POSIX")
            dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
            formatters[Keys.isoFormatter] = dateFormatter
            return dateFormatter
        }
    }

}

Use initialization block instead of computed var

//
//  Formatters.swift
//  PRODUCTNAME
//
//  Created by LEADDEVELOPER on 11/1/16.
//  Copyright © 2017 ORGANIZATION. All rights reserved.
//

import Marshal

protocol DateFormatable {
    func string(from date: Date) -> String

    func date(from string: String) -> Date?
}

extension DateFormatter: DateFormatable {}
@available(iOS 10.0, *)
extension ISO8601DateFormatter: DateFormatable {}

enum Formatters {

    static var ISODateFormatter: DateFormatable = {
        if #available(iOS 10.0, *) {
            return ISO8601DateFormatter()
        }
        else {
            let dateFormatter = DateFormatter()
            dateFormatter.locale = Locale(identifier: "en_US_POSIX")
            dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
            return dateFormatter
        }
    }()

}


//
//  ConfirmEmailTableViewCell.swift
//  MercadoPagoSDK
//
//  Created by Eden Torres on 10/26/16.
//  Copyright © 2016 MercadoPago. All rights reserved.
//

import UIKit

class ConfirmEmailTableViewCell: UITableViewCell {

    @IBOutlet weak var label: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        self.selectionStyle = .none
    }
    func fillCell(paymentResult: PaymentResult?, instruction: Instruction?) -> Void {
        label.font = Utils.getFont(size: label.font.pointSize)
        if let instruction = instruction?.secondaryInfo?[0] {
            label.text = instruction
        } else if paymentResult?.status == "approved"{
            label.text = ("Te enviaremos este comprobante a %0".localized as NSString).replacingOccurrences(of: "%0", with: "\(paymentResult!.payerEmail!)")
        } else {
            label.text = "También enviamos el código a tu email".localized
        }
    }
}

Validate array properly in InstructionsVC

//
//  ConfirmEmailTableViewCell.swift
//  MercadoPagoSDK
//
//  Created by Eden Torres on 10/26/16.
//  Copyright © 2016 MercadoPago. All rights reserved.
//

import UIKit

class ConfirmEmailTableViewCell: UITableViewCell {

    @IBOutlet weak var label: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        self.selectionStyle = .none
    }
    func fillCell(paymentResult: PaymentResult?, instruction: Instruction?) -> Void {
        label.font = Utils.getFont(size: label.font.pointSize)

        if !Array.isNullOrEmpty(instruction?.secondaryInfo) {
            if let instruction = instruction?.secondaryInfo?[0] {
                label.text = instruction
            } else if paymentResult?.status == "approved"{
                label.text = ("Te enviaremos este comprobante a %0".localized as NSString).replacingOccurrences(of: "%0", with: "\(paymentResult!.payerEmail!)")
            } else {
                label.text = "También enviamos el código a tu email".localized
            }
        }
    }
}


import Darwin

struct Vector3D {
    let x: Double
    let y: Double
    let z: Double

    init(_ x: Double, _ y: Double, _ z: Double) {
        self.x = x
        self.y = y
        self.z = z
    }

    var magnitude: Double {
        return sqrt(x * x + y * y + z * z)
    }
}

Add static shorthands for left, right, up, down, forward and back 3D vectors

import Darwin

struct Vector3D {
    let x: Double
    let y: Double
    let z: Double

    init(_ x: Double, _ y: Double, _ z: Double) {
        self.x = x
        self.y = y
        self.z = z
    }

    var magnitude: Double {
        return sqrt(x * x + y * y + z * z)
    }

    static let left = Vector3D(-1, 0, 0)
    static let right = Vector3D(1, 0, 0)
    static let up = Vector3D(0, 1, 0)
    static let down = Vector3D(0, -1, 0)
    static let forward = Vector3D(0, 0, 1)
    static let back = Vector3D(0, 0, -1)
}


//
//  CustomButton.swift
//  Few
//
//  Created by Josh Abernathy on 2/28/15.
//  Copyright (c) 2015 Josh Abernathy. All rights reserved.
//

import Cocoa
import Few

typealias CustomButton = CustomButton_<Bool>
class CustomButton_<LOL>: Component<Bool> {
	init() {
		super.init(initialState: false, render: CustomButton_.render)
	}

	class func render(component: Component<Bool>, active: Bool) -> Element {
		let color = (active ? NSColor.greenColor() : NSColor.blackColor())
		return View(
			borderColor: color,
			cornerRadius: 4,
			borderWidth: 1,
			mouseDown: { _ in component.updateState(const(true)) },
			mouseUp: { _ in component.updateState(const(false)) })
			.children([
				Label(text: "Click me!")
			])
	}
}

Use the other text color too.

//
//  CustomButton.swift
//  Few
//
//  Created by Josh Abernathy on 2/28/15.
//  Copyright (c) 2015 Josh Abernathy. All rights reserved.
//

import Cocoa
import Few

typealias CustomButton = CustomButton_<Bool>
class CustomButton_<LOL>: Component<Bool> {
	init() {
		super.init(initialState: false, render: CustomButton_.render)
	}

	class func render(component: Component<Bool>, active: Bool) -> Element {
		let color = (active ? NSColor.greenColor() : NSColor.blackColor())
		return View(
			borderColor: color,
			cornerRadius: 4,
			backgroundColor: .whiteColor(),
			borderWidth: 1,
			mouseDown: { _ in component.updateState(const(true)) },
			mouseUp: { _ in component.updateState(const(false)) })
			.children([
				Label(text: "Click me!", textColor: color)
			])
	}
}


//
//  BusyNavigationBarTests.swift
//  BusyNavigationBarTests
//
//  Created by Gunay Mert Karadogan on 29/7/15.
//  Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
//

import UIKit
import XCTest

class BusyNavigationBarTests: XCTestCase {

    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }

    func testExample() {
        // This is an example of a functional test case.
        XCTAssert(true, "Pass")
    }

    func testPerformanceExample() {
        // This is an example of a performance test case.
        self.measureBlock() {
            // Put the code you want to measure the time of here.
        }
    }

}

Update the tests, although there's no actual tests there.

//
//  BusyNavigationBarTests.swift
//  BusyNavigationBarTests
//
//  Created by Gunay Mert Karadogan on 29/7/15.
//  Copyright (c) 2015 Gunay Mert Karadogan. All rights reserved.
//

import UIKit
import XCTest

class BusyNavigationBarTests: XCTestCase {

    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }

    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }

    func testExample() {
        // This is an example of a functional test case.
        XCTAssert(true, "Pass")
    }

    func testPerformanceExample() {
        // This is an example of a performance test case.
        self.measure() {
            // Put the code you want to measure the time of here.
        }
    }

}


//
//  AppDelegate.swift
//  Memoires
//
//  Created by Romain Pouclet on 2017-03-28.
//  Copyright © 2017 Perfectly-Cooked. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        BuddyBuildSDK.setup()

        let root = StoryboardScene.Main.instantiateRoot()

        let window = UIWindow(frame: UIScreen.main.bounds)
        window.rootViewController = root
        window.makeKeyAndVisible()
        self.window = window

        UINavigationBar.appearance().titleTextAttributes = [
            NSForegroundColorAttributeName: UIColor.mmrBlack
        ]
        UINavigationBar.appearance().barTintColor = .mmrSunflowerYellow
        UINavigationBar.appearance().tintColor = .mmrBlack

        return true
    }

}

Add implicit dependencies for RAC

//
//  AppDelegate.swift
//  Memoires
//
//  Created by Romain Pouclet on 2017-03-28.
//  Copyright © 2017 Perfectly-Cooked. All rights reserved.
//

import UIKit

// Implicit dependencies for ReactiveCocoa
import MapKit
import CoreLocation

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        BuddyBuildSDK.setup()

        let root = StoryboardScene.Main.instantiateRoot()

        let window = UIWindow(frame: UIScreen.main.bounds)
        window.rootViewController = root
        window.makeKeyAndVisible()
        self.window = window

        UINavigationBar.appearance().titleTextAttributes = [
            NSForegroundColorAttributeName: UIColor.mmrBlack
        ]
        UINavigationBar.appearance().barTintColor = .mmrSunflowerYellow
        UINavigationBar.appearance().tintColor = .mmrBlack

        return true
    }

}


import UIKit

class DetailViewController: UIViewController {
    @IBOutlet weak var detailDescriptionLabel: UILabel!

    var person: Person! {
        didSet {
            self.configureView()
        }
    }

    func configureView() {
        guard isViewLoaded() else {
            return
        }
        detailDescriptionLabel.text = person.fullName
    }

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        configureView()
    }
}

Fix GRDBDemoiOS crash on iPad

import UIKit

class DetailViewController: UIViewController {
    @IBOutlet weak var detailDescriptionLabel: UILabel!

    var person: Person! {
        didSet {
            self.configureView()
        }
    }

    func configureView() {
        guard isViewLoaded() else {
            return
        }
        guard person != nil else {
            return
        }
        detailDescriptionLabel.text = person.fullName
    }

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        configureView()
    }
}