Sorry, I mixed up, it is a CLPlacemark not a CLLocation
Post
Replies
Boosts
Views
Activity
The button with tag 1 doesn't work but the one with tag 11 actually does work. When I click on the first button it doesn't print the tag, but on the other buttons it does. So the func doesn't work for the first button.
I had a stack view covering the button. The stack view was taking the taps
Core Location Provides a few things like the name, address, zip code, state, street, and country. But not things like phone number.
I don't personally use react native, but I feel like with some research you could use CoreLocation with react native, or maybe some other api like google places or yelp fusion, those apis have the possibility to use Javascript.
CoreLocation is free to use, just import it in your Xcode project.
I hope this answered some of your questions.
Here is the rest of my code. I forgot to add it there.
infoBox.addSubview(gradeButton)
gradeDP.createDropDownMenu()
infoBox is just a UIView. The debugger doesn't show anything else...
Thank you for trying to help me with my problem. The #selector(DropDownMenu.onclick) vs #selector(DropDownMenu.onclick(_:)) makes no difference. When I set the target to self inside of the class, it doesn't cause any error anymore, but it doesn't call the function. The error also comes up when trying to call addTarget from ViewController.let titleButton = UIButton(frame: CGRect(x: 100, y: 300, width: 180, height: 40))
titleButton.backgroundColor = UIColor.white
titleButton.setTitle("DropDownMenu", for: .normal)
titleButton.setTitleColor(UIColor.black, for: .normal)
titleButton.layer.borderWidth = 2
let dp = DropDownMenu(main: titleButton)
titleButton.addTarget(self, action: #selector(dp.openDropDown), for: .touchUpInside)
The error gets called when I click on the button, not when I call addTarget. The function never gets called though.