1
Code Review / Debugging (Swift, iOS, Concurrency, Persistence)
class Post: Codable, Hashable {
let userId, id: Int; let title, body: String
static func == (lhs: Post, rhs: Post) -> Bool { lhs.hashValue == rhs.hashValue }
func hash(into hasher: inout Hasher) { hasher.combine(id) }
}
class WwwViewController: UIViewController {
lazy var archiveURL = URL(fileURLWithPath: "/tmp/foo.plist")
fileprivate var posts: [Post]
private var diskPosts = [Post]()
private var isSaved = false
var abTestingFromOutside: Int = 0
let button = UIButton(type: .system)
let button2 = UIButton()
override func viewDidLoad() {
button.backgroundColor = .blue;…