Disable user interaction in some part of screen - swift

I create side menu via container view and when user tapped on bar button ( menu button ) I just change constraints and show or hide side menu. But when side menu open user can use elements in all screen. How I can disable or enable only part of screen when side menu open or hide?

Suppose your side menu's view hierarchy is setup like this:
View #1
|_ title label
|_ button
|_ button
You can now embed it inside another view, that'll be invisible:
View #0
|_ View #1
|_ title label
|_ button
|_ button
...where view #1 would be your regular side menu view that covers, say, 70% of the screen's width.
Now, set the view #0's background color to .clear.
Also, change your constraint logic to move the side menu to the screen's edge.
This will give you a side menu that covers the full screen, disables taps outside it and looks like it only covers part of the screen.
Extra Credit:
Add a UITapGestureRecognizer to view #0. When triggered, you can dismiss the side menu.

Related

How do I change the z axis for a button in one view controller

I am using Xcode/Interface Builder/Swift to build a project. The project has a page view controller that allows the user to swipe left to right. This is the root view controller. On the first view controller that appears, I am placing a button on the bottom right hand corner. The problem is that the page view controller status icon, which is part of the PVC, is in front of the button, which is part of the first view controller.
How do I approach this issue? Does it matter that there are two view controllers involved with this issue?
I tried going to editor -> arrange -> bring to front. But that didn't help.

How to recognize scroll gesture on top of menu bar in OS X?

I came across an app where in the user can scroll from the top of the screen and it would initiate certain features of the app.
I created a new project and overrode scrollWheel in view controller. This seems to work but the scroll has to happen on the window. How can I listen to a scroll gesture on the top of the menu bar ?

UITabBarButton With Action

How can I add a UITabBarButton with a button that triggers a modal view, rather than just showing one of the tab bar view controller's views? RedLaser accomplishes this. Notice the red "scan" button below. Also, how can I substitute one of the tab bar items with my own image without just slapping an image view over it? The image needs to span the whole area of the bar item.
Instagram also does this with the "Share" button:
Just realized my oversight--simply create a new background image for the tab bar and load that in. On that image, contain any other images that need to go over an entire tab bar item.

Customized Vertical Tab bars in iphone

I am new to iphone development. Can anyone tell me how to implement a vertical tab bar? I want something that looks like the tab bar on the right side of the screenshot in this link http://michelangelo.com/2011/11/nps-national-mall/ with the overview, events and other options displayed in the image. Thanks!
A tabbar is nothing more then a bunch of buttons next to eachother where one (or none) button has a 'selected' state. To create a vertical tab-bar: Simply place a few buttons below each other and attach corresponding listeners from those buttons to your viewcontroller (delegate).
Everytime you press one of these buttons all the buttons go into the 'default' state and the button you pressed changes to 'selected' state. After that you can load a new view with (for instance) a UINavigationController

NavigationBar Right Button Problem

I have a navigation bar in my app. The below pictures are in the order of navigation.
Problem I have is, on clicking the "Main" button , I am able to perform the action and goto the required screen , but the navigation bar does not look like the first on (with Menu as left button). Instead it look like 4th image. How to make it look like first image so that I can make the user to navigate to "Menu" screen by clicking menu button ?. Thanks for the help …!!!
If I'm understanding this correctly, you may have pushed the first view controller (The one from screenshot 1) when clicking on main which is why you see "lens" in the back button. That back button takes the title of the previous view controller in the stack. What you want to do is pop to the first view controller when they click on Main using either popToRootViewController or popToViewController:animated