Create a guide (tutorial) for my ios app - ios

I am creating swift app and I would like to create some tutorial to it(or something that will show how my app works). I have found only this question Creating a tutorial for my iOS app with page control , but it is in objective-c. So my question is: How can I create a tutorial for my ios app , or if you know some page in swift where can I read something about it. Thank you.

You can implement this yourself by adding the view(s) and controller(s) as usual and add NSUserDefaults to check whether the user is starting the app for the first time or not. If not, you can trigger a segue to your normal Home-ViewController.
Alternatively, you can use one something similar to these:
https://github.com/ariok/BWWalkthrough
https://github.com/Athlee/OnboardingKit

Related

How can I share a url from a browser to my app in iOS?

TL/DR
How can I make an iOS app appear on share sheet to receive shared urls from any other app?
This is a super newbie post as I have never really touched swift to develop anything, but I couldnt find the answer to my question on google so i wanted to start here. Almost everything I found by googling around is UIActivityViewController which appears more to be about how to share content from my app to another app; while what I am trying to do is share urls from another app to my app.
I am try to build a simple app for ios (doesnt have to be old version compatible because it will be only used by me) that can be a receiver for shared urls from apps like safari, brave or youtube. All the app does is when user clicks on the share button, and then chooses the app, the app gets the relevant data that is being passed, and then posts it to a backend server.
I can accomplish this on my android app/devices with an intent filter action android.intent.action.SEND in the manifest, and then listening for it with Intent intent = getIntent() in my method.
Would someone be kind enough to point me in the right direction at what I should look into (google about). If you can also point me to some sample code examples on how to write an app that can be the receiver for shared data (like urls), that would be fantastic. I am not sure what to search for so that my app can show up on share sheet, and how to then react with the data.
Again, apologies for the super noob question, but I couldnt translate my idea to something relevant on google.
It can be achieved by an Action Extension. Search for it.
Here is one:
https://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794
I think both Share extension and Action extension can do the job. It depends on your needs.
Check this table to make sure which one is more appropriate for your purpose.
You can refer to App Extension Programming Guide by Apple.

UILocalNotification in Swift

My app uses UILocalNotification. On some action from a user, say press of a button, I need to cancel ALL UILocalNotifications, which were set by my application. I have found a solution, however this didn't work out in all cases. The solution was like this:
let scheduledNotifications = UIApplication.shared.scheduledLocalNotifications
scheduledNotifications?.forEach {
UIApplication.shared.cancelLocalNotification($0)
}
Trying to fix the bug (one or several notifications were not cancelled), I've found a shorter solution, which was simply this:
UIApplication.shared.cancelAllLocalNotifications()
The latter one seems to work just fine.
What don't I understand? Is there really some difference in functionality of these two snippets of code?
Accompanying question:
1) Specifically, notification set by another version of the app was not cancelled by the first solution.
2) What is happening on rolling out a new version of app? I mean, what about UserDefaults and LocalNotifications set by previous version of the app? Are these kept between different version of the app? What happens with the app on update from App Store?
Any help is appreciated. Thank you!

iOS Show UIAlert in Safari when using My App's Share Extension

I'm developing a simple content blocker for iOS 9+ devices. Everything seems to be working fine in terms of blocking ad's / trackers etc and I even have the ability to 'whitelist' websites directly from Safari using a Share Extension Action.
My question is when the user taps Action > My Apps Share Extension [which adds it to a list inside the main app] I want to show a simple Alert that says something like 'This site has been added to your whitelist..." for a few seconds and then disappear.
... how do I do this?
**UPDATE I have read all of Apples documentation on this but still can't figure it out. The post here does actually refer to how to design a streamlined UI but doesn't really cover my situation.
Hoping someone will know :-)
Why you don't use Notifications for this , you can have your notification style set to show like an UIAlert. You can see something like that in Calendar app in iOS.
UPDATE:
I did a little bit more digging , it's not possible to change the style programmatically according to this. So the best choice is handling it when your app is in foreground. I can't think of any other OS wide solution other than local notifications.

How do I make a live text feed for announcements in my app? [duplicate]

This question already has an answer here:
How to send in-app announcements to people using my iOS app?
(1 answer)
Closed 7 years ago.
I would like to add a text feed to my iOS app. Basically, it would just be an updatable UITextView or UIScrollView that would display announcements/news (not an actual news or RSS feed though) on the home page. I want to be able to update this field remotely from my computer to give it a set number of messages/announcements to display one after another in a loop. I don't want to have to update the app to manually add them in via Xcode. I only know Objective-C.
How would I do this? I can't seem to find any tutorials for it. Maybe I'm just not searching in the right way. Can someone refer me to a guide or tutorial or even just a GitHub project I could implement? Thanks.
Edit: I see that a similar question has been asked after all, but I still don't understand the answer given. I'm still new to coding apps so I don't know how to use "initWithContentsFromURL." The person clearly knew what they were doing and so they did not get further explanation. Are there any good guides on how to implement this? I understand you would need to set up a website to store the data, but I'm not quite sure how you would do that. An example of the whole process of setting up the website to store this data and then retrieve it with the function would be helpful.
Look at push notification APN, there is a good tutorial for how to implement push notification
If the messages will only be displayed while the user is inside the app, there is no need for push notifications (which will also allow you to contact the user when the app is closed). The app can simply check with a remote server for the most updated content that needs to be displayed whenever the user launches the app (or whenever he/she enters the screen, or once a day - depending on how often you plan to update that info).

iOS first time user tutorial

I'm building an iPhone app and want to create a 1st time use tutorial for the user. I've seen some other apps use popover style baloons to guide the user through the UI and I'd like to do that as well. I have a popover library. What's the best way to create and track the steps of the tutorial?
I would go with NSUserDefaults. Just trigger some BOOL-ean values to change as each part finishes. I assume you want to continue the tutorial if the user quits the app, so this would be your best and easiest bet.
BOOLs for each dialog? Persisted however you want - NSUserDefaults or plist, json file, xml, whatever.
You can also use NSUbiquitousKeyValueStore if you want to setting to sync across devices using iCloud. If the user doesn't have iCloud configured it will just store it locally.

Resources