Post

Replies

Boosts

Views

Activity

Reply to Cannot use instance member 'restaurantOptions' within property initializer; property initializers run before 'self' is available
 In my previous code, optionString was supposed to be restaurantString. Then this line (44): optionString = optionString + currentOption + "\n" should be: optionString = optionString + "\n" + currentOption NO? Does that change how I should approach this in any way or not? Yes, it changes the best way you go.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to ForEach and HStack
The getValue function returns two different types in the two classes, Thanks for showing your code. And your code revealed that if you define a combined entity, your code all things would be solved.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Graphical Issue
I mentioned why I changed those lines of code, it was to reduce the size of the shape drawn to see if it was bug in Xcode. As I wrote in my previous post, you need to change all the CGPoints consistently if you want to reduce the size. So, your code shown cannot be any sort of proof it was a bug of Xcode.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Adding png to ImageView causes black screen
When I attach the intended Launch image to the Main storyboard view it shows correctly,  but it shows black when I attach it to the Launch storyboard view.  Sorry, but can you be more specific and precise? Storyboard does not have a property view which you can attach image. So, what settings can cause a png to show black? To find what, you should better describe what you have done.
Mar ’21
Reply to UICollectionView - Changing UI of one specific cell causes changes for every fifth cell
With filling missing parts with simplified components, I could not reproduce the issue changes UI for every fifth cell. But could find one thing (in a limited context, similar to every fifth cell). You are not resetting the state of addToFavoritesButton: override func prepareForReuse() { self.goSafariButton.isHidden = false addToFavoritesButton.isEnabled = true addToFavoritesButton.setImage(SFSymbolsAsImg.plus, for: .normal) } I guess you need to add some info into your Tweet struct (or somewhere else but retrievable from Tweet) and set the state of addToFavoritesButton in set(with:user:) according to it. On top of that, animation does not finish. Alpha goes to 0, and then the image is being changed, alpha should go to 1 but never gets there. It stops somewhere between 0.7-0.8. Isn't it just a result of making the button disabled?         self.addToFavoritesButton.isEnabled = false Whether you use alpha-animation or not, disabled buttons show system image as if alpha being somewhere between 0.7-0.8.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to Set an array of arrays inside of UICollectionView that's inside a UITableView and return the correct number of items?
Can you show the whole code of SelectedShowVC? As I suggested in your previous thread, we need to know how UITableViews and UICollectionViews are managed, including their dataSources. Especially, we need to know how arregloDeArreglos, modelOfSeason or any other data used for dataSource. here's the data Can you show the data as a JSON text? Which makes very, very easier to test your code. And please show the definition of your table view cell which is currently used.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Set an array of arrays inside of UICollectionView that's inside a UITableView and return the correct number of items?
These lines all causes Cannot find in scope error: arrayCast.removeAll() arrayCreator.removeAll() arrayAiringSeason.removeAll() arrayOfSeasonsInt.removeAll() arrayCreatorName.removeAll() arraySeasonsEpisodes.removeAll() arregloDeArreglos.removeAll() arraySeasonsEpisodes.removeAll() arraySeasonsEpisodes2.removeAll() arraySeasonsEpisodes3.removeAll() arraySeasonsEpisodes4.removeAll() arraySeasonsEpisodes5.removeAll() arraySeasonsEpisodes6.removeAll() arraySeasonsEpisodes7.removeAll() arraySeasonsEpisodes8.removeAll() arraySeasonsEpisodes9.removeAll() arraySeasonsEpisodes10.removeAll() All of them are globals?
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to (Expansion) Retrieve articles from an XML parser
Your new ArticlesParser lacks the property articles and it does not compile. Thing is, since the code for the XML parser is a bit more complicated, it's harder to pass variables around just like with Lunch Card. Once you finished (and once you made it work), ArticlesParser is as easy to use as JSONDecoder. Not sure how ArticleInfo is an integer Unfortunately, the current Xcode generates inappropriate diagnostics when there are type related errors. In your case, the real problem exists in this line: ArticleRow(image: article.img, title: article.title, author: article.author, date: article.date) The type of image is String, but the type of article.img is URL?. date in ArticleRow is String, but article.date is Date?. You need to pass the right type.
Topic: App & System Services SubTopic: General Tags:
Mar ’21
Reply to Adding png to ImageView causes black screen
I thought this part was obvious. When everything is working as expected, it is reasonable to omit something obvious. But in this case, you need to find what's wrong. I tested with a brand-new project of iOS/App (Storyboard/Swift) with Xcode 12.4. Selected 'LaunchScreen.storyboard' (no whitespace between Launch and Screen in my case) in the navigation area Used + icon and dragged Image View into the View of the only ViewController of the 'LaunchScreen.storyboard'  (The image view is placed below the Safe Area of the View in view tree.) Expanded the image view by dragging the four edges to cover whole screen. Added an image to use as background into the project by dragging. (Chose Copy items if needed and some others.) Within the Attribute Inspector of the image view, chose the image (All other attributes kept as default.) The image I have chosen shows filling the view controller of Xcode or the simulator screen when run. (Without constraints, the image may not be placed in the center of the screen.) Can you follow this steps using the background image you want to use? Or do you think of anything you need to mention reading the steps?
Mar ’21
Reply to Core Data Make Decodable
it tells me it doesn't find persistentContainer in scope even though I had persistent container declared in my appDelegate file. It depends where you wrote the line decoder.userInfo[.managedObjectContext] = persistentContainer.viewContext(). Please show enough context.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21