Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protocol CategoryRowDelegate {
- func didSelectItemAtIndexPath()
- }
- class CategoryRow:UITableViewCell {
- @IBOutlet weak var collectionView:UICollectionView!
- var delegate:CategoryRowDelegate?
- }
- extension CategoryRow:UICollectionViewDataSource {
- func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
- ImageObjectSingleton.imageName = DataSource.maskArray.objectAtIndex(indexPath.row) as! String
- ImageObjectSingleton.isEyeColorImage = false
- ImageObjectSingleton.isMaskImage = true
- delegate?.didSelectItemAtIndexPath()
- }}
- class EffectsMenuViewContoller:UIViewController,UITableViewDataSource,UITableViewDelegate,CategoryRowDelegate {
- var object : CategoryRow?
- override func viewDidLoad()
- {
- super.viewDidLoad()
- /* snip */
- self.object?.delegate = self
- }
- /* snip */
- func didSelectItemAtIndexPath() {
- self.dismissViewControllerAnimated(true, completion: nil)
- }
- protocol CategoryRowDelegate: class {
- func didSelectItemAtIndexPath()
- }
- class CategoryRow:UITableViewCell {
- @IBOutlet weak var collectionView:UICollectionView!
- weak var delegate: CategoryRowDelegate?
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement