Transparent splash screen on the first (and only first) startup of an app for instructions (iOS) [duplicate] - ios

This question already has answers here:
How to detect first time app launch on an iPhone
(17 answers)
Closed 9 years ago.
I have a simple app where the buttons are in the form of logos rather than text. Things like undo, reset, settings, etc... I'm trying to keep the interface simple, so I just want to have instructions shown on the first ever startup of the app. I've seen this done in other apps, where a transparent subview with labels is loaded, then touching the window dismisses the subview.
I currently have the launch count stored in NSUserDefaults, so I just need to figure out how to add the subview on top of the main view, which then gets dismissed on a touch. I would like to just load a png that fits the screen size in the subview.
This seems simple, but I am having trouble not overcomplicating this process.
Thanks!

check for your NSUserDefaults for the first launc and if it is then you could display your image as a modalViewController and to dismiss it on touch use touchesBegan metod to dismiss this controller.

This seems simple, but I am having trouble not overcomplicating this process.
What have you tried?
There's not much required to add a view to another view, but you don't even have to go that far. You could add your instructions view in your .xib/storyboard file and set it's hidden property to YES. Then all you need to do if the user is launching for the first time (or if they ask to see the instructions again) is flip the hidden property to NO, and then back to YES when they touch it.

Related

Firebase Screen name issue with modal views in iOS 13 and above

In our app we are tracking screen views manually by adding relevant codes in viewWillAppear functions. With iOS 13, with the non fullscreen modals, the viewWillAppear of the parent screen won't get called when the modal is dismissed and hence wrong screen names are reported there after, for events originating from the parent screen.
I have checked the Detecting sheet was dismissed on iOS 13 , but the solution to implement  UIAdaptivePresentationControllerDelegate helps when you manually swipes down.
I then turned off manual tracking and turned on Automatic tracking and surprisingly the screen classes are determined right. Question is how Firebase is figuring that out?
Of-course I can't use auto tracking as we need custom screen names.
I believe this could be a generic issue for whoever using manual screen name tracking and have non full screen modals. Just wanted to check what's the best way to solve this.
Couple of ideas I had was
Make all modals full screen. Not nice for our app
Implement extra delegates in those modals to let the parent know its dismissed. Not sure its a nice way
Setting screen names on each event? Could that be even possible?
If there are any other nicer/ cleaner option let me know.

Swift: Animation code on LaunchScreen [duplicate]

This question already has answers here:
iOS Launch screen code not running
(2 answers)
Closed 5 years ago.
I want to rotate an app logo on my Launch Screen (LaunchScreen.storyboard).
This link helps me in getting the code to rotate an image. However, where can I put this code?
Since there is no class file associated with the Launch Screen, how can I acheive this?
You can't directly do that as the launch screen is static. Even if it's set up via a .xib or a storyboard file, it will appear as a snapshot of the initial state of that scene.
You should create a view controller with the same look as your launch screen and animate that.
You can't achieve that. Before LaunchScreen.storyboard you was putting only static images in order to be shown on launch. LaunchScreen.storyboard is introduced later to simplify the generation of static images.
But you can kind of workaround it. You display exactly same looking view controller just after launchscreen and run animation. But there will be a little delay.

launch screen customising

I'm new to swift and Xcode, and I'd like to know is there anyone willing to explain to me how exactly should I make my launch screen to show for 3 seconds and in that time slightly fades out?
I want to do a web view of a web page that I built previously, but want it to do the launch screen with fading before.
I've read all other questions related to the topic, but I don't understand them. Also have been following some tutorials on the subject, but nothing.
Anyone, please?
You can't do anything on your launch screen.But try this out and see if it's okay. Let's say you want to give a fade-in animation for an image in the launch. Let's assume that your launchscreen background color is blue. Make another viewcontroller and make this the first viewcontroller right after the launch screen. Make the background color of this view blue and add the image to that view. You can animate the image with UIView.animate method with a delay of 3 seconds or something. Doing this will make it look like an animation in the launch screen.
You can't do this in the launch screen.
That is not what the launch screen is for.
If you want to do this you will have to create a secondary "launch" screen that your app loads first and then load the web view and when it's loaded push another view onto the screen,

ScrollView and viewcontrollers

Here is context for my question, this is an optional read:
I have to develop an app for a
school project. At the end of the year some people I don't know will
listen to me presenting my app, and review my presentation and my app
(note that they will probably not be app developers, they are usually
IT professors) (note also that I'm allowed to ask for help to anybody,
and I can use internet since I do this mostly on my "free time")
So since October I'm developing my app, that takes a lot of time
because this is my first app. And here comes the issue:
My app is a giant Scroll view with 5 NavigationsControllers, each containing a ViewController. These ViewControllers sometimes have buttons that leads to an other ViewController. The problem is when I use these buttons, and another view controller is displayed, when I swipe right or left the ScrollView scrolls and another ViewController from the scrollView is displayed. I don't want this to happen because most of the time the ViewController displayed after the tap on a button is not meant to stay, it's generally a form to send data to the server.
As I think this is difficult to understand, you can download the project on Github
Is there a way for me to disable scroll on chosen ViewControllers? or should I change everything to avoid using a ScrollView?
Bonus question:
Is it a really really bad idea to make an app this way, or did I just miss something?
Thanks for your help!

how to make a view appear only if is the first time? [duplicate]

This question already has answers here:
Show screen on first launch only in iOS
(8 answers)
Closed 9 years ago.
Thanks in advance .
I wanna make a view appear only if the application is launch for the first time, I have work with a similar code to display Alerts, but I can find a way to make it with a Storyboard view ? For example my idea is : in the image below I have 7 buttons so I want the user to select which Country/Button they wanna use after this first time launch (it will be a button where they can change it back ) and how can I save the value of the button (the one that the user choose) so that every time the app launches again it goes straight to the one they selected when the app was installed ?
Thank you .
There are two pretty easy solutions I can think of.
First, in both instances, you'll be duplicating much of the same logic you say you've used previously in displaying a UIAlertView.
Option 1: Have the view with buttons that should only be displayed once as the first view. In the viewDidLoad method, check whether the app has been launched before and a button has been selected. If a button has been selected before, just go ahead and perform the segue straight from the viewDidLoad into the rest of the app.
Option 2: This time, instead of starting with the 1-time view, start with the standard first view. Check if the app has been launched before or not, and if it has, perform a modal segue into the view where they select a button (otherwise just don't perform the segue).
I'm certain there's a more elegant solution to get this work in a better way, but this is a pretty simple implementation that should be quite easy to get working.
I would us an NSUserDefault here. First check for the presence of a preference for the key you specify. If it doesn't exist you'll want to show the region selection view. If it does exist just use the region stored in the preference.
This way, if the preference every gets deleted or lost, the logic will be small enough that the user can recover fairly quickly.

Resources