|
Hi All Just curious as to how I add or amend the images in the iDine example app Paul has on his site please? I tried two methods of creating new images, by replicating what I see in the downloaded images folder and amending the existing images, and also by adding new images of my own, then updating the respective json file with the correct data (though not entirely sure of the ID field format - it's very long HEX type string). However when I do this it causes issues in the presentation of ContentView and ItemDetail files vis-a-vis the images are not there!! What would be the correct process here please? Thanks John |
|
Hi John You will need to add the two image sets to the then in the menu.json file add it
what happens is the
as you see that it take the name in JSON and then replaces the space with "-" and makes it lowercase and for thumb adds -thumb which is then used to call image. Hope that makes sense Nigel |
|
Many thanks Nigel - yes, I see what you have explained, many thanks for your help here - I am very much learning!!! However... I am getting an error. Here's what I have done... In the json file, I added this...
And I created two images, one at 1024x1024 and the other at 60x60, and named these; 80M-band.png 80M-band-thumb.png When I build this to the simulator, I get an error on line 24 of Helper.swift which says "Thread 1: Fatal error: Failed to decode menu.json from bundle." Any pointers? |
|
UPDATE: Nigel - I think I have discovered what the issue is. It appears the code won't accept image names starting with a number! When I changed the name of the image to "eighty band" it worked, as long as I don't have the name entry starting with a number as well. Not sure how I am going to work around this one, as for me it is important for what I want to use the app for that I can use numbers in the json name field. Any ideas for me please? |
|
Hi John, The Fatel Error was NOT due to the the name of the image but to do with the syntax of the JSON file. If you miss a comma, open brace, close brace etc then it will not decode it. I use JSON Editor Online (copy/paste in then it tell of error) to check for errors in JSON file.
|
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.