This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
let movableView: UIView = { | |
let view = UIView(frame: .zero) | |
view.translatesAutoresizingMaskIntoConstraints = false | |
view.accessibilityIdentifier = "MovableView" | |
view.backgroundColor = .red | |
return view | |
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func crud<ParentType>( | |
at path: PathComponentsRepresentable..., | |
parent relation: KeyPath<ChildType, Parent<ChildType, ParentType>>, | |
_ either: OnlyExceptEither<ParentRouterMethod>, | |
relationConfiguration: ((CrudParentController<ChildType, ParentType>) -> Void)? | |
) where | |
ParentType: Model & Content, | |
ChildType.Database == ParentType.Database, | |
ParentType.ID: Parameter |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> Core | |
Core (3.4.4) - Analyzing on iOS 10.0 platform. | |
Preparing | |
Analyzing dependencies | |
Inspecting targets to integrate | |
Using `ARCHS` setting to build architectures of target `Pods-App`: (``) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> Core | |
Core (3.4.4) - Analyzing on iOS 10.0 platform. | |
Preparing | |
Analyzing dependencies | |
Inspecting targets to integrate | |
Using `ARCHS` setting to build architectures of target `Pods-App`: (``) |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-> Core | |
Core (3.4.4) - Analyzing on iOS 10.0 platform. | |
Preparing | |
Analyzing dependencies | |
Inspecting targets to integrate | |
Using `ARCHS` setting to build architectures of target `Pods-App`: (``) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class PagedViewController: UIViewController { | |
// MARK: - Properties | |
private static let defaultPageControlConstraints: (PagedViewController) -> ([NSLayoutConstraint]) | |
= { (pagedViewController: PagedViewController) in | |
return [ | |
pagedViewController.pageControl.bottomAnchor.constraint( | |
equalTo: pagedViewController.scrollView.bottomAnchor, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://github.com/twof/VaporMailgunService | |
Cloning into 'VaporMailgunService'... | |
remote: Enumerating objects: 19, done. | |
remote: Counting objects: 100% (19/19), done. | |
remote: Compressing objects: 100% (15/15), done. | |
remote: Total 244 (delta 4), reused 13 (delta 2), pack-reused 225 | |
Receiving objects: 100% (244/244), 47.44 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (85/85), done. | |
$ cd VaporMailgunService/ | |
$ vapor build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This first solution is the ideal one to come up with if the interviewer said they were looking for a demonstration of | |
// OOP design concepts. It's not generic right now, but I'll try and update it later to fix that. This is working Swift code, | |
// so feel free to paste it into a playground if you'd like to play with it | |
import Foundation | |
protocol Node { | |
func evaluate() -> Int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func iterateEnum<T: Hashable>(_: T.Type) -> AnyIterator<T> { | |
var i = 0 | |
return AnyIterator { | |
let next = withUnsafeBytes(of: &i) { $0.load(as: T.self) } | |
if next.hashValue != i { return nil } | |
i += 1 | |
return next | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node<T>{ | |
var content: T | |
var next: Node? | |
init(content: T, next: Node?){ | |
self.content = content | |
self.next = next | |
} | |
} |