This question already has answers here:
How to make UILabel in Swift a circle
(7 answers)
Closed 3 years ago.
timerLabel is the label that I'm trying to change it into a circle. This line code is not working the way that I desire:
timerLabel.layer.cornerRadius = timerLabel.frame.width/2
I found a solution for my issue in this already been asked post: https://stackoverflow.com/a/46066815/8451094 .
Thanks #elarcoiris
lblRoundDot.layer.cornerRadius = lblRoundDot.frame.width/2
lblRoundDot.layer.masksToBounds = true
Related
This question already has answers here:
Remove user location annotation from mapView
(3 answers)
Closed 4 years ago.
I'm trying to hide the blue dot of the user location in my Swift 4 app. I have attempted to turn it off in the storyboard but this doesn't seem to solve the problem.
You should set the showUsersLocation to false on your MKMapView.
https://developer.apple.com/documentation/mapkit/mkmapview/1452682-showsuserlocation
This question already has answers here:
Removing new line characters from NSString
(5 answers)
Closed 4 years ago.
In my app I'm facing one trouble, my requirement is I want to show text in single line, but response which was coming from API is like:
"Hi
Hello
How Are You"
How to convert this and display in single line in UILabel
var newString = myString.components(separatedBy: CharacterSet.newlines).joined(separator: " ")
Then you can bind that newString to UILabel.
This question already has answers here:
Create tap-able "links" in the NSAttributedString of a UILabel?
(37 answers)
Closed 4 years ago.
I have a UILabel.
I have connected it and passing a value of string to it and it is showing as text correctly.
So, in this string how can I add a link to a word? In web we use , but for Swift,
You can use a UITextView and select Detection for Links, Phone Numbers and other things in the inspector.
This question already has answers here:
How to completely colorize UIPopoverPresentationController background color?
(2 answers)
Closed 7 years ago.
Question says it all. Does anyone know any tricks to change it from the standard grey color?
The simplest way is to set the popover presentation controller's backgroundColor. If that isn't good enough, you can set its popoverBackgroundViewClass, which gives you total command of the chrome including the arrow (but is a lot more work to implement).
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Removing First Annotation-MapView iOS
I am working on mapview project. I have question to remove annotation from mapview.
Total annotation point would be 5. How could I remove first annotation from my mapView.
I think I have got my answer,
[mapView removeAnnotation:[self.mapView.annotations objectAtIndex:0]];