How to remove charging icon from WatchKit Simulator? - ios

Would like to see if my app name will fit when the watch isn't charging, which I'm assuming wont be there when in use.
See image: http://imgur.com/ctHAQxy

Short answer is you can't.
However, during transitions from controller to controller, or when reloading root controllers etc., the entire status will only display the title, and then the status bar will animate back to it's original state.
You may be able to setup a test using the same title across multiple controllers to see make an educated guess as to what it's going to look like.

Related

Update status bar text colour in real time as view changes

This might be a beginner question, but I noticed something interesting in the new Apple Music app. When switching from one view to another, the status bar text colour seems to change in real time rather than all at once when the next view loads.
Check out this screen recording to see what I mean:
http://f.cl.ly/items/2A0a3Q3i2O2d2O3u3q1m/statusBar_1.mp4
Closeup: http://f.cl.ly/items/182r3n3Z1m1y0y1W0j2J/statusBar_2.mov
How would I achieve this same effect? For instance, when transitioning to another view controller modally, how would I get the status bar style to change dynamically like this rather than when the next view loads? Is it even possible? Is Apple using some private API, or is it just a really simple trick I'm missing? Sorry if this is a beginner question, but I don't think I've ever seen another app do this.
Nothing you’re missing—there’s definitely no API to do that. I’ve seen a couple of third-party apps do something similar, probably by finding the status bar window, snapshotting it, and doing clever things with the resulting image, but that’s pretty fragile. As always, if you’d like an API for something, you should file an enhancement request.

How can i add tabs in iOS on a particular screen?

I am building an app where I need to add a TabBarController on a particular screen, Lets assume maybe on second or third screen.
I have gone through several blogs but everyone says UITabBarController can be added as an initial view controller only.
But I want it for some few screens only. How can I accomplish it?
Need guidance!
The answer is "you shouldn't."
From the Human Interface Guidelines:
"In general, use a tab bar to organize information at the app level. A tab bar is well suited for use in the main app view because it’s a good way to flatten your information hierarchy and provide access to several peer information categories or modes at one time.
Don’t use a tab bar to give users controls that act on elements in the current screen or app mode. If you need to provide controls, including a control that displays a modal view, use a toolbar instead (for usage guidelines, see Toolbar). "

Screenshot that taken by iOS when (before) application go into background?

I hope that you all know about it, iOS takes screenshot before your application goes to background.
I got it from official document.
Remove sensitive information from views before moving to the background: When an app transitions to the background, the system takes a snapshot of the app’s main window, which it then presents briefly when transitioning your app back to the foreground. Before returning from your applicationDidEnterBackground: method, you should hide or obscure passwords and other sensitive personal information that might be captured as part of the snapshot.
So, Here We can hide our "sensitive personal information" and the system takes a snapshot of the app’s main window, so we can not change its feature.
But I want to know..
1) If in my application I'm at 4th View, and my app goes to background then system takes screen shot of which view/page? first one (start up view of apps?) or 4th view/page of the app ?? (here is little confusion for me).
2) Can we fire any action when system is taking screenshot or any notification is available that will inform us of system taking screenshot ??
3) I just want to know, is it possible to take screen shot (programmatically) before my application launch ?? If YES then give me suggestion for how to do it. And if NO then where/when I'm able to take screenshot (I mean at which minimum stage of application we'll be able to take screenshot ?) ?
It will take a screen short of the top most view, actually it is taking a screen shot of the window which is displaying your app.
No there is no notification that the screen shot is going to or being taken. You should just handle the handle it in the applicationDidEnterBackground; method. Just a stated in the documentation
No this is not possible, how do you want to execute any code before you app is running? The OS will make the screen shot, just be sure to have everything hidden in the applicationDidEnterBackground;. The minimum state is that your app is up and running.
What I've done is on of my apps is as soon as my app gets pushed to the background place an extra view on my UIWindow. Thus when the screen shot is made this view is captured.
1) There is just one screen. The screenshot is taken of that screen. In your model case that should be the 4th view controller's view. However, it is quite possible that your 4th controller's view does not cover all of the screen or has transparent elements. In that case parts of the 3rd or even 2nd and 1st view controller's view are part of the screen.
It is a screenshot not a view controller shot or anything.
2) You understood the documentation all right. The screenshot is taken after you returned from applicationDidEnterBackground. There will be no further dokumentation.
3) No, you cannot execute any code before your app is invoked. However, I have the feeling that you are looking for something different than you asked literally.
For some other reason I have executed a small program in the simulator by implementing the main function only even without calling UIApplicatoinMain. This is the first point in time where code from your app may be executed, although that would not be exactly "out of the book". If I remember right, the screen was blank/black at that point in time. So if you are asking for a way of creating screenshots of other apps, this is not the way to go forward.
It is not taking a screenshot quite like a user pressing buttons.
This functionality is related to state restoration. When the application goes to the background it flattens the view hierarchy for each screen into a screenshot used for the task manager. If you are opted into state restoration it will also persist the state of the user interface. This means that a person can bring the application back from the background state and potentially see sensitive information that way as well, which may be something you need to handle.
Preventing information from being included in the state screenshot is covered in Tech QA 1838.
1) I'm pretty sure the system will take the snapshot of the current visible view, so the last one on the stack, not the first one
2) Also, there will probably be a Notification to let us know that the system is going to take a screenshot (otherwise how can we hide sensible information? :) ), but I'm afraid we're currently under NDA I guess?
3) What do you mean "take screenshot before my application launch"? Your code starts executing when your application launches, so this question almost makes no sense :-/
You can anywhere in your application take a snapshot of the screen, however, and there are many stackoverflow posts for that

