xcode 5 assign image inside storyboard - xcode

I haven't used xcode since version 4 and am getting back into it.
I am simply trying to add a static image inside my storyboard. I have dragged out a UiImageView, but cannot figure out where to assign the image to it. I remember I could do this in XCode 4.
Any help would be appreciated.

You can set the image for an image view in the Attributes inspector:
If you have images in your project, they'll show up in the popup.

Related

How to convert manual view controller to storyboard as a launch screen

New iOS requirements need Apps for iPhone or iPad must be built with the iOS 13 SDK or later and use an Xcode storyboard to provide the app’s launch screen.
But my project is very old and has never used Storyboards. All UI elements are created dynamically using ViewControllers.
I managed to create a storyboard file and set it as a launcher but it has no scenes and I do not know how to proceed. I would like to:
Create a scene where I place only the original launch image inside (hoping that apple still accepts this branding)
If it is possible to just connect my main ViewController with the scene (if that works with dynamical ViewControllers)
If nothing helps than I would need to create a simple scene which has just a bottom bar like my ViewController
I had this exact issue, here's what I did:
Create LaunchScreen.storyboard and set to use it as launch screen
Using the + button in the top-right (this was not an obvious step), add a View Controller into the storyboard
Untick "Use Safe Area Layout Guides" on the right panel if you're getting that error
Tick "Is Initial View Controller"
Then clean and run, for me it just worked. I did have trouble seeing it update though, as discussed here: Launch Screen storyboard not displaying image

Xcode 5 - Launch Images in Asset catalog won't show up

I have a problem with my LaunchImages. When I create a new Project with the SpriteKit template and immediately add my two launch images, everything works fine. Now I change the Device Orientation (General->Deployment Info) to Landscape-Left and Landscape-Right (unselect "Portrait). I run the simulator again and the images won't show up. (even if I allow "Portrait"-Orientation again)
Does somebody know, whats this about?
A second Question:
When I tried to use an asset catalog with a SKSpriteNode object, the image doesn't show up as well. Instead the Node was a dark green rectangle. If I try to assign the same image to a UIImageView everything works fine...
Verify you don't have the launch image name specified on your ...Info.plist file
for me it was the problem preventing default image to be displayed on iOS 6 and below while it was working for iOS 7

Xcode 4.5 "Apply retina 4 Form factor" toggle button not working properly

I'm trying to update an IOS app for IOS6 and iPhone 5, but I have a problem resizing some views from the main Storyboard.
When I click on the new "Apply Retina 4 Form Factor" button, some of the views included in the StoryBoard don´t resize. I´ve checked all the settings for every Scene and seem to be configured in the same way. Any idea? Thanks in advance.
You might have found your solution but I just had a similar problem. For future notice, I found the fix was in the show size inspector and instead of using layout rectangle, I used frame rectangle.
I was having the same problem, this answer worked for me and finally removed the letterbox:
https://stackoverflow.com/a/12927282/539149
So add a 640x1136 launch image called Default-568h#2x.png and set the "Retina (4-inch)" target setting to it. More info for the other sizes here:
http://www.idev101.com/code/User_Interface/launchImages.html
Just in case it helps others, I had tried these links and none of them got rid of the letterbox, but they did at least enable the resize masks:
Resize of UIViewController in storyboard
Xcode 4.5: can't set root view autoresizingMask in Interface Builder
how do you resize (visually, not programmatically) the detail view of a UISplitViewController in a storyboard?
iphone 5 and storyboard setting autoresizing masks

how do you put a simple banner/image in OS X app window?

In IB, I put an Image View object in app window, and dragged a tiff from the finder into that space, turned off editing, and positioned/sized the image as a header banner. Looked fine in IB, but when built and ran, ImageView object is there only as a background filled box (without my tiff).
Could someone explain what steps I am missing or point me to an existing relevant answer?
Cheers!
PS: By banner I only mean a static image, nothing to do with html, nor iOS.
Have you put the image in an NSURL or CGImage variable? I haven't worked with any of the image frameworks lately but I know that the app needs to know where the image is. That's the first thing I would look at.
I didn't know you could drag an image from the Finder into an NSImageView. What I would do is add the image to the Xcode project, so that it will be added to the built app. Then the name of the image should appear in the list of choices for the image in the IB inspector for the NSImageView.

#2x images do not display in XCode4 interface builder designer

I'm trying to design a xib using XCode4, but when I put down an image view that displays an #2x image xcode doesn't preview it correctly (it displays a missing image icon).
It works correctly when the app is run though.
As an example: I add a UIImageView to my view and set the image property to test.png.
In my project I add a file named test#2x.png.
In XCode 3.2 this image would have correctly displayed in IB, and the #2x version would have automatically half-sized on non-retina devices.
However in IB in XCode4 the image does not display.
Is anyone else experiencing this? If they are, it's a pretty massive issue.
Why not just add both images? AFAIK UIImage isn’t guaranteed to work like that.
I always use both sizes, having the #2x ones first, and unretining them using the free app unretiner from app store, and drop both sizes to the project. When referring to an image, instead of writing test.png or test#2x.png, I write test and xCode finds sizes to the corresponding devices, but YES! in IB, the image won't be displayed in this way, just a question marked blue screen; but that works fine when running the app.

Resources