IGListKit/Examples/Examples-macOS/IGListKitExamples/View/UserCollectionViewCell.swift
Jesse Squires ae7f36f5c2 Update gems, fix warnings, pod install
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
2017-12-19 09:31:37 -08:00

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
}
}