addtarget Questions

7

Solved

I have referred to countless other questions about a press-and-hold button but there aren't many related to Swift. I have one function connected to a button using the touchUpInside event: @IBActio...
Schnurr asked 12/12, 2015 at 3:28

19

Solved

I have a generic control class which needs to set the completion of the button depending on the view controller.Due to that setLeftButtonActionWithClosure function needs to take as parameter a clos...
Buskined asked 18/9, 2014 at 18:4

2

Solved

I am trying to add labels in Swift, which are added in a loop. I then want to add a 'TapGesture' event to each one as they are added. It works , but the problem is that the function called takes da...
Defiance asked 4/6, 2016 at 13:42

2

Solved

In the past I had no problem creating a UIButton programmatically, but ever since I've been using Xcode 9 and Swift 4, I cannot find a way to make this error go away. //Adding target to UIButton f...
Ademption asked 20/8, 2017 at 17:8

5

Can anyone clarify the difference between these 2 ways of triggering a function when tapping a view? 1) myView.addTarget(self, action: #selector(myFunctionToTrigger(_:)), forControlEvents: UIContr...
Legitimist asked 24/8, 2016 at 13:25

1

Solved

I try figure out why self point to the GameViewController instead of Answer GameViewController.swift class GameViewController: UIViewController { var gameplay = QuestionsController(colors: color...
Ofori asked 25/2, 2016 at 19:55
1

© 2022 - 2024 — McMap. All rights reserved.