Can I make my iphone app use only a portion of the screen - ios

I was hoping to create a small windowed screen when the home button is pressed. It would keep a portion of the app process open while another app isn't open.
So say I had music playing on the app and when the home button gets pressed the screen would be windowed or shrunk and just displayed over the main screen (kind of like the little help button that can be moved around). Would using widgets in IOS 8 work?

When the user presses the Home button, the app goes to background, and that's it. You can't customize that action.
You only get a notification that the user closed the app so that you can save your app state or data for the next launch.

Related

iOS 10 local notifications: show notification content on lock screen

I've added local notification with Notification Content Extension.
It shows okay on home screen (with app in background).
The problem lies in displaying notification content on lock screen. When notification arrives on lock screen, it is only displayed with text and swiping left shows "Clear" button.
I need some way to show notification fully from lock screen (as on home screen).
For example I saw "View" button in some of the tutorials/articles, can I even create or control something like it?
So with notifications on iOS 10, Apple changed the way they appear on devices. When the screen is locked, you can see a View and Clear button or just clear button based on whether the device is enabled with 3D touch or not.
Swiping left on a message now offers View and Clear on non-3D Touch devices or just Clear on 3D Touch devices.
On 3D Touch devices, the long press on notification reveals the notification actions menu which can be customized using Category definition in the code.
Hope this answers your query.

iOS Multitask App Switcher Custom Image

im developing an iOS App and i would like it to behave like PayPal when the user double taps the home button.
For those who dont know the PayPal app displays a custom image when the app is displayed on the multitask switcher but it doesnt when a notification arrives or when the user pulls the notifications bar.
My issue comes when implementing this, im using the event applicationWillResignActive to display my custom image (as applicationEnteredBackground is not called for this). But this method is called on events on which i dont want the app to display the image (such as notifications, calls, pulling the top bar, etc).
Is there any way of setting this image only when the home button is double tapped?
Thank you!
From what I see, PayPal doesn't cover the viewport with a custom image immediately – when I double tap the Home button, it remains rendered normally until I do something else – but most probably on applicationDidEnterBackground:. After switching to Home screen or another application, the PayPal preview becomes covered.
On the other hand, my mobile banking application does that immediately when applicationWillResignActive: is triggered.
These are AFAIK the only two approaches you can achieve.

Button accesible from lock screen in iOS

I want to develop an iOS app that can have like a panic button when the screen is locked. This button can be enable or disabled within the app, but
I want to know if it is possible to add a very accessible button you can press in case of an emergency even when the screen is locked. When the button is pressed I want to execute some code in the app.
Is there a possible way of accomplishing this in iOS?
Or is there an alternative?, The only think that I required is that the button can be pressed like in maximum three seconds even if the screen is locked and the app closed.
No that is not possible in iOS. You cannot make changes outside of your app.
One suggestion i can give you is to make a extension for today view in notification center. And you can ask the users to touch the button in notification center to invoke your functionality.
Notification center can be accessed in lock screen also.

Hide UI after resigning application [duplicate]

This question already has answers here:
Display a view or splash screen before applicationDidEnterBackground (to avoid active view screenshot)
(8 answers)
Closed 8 years ago.
The question is the following:
My app can be protected with a password. When the user presses home button, application resigns inactive. After reopening it, app shows "enter password" screen. But before it shows up, the initial content screen is visible for a moment. Also if, after pressing home button, user enters preview mode (home button double pressed), preview shows content screen, not password screen.
So here are two questions:
How can I change UI (to password screen or to some placeholder) before application gets resigned, so that in preview mode user would see something other than the content screen.
How can I make application NOT show content screen for a moment (before password screen) when application becomes active again.
Would be thankful for any help.
From the iOS App Programming Guide
What to Do When Moving to the Background
Apps can use their applicationDidEnterBackground: method to prepare
for moving to the background state. When moving to the background, all
apps should do the following:
Prepare to have their picture taken. When the
applicationDidEnterBackground: method returns, the system takes a
picture of your app’s user interface and uses the resulting image for
transition animations. If any views in your interface contain
sensitive information, you should hide or modify those views before
the applicationDidEnterBackground: method returns.
So, in your applicationDidEnterBackground method you should hide your main view and present your 'login' view.
Update After a bit more research, it turns out you can't present a view controller - you can only affect the root window. I have tested the solution in this answer - Display a view or splash screen before applicationDidEnterBackground (to avoid active view screenshot) and it works - So you can create an image that shows your login screen and put that over the top of your UI.

Show splash screen instead of snapshot

My issue is with the splash screen shown when the app opens while in suspended mode.
When the app is closed and i open it, i see the Default.png splash screen, which is what i need.
But if i send it to the background and reopen it, i see a snapshot from the last screen i was in, and i want to see the splash screen.
I have even considered forcing the app to quit on when entering background, but i'd rather show a snapshot than do this.
How can i accomplish this?
Thank you.
You can't change the image that is shown when the app starts (Default.png) or enters the foreground (snapshot of previous app state).
Ask yourself, how would showing a splash screen each time the app enters the foreground improve the user experience?
Edit: Here's a guess at a workaround:
Based on your comment below, it sounds like you're saying it would be OK if the user always came back to the main action screen. In the applicationWillResignActive: method, could you check what screen the users is on, and if it's not the main action screen, move back to that screen... the snapshot would be of the main action screen then (maybe!)

Resources