Post

Replies

Boosts

Views

Activity

Reply to SplitviewController not as rootViewController
Apple say: "...the split view controller is typically the root view controller of your app’s window." typically... so it doesn't have to be. Alternatively, can't you just set your rootViewController in code (based on some condition, where the app supports SplitViewController)? if supportsSplitViewController { appDelegate?.window??.rootViewController = splitViewController } else { // something else... }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’22
Reply to I can’t see the images leaving some even if I name them the same even if I run it or use simulator it’s the same.
In a SwiftUI ForEach, each item must be uniquely Identifiable. In your ForEach, you use the "id" parameter, to specify how to uniquely identify each item... ForEach(clothimages, id: \.self) If your items are not unique (they are not!), then they will not display correctly. This is how ForEach works. In your clothimages, it is the image name that must be unique, for the ForEach to work. Update clothimages, so that all image names are unique. To print text below your images, try: func maincustom(content: Image, text: String) -> some View { VStack { content .resizable() .frame(width: 200, height: 250) Text(text) } .padding(8) }
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22