mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-06 15:08:50 +00:00
Summary: - Update CocoaPods + Gems - Update SwiftLint version - Fix lint errors - Fix `pod_setup.sh` script, move to `scripts/` (should now be run from root dir) - Run `pod_setup.sh` Closes https://github.com/Instagram/IGListKit/pull/1038 Differential Revision: D6602297 Pulled By: rnystrom fbshipit-source-id: 1bf69611e041903cf982fe7d9a95197729e44d94
29 lines
678 B
Swift
29 lines
678 B
Swift
//
|
|
// UserCollectionViewCell.swift
|
|
// IGListKitExamples
|
|
//
|
|
// Created by Weyert de Boer on 27/08/2017.
|
|
// Copyright © 2017 Instagram. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
|
|
protocol UserCollectionViewCellDelegate: class {
|
|
|
|
func itemDeleted(_ user: User)
|
|
}
|
|
|
|
final class UserCollectionViewCell: NSCollectionViewItem {
|
|
|
|
weak var delegate: UserCollectionViewCellDelegate?
|
|
|
|
@IBAction func deleteButtonClicked(_ sender: AnyObject) {
|
|
guard let user = representedObject as? User else { return }
|
|
delegate?.itemDeleted(user)
|
|
}
|
|
|
|
func bindViewModel(_ user: User) {
|
|
representedObject = user
|
|
textField?.stringValue = user.name
|
|
}
|
|
}
|