How to update a label text every day so that the user gets another predefined text every day? - ios

I am trying to do a simple application but I am very new to Xcode and Swift.
I am trying to do an application that has the following functions:
one text
one picture
one button
By pressing the button the text changes into another text, the picture into another picture and the button disappears. All these items must be predefined.
For now, I have one text, one picture, and one button. When I press the button, everything works. The picture changes, the text too, and the button disappears.
Now, how can I update those items every day?
And is it possible to make the button disappear until the next new updated text is shown?
What I mean is that once you pressed the button the first picture will not be shown anymore but it will stuck on the second picture until the new updated text and picture comes out?

Ok so what you can do is,
When user opens your app, you can call a service and check whether you have updated text. If you get response, you can unhide the button and on click of it you can change the data.
Whenever your data gets updated, you can send a silent push notification to your app and store that data. And the next time user opens your app, you can check the data and unhide Button if data is present.

Related

Custom Button like iOS Clear Button In Notification

I need to add clear button in table view section header. It is exactly same like the one in notification center. So when user clicks it, 'x' will change to 'Clear'. If s/he clicks it again, app will perform action. But any click outside this button, 'Clear' will be back to 'x'.
Reference: http://share.framerjs.com/5hc7e6kwtwfm/

How to show keyboard programmatically in Firefox OS?

I am working on a ToDo list app wherein I keep the focus on the textbox input after the user adds a ToDo item.
Now, the problem is, when the user adds some text input and hits the add button, the focus on the textbox is lost so the keyboard disappears and then the focus gets back to the textbox. So, the keyboard disappears and appears again in a short interval. As you can imagine, this is bad UX.
How do I set the keyboard to be shown explicitly when the focus is on the input button?
I fixed it by setting the focus onto the textbox first when I click the add button then do the actual adding stuff.

UIButton close to keyboard does not receive touch event

You can test by yourself by cloning this repo https://github.com/sey/ios-keyboard-test.
The problem is the following:
When you enter text in a UITextField and you want to quickly tap a button which position is close to the keyboard the button does not receive touch event at first. You need to wait a small amount of time before tapping on the button does anything.
In the linked project the button action is set to clear the text field. If you enter text and touch the button quickly you will see that the text field does not get cleared and you'll have to touch the button again. If you tap on the button that is on top of the text field (not close to the keyboard) everything work as expected.
I suspect this is a bug from Apple. And I suspect this comes from the fact that some keys on the keyboard show other keys when you long press them (such as E, U). And maybe a hidden frame prevents from touching the button immediately after entering text.
My questions are:
Can you reproduce the bug? And do you know if this has already been
reported with a workaround or else?
[EDIT] Please test in landscape mode.

UITextView work wrong

I have a Chat screen which have a UITextView and it can save the text value when user input (Although I go to another view and then back to the chat screen, and the text value which input by user also saved; text value in TextView just nil when user click send button). When I make a call (it means I go to the call screen into my app, not related to the call screen of OS) and then press end call to back to the Chat screen. The problem is the text value of UITextView is nil and rarely, it just save the first letter of the long text. I don't clear text any where. Please help me to explain why?

Displaying at different times

I have a split view app that displays a thumbnail image and a button for continuing to the full view. The label, right now, is just there to make sure that the button works because I have yet to connect the full view. When the app first opens, the image is not displayed since the user has not selected an image at that point, but the button (and label) are displayed anyway. How can I get the button and label to be displayed only once a user has selected which image to view from the table?
Change default settings in Interface Builder for the button to start out as hidden, and also make sure that it starts out disabled so that users don't accidentally click it without knowing that its there, then add the following code to where you detect whether or not the image has been selected.
yourButton.enabled = YES;
yourButton.hidden = NO;
Let me know how that works out for you!
-Karoly

Resources