Post

Replies

Boosts

Views

Activity

Reply to Fatal Error Unexpectedly Found Nil When Unwrapping An Optional Value In Xcode Fix
You are force-unwrapping "model", using "model!" If model is nil, this will cause the app to crash. So the first thing to check is, is "model" set? e.g. if let model = Bundle.main.decode(BookModel.self, from: "Book-v1.json") { print("got model") } else { print("no model") } If "model" is not set, then you need to understand why this line is failing: Bundle.main.decode(BookModel.self, from: "Book-v1.json")
Topic: App & System Services SubTopic: General Tags:
Sep ’22
Reply to Wrong SF symbol displayed
This may not be quite what it seems. If we just have... var body: some View { Label("Explore", systemImage: "airplane.circle") } ...then the correct image is shown. I suspect the filled-circle effect you are seeing, is a by-product of using the image in a TabBar. That is, the image is correct, but it is displayed in a way that you did not expect.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Time of my launchscreen is too long since I changed my json file
Your new json file has several errors (the first is at line 1009). Use an on-line json checker, to help you to fix it up. Parsing a large json file on app startup is probably a bad idea... but fix the json first!
Replies
Boosts
Views
Activity
Sep ’22
Reply to Beginner in iOS and watchOS development
Yes. Typically, you would use Apple's TestFlight to distribute builds to your testers.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Images with names stored in an array are not displayed.
Try changing: Image("\(countryItem.image)") to Image("\(countryItem.image[num])")
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Images with names stored in an array are not displayed.
Did you try removing: .overlay(Color.black.opacity(0.1))
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Images with names stored in an array are not displayed.
Does the file definitely have no file extension? (Note that Xcode could be hiding the file extension.). Check the source file on disk.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Cannot convert value of type '[Int]' to expected argument type 'Int'
In CountryItem, "image" is an Int (a single Int value). In countryList, the "image fields are [Int] (arrays of multiple Int values). You can't mix and match. In CountryItem, you probably want: let image: [Int]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Fatal Error Unexpectedly Found Nil When Unwrapping An Optional Value In Xcode Fix
You are force-unwrapping "model", using "model!" If model is nil, this will cause the app to crash. So the first thing to check is, is "model" set? e.g. if let model = Bundle.main.decode(BookModel.self, from: "Book-v1.json") { print("got model") } else { print("no model") } If "model" is not set, then you need to understand why this line is failing: Bundle.main.decode(BookModel.self, from: "Book-v1.json")
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Images with names stored in an array are not displayed.
Is the first image name (as stored in the App Bundle) "0" or "0.png" (or "0.jpg")?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Type 'MenuItem' has no member 'example'
You still have not posted your code for MenuItem, so it's hard to say anything more. Somewhere, you have a "struct MenuItem", or "class MenuItem"... ...that's what we need to see.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Drawing multiple MKMultiPolygon, one or two polygons getting disappeared at certain zoom levels
See also this post: https://developer.apple.com/forums/thread/710333?answerId=721194022#721194022
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to using in-app purchase to charge user, how would I pay my users back
I doubt it. Unlocking features or functionality requires using Apple's In-App Purchase... ...except as set out in 3.1.3(a)... ...which covers “Reader” Apps... ...and I don't think that applies to your case. https://developer.apple.com/app-store/review/guidelines/
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Mac unable to detect multiple external displays
The 13" MacBook Pro (with Apple Silicon) supports a single external monitor.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Error while submitting app to the store
Typically, these would link to the relevant pages on your website.
Replies
Boosts
Views
Activity
Sep ’22
Reply to Type 'MenuItem' has no member 'example'
You will need to share your definition of MenuItem
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Wrong SF symbol displayed
This may not be quite what it seems. If we just have... var body: some View { Label("Explore", systemImage: "airplane.circle") } ...then the correct image is shown. I suspect the filled-circle effect you are seeing, is a by-product of using the image in a TabBar. That is, the image is correct, but it is displayed in a way that you did not expect.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22