Post

Replies

Boosts

Views

Activity

Reply to Xcode 12.5 iSO14.2 some weird messages
UIDatePicker 0x12151d680 is being laid out below its minimum width of 280. What type of a picker is it ? The picker in automatic is now made of 2 components, date and time, displayed separately. The warning (just a warning) warns that if width is less than 280, there is a risk of bad display with large fonts. Complete warning is: UIDatePicker 0x7f94a4666d40 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
Jul ’21
Reply to Show JSON output to screen?
How is NewsFeed defined ? It is probably a struct or a class. A clean way to do it is to add inside the struct or class a description var: struct NewsFeed { // your var declaration // add this one var description : String { // build the string, with the linefeeds "\n" if needed and return it } } Then, in your code: newsview.text = newsFeed.description
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Fatal Exception UIPopoverPresentationController that sourceView is nil after setting sourceView
Thanks for the more readable code. Does the crash occur in all cases ? I do not see where setPopoverPresentationInfo() is called. But setUpPopoverPresentation() seems to be called instead. In some cases you set a sourceRect with zero size. Why ? As you present small chunks of code, it is very hard to see if something is missing or wrong. For instance, in this code   let popoverPresentationController = dropdownTable.setUpPopoverPresentation(    sourceView: sourceView, sourceRect: sourceView.bounds.inset(.init(all: -5))) what are sourceView and sourceRect ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’21
Reply to App store rejected my app due to conflicts between seller name and company name
When you declared your account, you gave a company name (with its DUNS number). You should find it in AppstoreConnect > Contacts > Contact - Legal Entities. But you cannot change the name now, you should need to completely re-register a new account. What you have to change is the info you provided for the app. As your app is apparently a Lottery, you have probably provided the name of a lottery service owner or government entity. That's what is found inconsistent.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’21
Reply to Show JSON output to screen?
So, I understand you want to show articles. Could you show how Article is defined ? The code would be like: var description : String { var s = "" if articles != nil for article in articles! { if !s.isEmpty { s += "\n" } s += article.content // I don't know how Article is defined } } How do you want to use status ?
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Show JSON output to screen?
Now the articles show up on the simulator, but they are all in raw form. I think I know how to take it from here. Do I put the raw data in a form such as a tableView to be readable? Yes, a tableView is a good way of presenting. It gives a lot of interesting options, as reordering (newest or oldest first) very simply. Then you should populate a dataSource (an array of string) for the tableView. var dataSource : [String] { var source = [String]() if articles != nil { for article in articles! { source.append(article.content) // I don't know how Article is defined } } return source } Note: you can now post image on the forum with the add file button at bottom of editing window: Just take care to reduce the size of image in Preview app, otherwise image is really too large for the forum.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Swift5
I understand you generate random numbers and you get the same several times ? What type of random ? Are they Int ? If I understand your point, you could save the random generated in an array. And each time you draw for a new random, test if it's already in the array, if so repeat the draw. Take care if there is no possibility left (if you call [1...10].random() for instance), not to go in indefinite loop. If you just want the new number be different from the last draw, keep lastValue instead of an array of Int. Here are some sample code: var validDraws : [Int] = [] var allDraws : [Int] = [] let deck = Array(1..<100) for _ in 1...50 { let x = deck.randomElement()! allDraws.append(x) if !validDraws.contains(x) { validDraws.append(x) } } print(allDraws) print(validDraws) Which gives: [57, 24, 81, 69, 11, 97, 6, 64, 98, 77, 3, 54, 70, 76, 93, 52, 7, 71, 86, 5, 14, 87, 31, 80, 35, 18, 67, 32, 4, 64, 28, 53, 14, 16, 46, 29, 69, 63, 98, 23, 45, 68, 20, 56, 87, 19, 13, 95, 65, 27] [57, 24, 81, 69, 11, 97, 6, 64, 98, 77, 3, 54, 70, 76, 93, 52, 7, 71, 86, 5, 14, 87, 31, 80, 35, 18, 67, 32, 4, 28, 53, 16, 46, 29, 63, 23, 45, 68, 20, 56, 19, 13, 95, 65, 27]
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’21