Add Image to an Apple Watch Button - ios

I want to do is add an image to one of my buttons. I uploaded an image to my Assets folder and whenever I add it as a background it comes out blank. I even tried adding a group with a background and it still doesn't work. I don't know why its not working. When I set a color to the button it shows but a background image won't show up. It seems so simple but when I run it the background is black. Please help.

The Images worked after I moved the images to the Assets folder of the WatchKit App instead of the WatchKit App Extension. Also, I changed the names to make sure they were correct.

For my case, first time I try new a Image set, set it's name, and then drag the image file in. But doesn't work.
Then some example video came into my mind and I directly drag the image file into Assets.xcassets, then set the file to Apple Watch only, and then drag the file to 2x. And everything is OK.
Looks like a bug somehow, but anyway it works.

Related

Unable to display the LaunchScreen Image in Swift spritekit app

I'm having the problem with LauchScreen in ios, I've prepared multiple images for the Launch Image Source. Also removed the text and the contents from the LaunchScreen.xib file so that the images will be displayed at runtime, yet, only black screen shows up. How am I supposed to prepare and set the image? I've searched similar questions but had no solutions that helped me. I would love to hear some tips and help from you!
Sounds to me like the image referenced in the Launch Image Source has a file extension in all caps, such as "image.PNG" instead of "image.png". Just rename the file extension to the latter and everything should work well.

Setting the icon for my App?

![I'm trying to submit my app to Appstore but I'm facing a problem with setting up the icon for my app, I've tried all the variation of sizes for the icon size, but still it's giving me errors , I have taken a snapshot for those errors please help :]
Take 1024x1024 icon and generate other icons form http://makeappicon.com/
The images you use should be exactly in the specified dimensions. Even when you can put them "inside the box" of the UI, they must be correctly sized. Please check your files in the Editor, if they are really the right size.
And then, also try with clean build the project.
Remove the icons (Icon-*) from Images.xcassets, you don't need them there. You just need to drag your icons from Finder into their respective boxes inside AppIcon. And make sure you have the correct size for each icon.

Show splash screen only once IOS

I understand, Its a HIG violation to play around with the default launch icons and splash screens, but I have requirement such that, I need to display the splash screen only for the first time, Is it possible to implement it ?
One simple solution, I can think of is : displaying as an imageView on top of UIwindow and then removing it based on a timer. Am looking for other options.
My advice is to rework your view hierarchy so that the first view mimics the splash screen you wish to show (A view controller with a uiimage embedded should work fine for what you've described). Then push the "main screen" over top of that view after your specific period of time. A little code to ensure that this happens only on the first run with some persistent storage and you should be good to go.
I do not advise working with UIWindow directly. Doing so can lead to all sorts of headaches.
That is to simple.
But you aren't need to manipulate the launch image, but an image loaded by your app.
To prevent to launch the second time you can set a flag in the internal storage.
Make sure to use a lazy load / initalization technique and display the image fast as much is possible, than do the initializations.
I hope it helps!
If you use iOS6, you can use restoration feature.
At first run your app will show launch image. All other runs it'll show last state screenshot.
So you know its a HIG violation but looking for some workaround.
You have to have a launch image while uploading the app and showing on first launch.
I assume you dont care about app review in appstore.
Lets think
Launch image has to be in main bundle. And the main bundle is readonly for your code.
I have some workaround but it may work only for second time launch to show the launch image and then no again.
Add your launch image with any name
Add a symlink to your app bundle with name Default.png, which shows the file in 3. step
Copy that launch image to your app directory folder (your symlink in app bundle shows the file) on first launch.
Launch second time the app and see the launch image
Delete the copied image.
When your app can not find a png file which showed by your symlink it can not show launch image
PS: Personally I did not try that but may work.

Launch image does not disappear upon initial app launch but does thereafter

I'm using Trigger.IO's toolkit to add the launch images. After doing so, the app fails to remove them from view after initially starting up the app. After hitting home and then going back to the app, the launch image disappears after launch.
The app isn't actually freezing after launch but just keeping the launch image at the forefront. I used a partially transparent image initially, and it appeared just to have a high z-index. I could use the app, but the launch image remained on screen over the top of everything.
As of platform version v1.4.20 you can control the launchimage visibility (http://docs.trigger.io/en/v1.4/release-notes.html#v1-4-20).
We've seen some instances of very early usage of the Forge APIs causing the launchimage not to show. In most cases, leaving the launchimage to hide itself manually is fine; if you're having problems or want more control over the launchimage, you can use forge.launchimage.hide.
Very odd, the problem seems to have dissipated even though I have not attempted to address it directly considering it was merely a config file change.
I'll report back if the problem surfaces again, but all is well currently!
Try add to use this code line
[window setRootViewController:mainController];
For full help, we need a some your codes

How do I separate the app icon from the launch image in an iOS app

Thanks for the time to look. I have a weird problem. my Launch image (AKA Splash screen) seems to automatically be tied to my App icon. so I cant change one with out changing the other. In other words, when I add a new app icon, it changes the launch image to match.
I am guessing this has something to do with the .plist file, but I cant figure out where to fix it.
Thanks for the time!
You can specify them differant in plist file. See here
ALSO
Check Apple's link for default name of different files. You just need to rename with default name and add the image files in your project.

Resources