How to show image title instead of icon in xcode code? - ios

I'm writing a pretty simple line, but it's hard for me to see what I've actually written, because my image title is displayed as an icon in xcode.
I want to see it as:
thing.image = picture.png
But instead I see it as:
thing.image = an actual icon is here in the code for some weird purpose I can't understand
I've searched with no luck. Any help is greatly appreciated. Thank you!
**edit: I'm assuming it's an icon placeholder... it displays as a small white box.
**edit: here's a ss of how my code looks:

Related: I like the literals; to find out the name of the image after-the-fact, have Xcode reveal the name of the image asset by selecting the literal, then press Cmd-E, "Use Selection for Find". The image's name will show in the Find bar, e.g. #imageLiteral(resourceName: "icn_spinner")
Alternatively, press Cmd-/ to comment the line out; the commented form contains the literal text.

assign image to the UIImageView
thing.image = UIImage(named:"picture.png")

Highlight image and press Ctrl + F, then the image name will be in the toolbar.

Related

Setting button image also ends up adding the word "button" to image; how to fix

So I made some assets in sketch and have successfully imported them into Xcode. When I attempt to give a button the image of one of these assets, Xcode does just that, but it also ends up adding the word "button" next to my image (seen in picture). I have a feeling my settings in the inspector could be the culprit, however playing around with them has yielded no victory.
Would you be able to recommend any solution?
Thanks]1
Remove the Button title "Button" from the inspector.
If you want button title and background image then assign your image into Background field which is below Image field and if you don't want button title then assign that image in Image field and remove title Button.
See the picture. By default it will take the title as Button. delete it. This will resolve your issue.

How to show text and image in bottom toolbar of a scene in xcode

I am trying to replace the bar button items in my toolbar with images. I was able to select image in the attribute inspector. But now the text is replaced with image. Is there anyway i can keep both text and image (text should be below image)
What i have is this.
Please click to see image
What i am looking for is something like this
Please click to see image
Thanks for helping.
You can place the image in the selected image attribute
And you can place the text in the bar item title attribute
Something like this
This can be done when you do to the navigation controller for that particular tab.. Like in your case navigation controller for item 1
Hope that helps

IOS Developing:Tab Bar Item's Image Display a Blue Square

The bar item images I prepared are about 35*35
and I use the Sketch to export the [1x & 2x] size images;
(I can't insert any images for instances at here because of my zero reputation//Sorry about this!)
Then it displays a blue square :<
the function and title of Item is OK
BUT just the icons are wrong
Could someone tells me how to fix it!
Appreciate!!!
I figure it out!
There is nothing wrong with your code or setting
It's about your IMAGEs
You can just look at the apps on your phone.(almost)Any tab bar item icons are in gray.
So the Icon will just display their UN Hollow parts in gray!!
[Additionally,according to official API,they wrote like this:
By default, unselected and selected images are automatically created from the alpha values in the source images. To prevent system coloring, provide images with UIImageRenderingModeAlwaysOriginal.
]
Consequently the solution is : USE Sketch to make your instance's icon heart-part to be hollow
You need to add #3x image too.

Text and images in UiTextView

I am working on a chat process where I need to place smileys and text together on the textbox, this part is done with no problems, the place where I am stuck is - if is want to place an image in between any text by dragging the cursor to a specified place, then how can this be done.
Right now I can place the image right after the text.
for eg: in my uitextbox -> [ Hi! how r u ? 'image' ]...
but if I want to do like this [ Hi! 'image' how r u ]....I should be able to select a position in textbox by dragging the cursor there and then select and place the image there..
Can anyone help me out on this?
Alright I figured out the solution for this... the above can be achieved using "UITextRange" and "UITextPosition" for the selected area in the UItextView. :)

Highlighted property is only for display within Interface Builder

How do I solve such warning? What does it mean in most of the cases?
When I click on it, there is nothing highlighted on my Interface Builder (it just zooms in on some area between 2 view controllers).
You have a UIImageView with Highlighted set to true in Xcode. Xcode tells you that the value is for WYSIWYG but won't work at runtime.
After looking at warning message details I got to know, but still there was no way, I could find particular Image is having highlighted="YES"
Perfect Trick suggested by #Keller in Accepted answer's comment.
Just right click your Storyboard --> Open As --> Source Code.
search for
highlighted="YES
Just set YES to NO.
or event if you look carefully code around searched string, you can get in which ViewController's Scene particular ImageView.
Thanks to #Keller
Right click on your Storyboard -> Open as -> Source Code.
Search for highlighted = "YES".
Check the name of the image.
Find the image on the Storyboard.
Click the image, go to Show the Attributes inspector.
Uncheck the Highlighted option
Highlighted image

Resources