Post

Replies

Boosts

Views

Activity

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
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 SwiftUI How to pass a CoreData object to an other view
Just pass the Preview a Timer... struct TimerRow_Previews: PreviewProvider { static var previews: some View { TimerRow(timer: Timer()) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Looking for Advice: Adding a Mac App to an established iOS app
Generally, you would add a new Target to the iOS project. Then you can share code that is common to both targets, and have other code files that are target-specific. In shared code files, it is possible to mark code as applying only to a specific platform.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to SwiftUI NavigationLink with action in List
It might be cleaner to have the action take place in the view you are navigating to, using .onAppear?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Should we try publishing our iOS inspired browser extension to Safari?
My first thought is that Apple may be unlikely to approve something called "Bonjourr", since they already have a technology called "Bonjour".
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to M1 max test the ML
Do you have a question?
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Where to begin? Help with the following musician app idea for personal use:
Did you make any progress on this, @modern?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Mapping Real Life Object
Is your cube virtual, or real (like this one, at Boughton House)? Have you looked at "Tracking Geographic Locations in AR"? https://developer.apple.com/documentation/arkit/content_anchors/tracking_geographic_locations_in_ar
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
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.
For your next question, please try pasting your code into a code block (using "Paste and Match Style"), instead of using screenshots.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
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:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Where do I get the official apple logo files?
Apple provides several Sign in with Apple buttons... see: https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/buttons/
Replies
Boosts
Views
Activity
Jan ’22
Reply to Placement of the Touch Bar on MacBook Pro models
It's an interesting idea. I like the Touch Bar... ...but since Apple have removed it from the latest MacBook Pros, I think they are unlikely to bring it back (or anything like your version) in the near future.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Why is the Button not working? SwiftUI
Works for me... ...make sure you have the Console visible, and not just the Variables View (which uses the same space, and can sometimes hide the Console)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to How to fix these errors?
You have not defined "aspectRatio"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to What is the default assumption if Apple Documentation does not say whether a certain method can or cannot be run on a background thread?
I would say that if the documentation does not specify a thread, then any thread can be used, as long as UI updates take place on the main thread.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22