iOS 7, status bar and navigation bar: hiding or sliding with side panels as Reeder does - ios7

I suppose this is an old one. I have a sliding panel (JASidePanel) with a menu and I want to hide or slide the status bar while showing the menu. So, I have two options:
Hide the status bar and keep the height of my navigation bar.
Or slide the status bar with the panel.
I see these two options are possible. The first one via swizzling of the sizeToFit of the UINavigationBar (link). The second one via a snapshot of the screen before animating the panel.
But I see Reeder, that takes the second option and brings it to another level: the panel is not really a screenshot, is the actual view of the panel so the status bar is slide but continues being updated, also the panel does!
So, I have a couple of questions: how is the Reeder solution possible? And the second one, is it secure to perform method swizzling? Could it be rejected by Apple?
Thank you.

Finally I implemented the first solution as shown in this link.

Related

Navigation bar doesn't show back button

I have a navigation controller with a table full of buttons that cause various settings pages to push in. I needed to add a new one, so I copied one of my existing ones, changed the VC, and off I go.
But there's no nav bar on the screen. I can see the navigation object in the storyboard and the editor simulates it's display. I compared it to the other pages that are displaying the bar, and they look the same.
I tried changing some settings, like "Hide Bottom Bar On Push" and that had an effect, but my attempts to get the bar to show up fail.
I looked at other questions that suggested it had something to do with naming, but I've tried various name fields - on the Navigation Item, the VC's Title, etc. - with no effect.
I am not sure, but the problem may be that in case the segue to the new View Controller Scene is set to modal, it would not have a Nav Bar, To be able to see one, you need to embed that in another Navigation Controller.

How to make the status bar translucent in iOS 7?

In my app, I have some webviews. A transparent status bar doesn't look good for full screen webview. I want to make the status bar TRANSLUCENT, just like the game center.
I notice that the status bar would be drawn translucent if there is a navigation bar under it. But I want a translucent status bar BY ITSELF.
Is there any way to do this?
If you look at the Human Interface Guidelines section about the Status Bar it recommends (emphasis mine on the section most related to your question):
Prevent scrolling content from showing through the status bar. As
users scroll, you don’t want them to see a confusing mix of app
content and status bar items in the status bar area. To give users the
impression of spaciousness while still ensuring maximum readability,
make sure the status bar has a background that obscures the content
behind it. Here are a few ways to keep scrolling content from showing
through the status bar:
Use a navigation controller to display content. A navigation controller automatically displays a status bar background and it ensures that its content views don’t appear behind the status bar. (To learn more about navigation controllers, see “Navigation
Controllers”.)
Create a nondistracting custom image—such as a gradient—and display it behind the status bar. To ensure that the image stays behind the status bar, you could use a view controller to keep the image above a scrolling view or you could use a scrolling view to keep it pinned to the top.
Position content to avoid the status bar area (that is, the area defined by the app’s statusBarFrame property). If you do this, you should use the window’s background color to provide a solid color behind the status bar.
As the status bar is totally transparent and any content can go on top of it, I just create an empty UIToolbar that is 20px height which just looks like a perfect translucent background for the status bar.
This is not an ultimate solution, but it really helps and it is very easy to implement when you don't need a real tool bar.
Thanks to Apple that they do not provide an option to set the status bar from transparent to translucent.
In Xcode 6, create top, bottom, left, right constrains and set the
- constants to 0
- priorities to 749.
- Don't forget to UNCHECK the "Constrain to margins" check box.
How to create constrains?
At the bottom right of your storyboard window, there's four buttons. The second from your left has the constrains. Please google about constrains in Xcode 6 since it's a kinda new feature.
Hope this help,

uibutton dosnt respond to touch when at a location

Bit of a strange one.
I have a UIButton which works when located anywhere on the view except the top left hand corner when in landscape mode.
I have a navigation bar with a back button nested in the same area but when the the video enters full screen and playback state changes this navigation bar is hidden.
any ideas?
As thought, the problem was occuring due to the hidden navigation bar and the navigation item located in the same place.
The only solution i can find was to remove the navigation bar from superview then add it back when needed.
Your view's hierarchy is not properly configured. To properly configure your hierarchy, you need to navigate to either the xib or storyboard that you're working with, and re-order the button so that it's on top of anything that falls within it's similar bounds. A common example is that you added a UIView, which is clear, and you had the button underneath it, and now you can't interact with it even though you can't see it.

iOS layout: alternative to tabs?

I'm working on a iPhone app which shows an mobile webform in a UIWebView. I'm using a default iOS layout with a navigation and tab bar.
The mobile webform is displayed in a UIWebView in the white area. Since the webform has a lot of input fields, we really need as must space for it as possible. Because of this, we are planing to remove the tabs in the bottom. Over time, there will be more tabs/sections, so it is not a solution to just add a button for each section in the left side of the navigation bar. On a iPad a popover could easily be used to handle this.
Is there a standard iOS layout mechanism to handle this change of sections/views without using tabs?
You could do something long the lines of Path or the new Facebook app and have the "table of contents" behind the Navbar and the navbar slides away (along with the child view) to reveal it. When done right (ie smoothly) I think the effect is really cool.
This would also work great as you add more and more options, since the table could just scroll.
Here is a framework that might be you started: http://www.cocoacontrols.com/platforms/ios/controls/iiviewdeckcontroller
I would consider replacing the navigation bar's title with a control that lets you switch between tabs. You can assign the bar's titleView property to a control or a button and it will generally do the right thing.
If you're limited to 2-3 tabs, you could simply use a UISegmentedControl.
If you want more, you could use a button which, when tapped, pops up a view that allows you to select the view you want. This could be a modal table view, or you could slide up a UIPickerView from the bottom of the screen, similar to the keyboard.
I use this technique in an app of my own, screenshots here. Tapping the button cycles between views (in this case, I'm changing the contents of the table cells); tap-and-hold slides up a picker.
Another possibility would be to arrange your different forms on pages in a scroll view with a page control at the bottom, à la Weather. The best option, though, if you’re going to have a particularly long list and want to keep your screen real estate, is probably the FB/Path-style sidebar table.
I ended up using a UIActionSheet but I think it in other situations would be more stylish to use a controller like the IIViewDeckController.

Scrolling Tab Bar with Navigation Tab in each view

Project need to show 7 tab bars in the application. So as per TabBar controller I am able to show the 4 tabs at a time along with "More" button which after clicking shows remaining tabs.
Also I need to show Navigation Tab for each View.
I am able to achieve this till now. But we need to make the Tab Bar in scrolling manner so that user can scroll the remaining tabs and after clicking particular tab that view is loaded along with Navigation Controller.
So can any body tell me how to achieve Scrolling TabBar along with Navigation bar in each view.
Any sample code will be more great full......
Thanks in advance.
You already mentioned the "more"-button... This should be the way to manage too many tabs, in order not to break the common iPhone l&f and keep users on track.

Categories