Placement of a badge in iphone app

I have a special case in my iphone app where I have to display a badge on a tappable UI element and not in the tab bar ... is that acceptable ? I read the iOS guidelines and it says that a tab bar can display a badge (red oval) but they didn't mention any point stating that it should be placed specifically there (tab bar)
And if that is a bad UX practice, should I design a custom icon that looks like the badge and use it in my specific case ?
Thanks in advance.
Best Regards,
If they say a badge can be shown in the tabBar this does not mean that it can't be shown somewhere else.
This is not uncommon and definitely not a bad practice. Badges are not used only for navitagation events (in tabbar).
If something is not forbidden by the guidelines, then it's permitted.
However, be sure the application still follows basic iOS design and you don't implement it in some non-standard way if stardard solution would be also possible.
For example, look at the iOS Mail application. It's a split view where every mail box in the main controller has a number with unread messages. Well, that's basically a badge.
You can't do that, I recommend you to use this customBadges: http://www.spaulus.com/2011/04/custombadge-2-0-retina-ready-scalable-light-reflex/?lang=en

Split View inside of a Tab Bar in an iPad Application

When the iPad first came out, I recall that Apple frowned upon the use of a Split View inside of Tab Bar Item View. Whether or not they rejected applications that used this design I don't recall or know anything of.
Is this design still frowned upon by Apple? If you create an application that uses this design will it be rejected by Apple? I know there are third-party API's now that help you write applications that utilize this design pattern which leads me to believe that Apple no longer cares, but I just wanted to be sure about this.
If anyone can shed some light on why Apple frowned upon this design that would be helpful because I don't understand what about this design was an issue for Apple.
I can't find the citation at the moment, but there used to be a section in the HIG that said that you must not do this, and then they changed it to one saying you should try to avoid doing this. So I think you're clear, as long as the design makes sense. Sadly I can't find where that phrase occurred — maybe it was taken out all together.
At any rate, there's nothing in the HIG under either tab bar or split view that says you can't do what you want.
I just stepped over this, too.
This also didn't work in the Interface-Builder prior to 5.1.
But i just tried today and recognized that you can simply add a relationship from a tabbar controller to a splitview inside interface builder (this did not work before).
However, only the detail view shows up when running the app and select the tab containing the splitview.
edit: This seems to work out very easy if you compile for 5.1. There seems to be a change in handling Splitviews.
Just try it out:
In your Storyboard, create a Tabbar Controller
add a Split View Controller
Create a Reference from the Tabbar Controller to the Split View Controller
Now you need to create your Master and Detail Controllers
I am not finished with the implementation yet, but hope this helps.

Resources