Will I be able to restart my iPhone app programatically to apply language changes in Swift [duplicate] - ios

This question already has answers here:
Force iphone app to restart programmatically?
(7 answers)
Closed 8 years ago.
I am developing an iPhone app in swift and wanted localisation feature inside it.
When the user selects a language in the app, the UI components such as labels/buttons,etc.,. fails to change the language and takes more time in some cases also.
So i needed to manually restart my app when the users want to change the language.
Can anyone please suggest me how to do that.
Thanks in advance.

Swift is a language, not an API. You have the same functionality available to you in Swift as in Objective C, although the syntax and ease of use may differ between the languages.
The answer you linked to therefore already answers the question.
Also, as Hemang points out, don't do this.
It's symptomatic of bad design that you would need to restart the app to change the displayed language.
It would be much better to fix the underlying problem than to apply a hacky band-aid solution such as this.

DONT EVER DO THIS... else you'll surely reject by Apple, I don't know what problem you're facing after user change different language from your app, because I'd worked on this kind of app before (which supports multiple language and user may able to change it while current running of the app). I don't have idea with Swift but in ObjectiveC it works perfect.
From Documentation, https://developer.apple.com/library/ios/qa/qa1561/_index.html
Warning: Do not call the exit function. Applications calling exit will appear to the user to have crashed, rather than performing a graceful termination and animating back to the Home screen.
NOT RECOMMENDED but still, you can ask user to Restart their app whenever they changed the language with proper message like, " needs to restart to take effect of language change, [please save your any on going work] and close and again open the app to see the effect, thanks !"
Here, the words inside <...> should be your app name, and [...] need to show if you're making an app that needs to save user information before exit?.

Related

How can I automate specific settings in IOS?

I’m no new user of Apple products, but I am brand new to coding and automation on iPhone. I’ve created an automation that does something at a specific time of day, but that’s as far as I’ve gotten because there’s limited settings they offer without me coding anything in. I’m trying to change a specific setting in the settings app “Notifications->(App)->turn notifications off” but I’m not sure how, or even if it’s possible to do, outside of what’s already programmed in. Thanks in advance, if anyone figures it out and lends a hand. (Edit: I would automate Do Not Disturb because that seems like the simple answer, but long story short, I don’t want anyone to see banners of messages and read my texts without my phone unlocked, and Do Not Disturb doesn’t do that as far as I’m aware.)

how to upload picture and event in my Published App Xcode 6

i am New user for Xcode in swift and i published my app to App Store. i could only connected with Parse ( Push notification Service )
but actually i want in future to change the background of my App or to add New Event. i know it is possible to do all this things with backend service but i heard that i have to design the code in parse, there is anyway to find the sample codes like push notification in Parse or somewhere else?
i will really appreciate if someone can help me.
"I want in future to change the background of my App or to add New Event"
These are hugely different scenarios.
Its pretty trivial to use Parse to change a screen background. Just save your existing background image as a file (eg as a UIImage) in Parse, and have your app download the image from Parse and set it as the background image of your UIView. Change the file and all users will see a new background. You would need to do this when the app loads (or at least before you access this screen), or else there will be some annoying delay when you access the screen with the new background image.
Adding a new event sounds close to impossible, as it involves modifying your code. But your compiled code is "signed", and as such is designed by Apple to be impossible to change without going through the market. Any app which could do that could bypass the market and potentially directly download malicious code. And nor (as far as I know) does Apple provide any support for extending or changing code within iOS. If its not actually impossible, I expect it would be so difficult and require so much knowledge of iOS as to be infeasible for the average programmer.
EDIT: You have now clarified as to what you mean by "Event" in your comments. This is just data which you load dynamically (and not an "event" in the programming sense). Yes you can do this through Parse (and lots of other ways), just read/load the data through Parse. Very easy to do, have you read Parse's excellent tutorial?

script the released version of my iOS app?

I have a released app. I would like to add a help functionality that runs a few simple scripts. In other words, it programmatically highlights a button, presses it, highlights another button, presses it, and so on. Is there a sensible way to do that?
I'm thinking of something like UIAutomation. However the Apple doc linked above indicates that it requires that the app be code signed with a development profile. So it won't work in a released app.
I'm not going to add somebody's library to do this. So if the answer is that you can do it, but you have to either write a lot of code or link a third-party library, it will make more sense for me to hard-code everything in Objective C.
first:
Apple forbids App Store apps to interpret code so real scripting isn't allowed AFAICS but anyway:
technically:
if you don't want a ready made 3rd party lib
you'd need to write a lot of code (though a lot is relative ;)
=> if the 'scripts' are simple, hardcode them in objC.

disable/hide settings depending on a switch on ios

I've made a settings screen using the Settings.bundle/Root.plist
Recently my client has seen some apps disable options based on a switch. And now they want something like that.
After searching here and apple resources a lot of people say it's not possible, but I see some apps do this. My question is how can i disable or hide an item or group based on other option.
The apps that do what i'm talking about are using the iphone's definition app, so it's not a costume settings screens in app.
Sorry for the bad english. Thank you for any assistance on this matter.
I'm just going to repeat what the others said and say that it is not possible. It is a static list, always. If you think you've seen an app that does do it, please indicate which one that is and what setting this pertains to. I'd be interested to take a look at that.

Phonegap iOS app: change keyboard appearance to UIKeyboardAppearanceAlert (again)

A couple of months ago, I posted a question asking if and how phonegap users can alter the keyboard appearance to the dark alert ui keyboard (UIKeyboardAppearanceAlert) without targeting individual textfields. I did some extnsive reaearch myself and offered a bounty but yet the question remained unsolved.
Alter keyboard appearance in native, phonegap/Cordova built iOS App
As of today, I'm still struggling to get this resolved and simply over with. I do realize much probably hasen't happened since last time I bothered you with this question, however, two things have in fact changed which somewhat justifies this seemingly double post:
Phonegap has released version 2.1 which does some new stuff, perhaps this is possible now?
As my client expects me to solve this in any way possible, this time I would also like to ask you for an alternative approach. If it still can't be done, would it be possible to custom make a "keyboard" of my own? I know this of course is technically doable, but is it in any way a recommended approach that would be considered in at least some way smart and justified? As I said, my client pushes hard for this and is not in favor of rebuilding the app completely natively.
Conclusively, as of today is there any way to do this with phonegap / Cordova? If not, would you recommend me to custom make a keyboard using HTML CSS and JavaScript, bearing in mind this is a major comsern for my client? If so, are there any good plugins that I can use as a start? Please check out my old post (linked above) to see what has already been tested.
Thanks in advance,
Jonathan
I know this is quite old but I came accross it looking for the same thing. Anyway, I have found a possible solution which would be to create a plugin for Cordova http://cordova.apache.org/docs/en/2.6.0/guide_plugin-development_index.md.html#Plugin%20Development%20Guide
It does require some native coding but would atleast avoid starting an app from scratch which has already been built in Cordova.

Resources