SwiftUI Something wrong with button and canvas

50 Hello there.

I don’t know what am I doing wrong, but after I selected the background image for my buttons, they don’t look like the image and I could not find out why. Anyone can help me please?

Another thing. I also don’t know why, but my canvas is like disabled. I can’t select anything on the canvas. Can’t click on the buttons, labels, etc. The only thing that happen when I click on it, is the blue bar around him. Can anyone help with this too?

Thanks!!!

Hi @sunwalker, welcome to the forum community! What episode were you on when you noticed the background image for your buttons were not correct?

Hello @gdelarosa, thanks!
In the episode 43.
I tryied to download the project and still not correct in my xcode.
I can’t click on views on the canvas. I try and select all the canvas instead of the view I selected.

If it helps, I can make a short movie later to show this happening.

  • Sorry for my bad english…

Hey @sunwalker, when you click on the assets folder of the project, do you see these?
54%20PM

As for the canvas issue, have you tried restarting Xcode and your computer? I’m not certain why the canvas is not capable of responding to your clicks. It may be a bug within Xcode. Are you able to use the canvas when working on other projects?

Hello. No, only these:
13

I’m following the new course about SwiftUI, these you showed is from the UiKit course, isn’t?

About the canvas, I restarted it… And on other projects it is working.
I’m trying to attach a video in a .zip file, but I’m not allowed.

Hi @sunwalker, I was able to view the assets from this link https://www.raywenderlich.com/4919757-your-first-ios-and-swiftui-app/lessons/43. Is this where you are?

Hello,
I have similar issue but the yellow background images doesn’t work on my buttons (they’re just black). This issue occurs when running via my device (works fine on simulator)

PNG

@arminex Do you still have issues with this?

@sunwalker Do you still have issues with this?

Hi @arminex,
I don’t know the exact problem with your code as I cannot see it. However one issue that we were also stumped by with Xcode and iOS 13 is that the assets create a folder that does not match (case wise) the name you give it. This can result in the asset not being available as it is case sensitive on the device.

cheers,

Yes, this is still a problem in iOS_Apprentice_v8.1.0
…which also occurs when building/running: chapter-08-final

SOLVED

I was having another, (unrelated?), problem as well.
I was unable to run against a physical device. (“too many devices”?)

Since I wasn’t able to resolve that problem through my Apple Developer Account, I created a new Developer Account and added the new account in Xcode and…

Now I’m able to run against a physical device, and the buttons show correctly on both physical device and simulator.

I can’t explain why, but there ya go! :wink:

This topic was automatically closed after 166 days. New replies are no longer allowed.