0

I'm trying to build a sample app (using Swift 4), now I would like to add a function: To display images and labels dynamically.

For example: sometimes, I would like to display an image in the top of a ViewController, just like the following picture shows:

enter image description here

But sometimes, I would like the display the image in the bottom of the Summary label, or some other positions.

Is there any way to make it happen? And the most important is: There is no way to modify the codes, once the app submitted to App Store. So, the logic may be implemented from internet? I'm not sure about this. Thanks.

PS: I'm using AWS Mobile Hub (AWS S3, AWS Dynamodb) to retrieve images and items.

Vincent
  • 486
  • 6
  • 20
  • When you want to show the image at the top and when you want to show the image at the bottom? Is there any specific use cases? – Jignesh Patel Apr 08 '18 at 19:25

1 Answers1

2

There are few options, check out rollout.io

You can create this screen in react-native and you can upload your .jsbandle on the server, so whenever you want to change this behavior just need to build your react-native project and replace the .jsbundle file on the server.

Look at this blog for detail.

https://medium.com/ios-os-x-development/so-you-want-to-dynamically-update-your-react-native-app-d1d88bf11ede

Note: Apple review team may reject your app.

Your app, extension, and/or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is not in compliance with section 3.3.2 of the Apple Developer Program License Agreement and App Store Review Guideline 2.5.2. This code, combined with a remote resource, can facilitate significant changes to your app’s behavior compared to when it was initially reviewed for the App Store. While you may not be using this functionality currently, it has the potential to load private frameworks, private methods, and enable future feature changes"

  • Thanks for the excellent answer, Jignesh. It really helps a lot. But hotfix seems a little bit heavy for me. What I'm trying to achieve is: For example, I have a website to load, but I wouldn't like to load the website using SFSafariViewController or UIWebView. I would like to load the texts and images (from a website) as UILabel and UIImage locally, so that the app will look like a native app, instead of a mobile web browser. But texts and images in website shows dynamically. Any ideas you can share with me? PS: I'm using AWS Mobile Hub (AWS S3, AWS Dynamodb) as the back-end service. Thanks. – Vincent Apr 09 '18 at 02:42
  • Do you get position/location/sequence where you should display image or label? I mean how you will decide where to display image or label? Is it based on image/label content size? – Jignesh Patel Apr 09 '18 at 10:57
  • Nope, the position/location of images or labels may stay in different places. I mean, different articles (websites) may have different contents. Sometimes, images are in the top, sometimes in the center, or maybe in the bottom. About the size, it's ok to set up image/label in the same size. – Vincent Apr 09 '18 at 12:26
  • Are you downloading only text/images or downloading different articles in html form? As you say different articles (websites) it means it can be any content including text/images/video and other. If this is the case then you have to map html response to native controls. And there are different ways that styles applied to html so first thing you need is fixed format of html then find or

    and it style like height and weight based on this values you can create native screen to replicate webview. It’s lot more of work for simple screen I don’t see any major benefit using native.

    – Jignesh Patel Apr 09 '18 at 13:50
  • Thank you so much, Jignesh. You are definitely correct. "Map html response to native controls" or "parsing html" may be the appropriate way for me. I used to have a search on "parsing html" before asking for help here, but got no such useful information. I only found: Swiftsoup, Kanna: https://stackoverflow.com/questions/31080818/what-is-the-best-practice-to-parse-html-in-swift. But I have no any experiences on Front-end (CSS, Java, PHP, Node). Any way, really appreciated your help. Wish you a nice day. – Vincent Apr 09 '18 at 14:10