I have a photos collection view with different section header with different items but i want to add an action button into the last cell of a section which will take a photo and will be added the photo to the section cell and only last cell of the section will be contain the action button .I attached a similar photos of screen in the link below.
Asked
Active
Viewed 510 times
0
-
What have you done till now? Please explain what you have added, so that we can help you out. – Amir Khan May 07 '18 at 06:13
-
You said you attached something but I don't see it. I see an edit history where the link was fixed (along with grammar) but then reverted. – Charlie May 07 '18 at 19:30
1 Answers
1
@User,
Add action(.touchUpInside) on button in header for all section and while performing events you can detect that if that section is last than perform task otherwise return.
e.g
Add these calls inside view for header in section
section.tempButton.tag = indexPath.section
section.tempButton.addTarget(self, action: #selector(performTask), for: .touchUpInside)
then it will call the selector when touched
@objc func performTask(sender:UIButton){
if sender.tag == lastSection{
//perform task
}
}

Guilherme Matuella
- 2,193
- 1
- 17
- 32

CrazyPro007
- 1,006
- 9
- 15