ios - MVVM with UITextField and UICollectionViewCell/UITableViewCell -
i have uicollectionview
bunch of full width/height uicollectionviewcell
's. each cell has uilabel
title , uitextfield
edit title "in-place",
my viewcontroller has accessoriesviewmodel
holds # accessory
objects , passes accessoryviewmodel
accessorycell
.
the user can tap on edit
locks uicollectionview
scrolling , sets current cell in edit mode. label hidden, text field shown , user can edit name of accessory.
problem
user should not able press done
if name of 0 length , on pressing done
function updatename:completionhandler:
should called on accessory in question.
how achieve "correct" way?
idea a
let viewcontroller delegate
uitextfield
, determine when done
should enabled/disabled. calling updatename:completionhandler:
on accessory when done.
idea x
?
hope can me on right track.
i've put example project on github mvvm editing
Comments
Post a Comment