How to update the main view with drawer menu using KYDrawerController - ios

KYDrawerController
link - https://github.com/ykyouhei/KYDrawerController
Hello Guys,
It's lib and integrate slide menu, but here I am not able to update the main view from slide menu view(or drawer view) the view is always updated on Menu view only.
For example, I have four views as follows:-
1- main
2- drawer (slide menu)
2.1 - in the drawer, there is two button menu ie signup and login
From the main menu I am able to access the drawer menu but when I used to click the menu button the view is updating on drawer menu only and the main view is as it is
any suggestion..!
Thank you

Please try to using NSNotificationCenter
In the main view, add observer to some notification, and then in button's event handler to post that notification.

Related

UITabBarController with Hamburger menu/ Left sliding menu

I have an app with UITabBarController set as root controller. I need to have a hamburger menu no matter on which tab the user is. The question is - how to structure the app so that I don't have to repeat the hamburger menu code for every view controller - is there a way to do that? Only the gestures handling for opening and hiding the menu are around 100 lines of code. After a table view is added for the items in the hamburger menu I imagine it's going to be twice as that. Thanks in advance for the suggestions.
I ended up using another View Controller as a parent view controller and adding the UITabBarController as a child view controller to it. Then I added the Hamburger menu to the parent view controller and set screenEdgePanGesture.cancelsTouchesInView = false for the gesture that opens the menu. On start of the gesture (state .began) I am setting the isHidden property of the menu view to false and call view.bringSubviewToFront(self.menuView) to have the menu over the views in the current tab.

Unable to add subview in main view on button click

in my project, there are UIView and it have two buttons
i just want to add subview on main view on the click of second button
i am new in iOS so any one help me please
on first Button Click Event just add secondView.hidden=Yes;
and more over create the global instance of the secondView

How to connect a button to a new view controller iOS Swift?

I'm pretty new to Swift and am trying to connect a button to another View Controller. On other apps I have made with Swift I have been able to easily control-drag a button to another view controller, where it would display "show" as an option to click. When I would run it and click the button it would show the desired View Controller.
On the app I am working on, I was trying to add a settings page that could be accessed by clicking a button. When I tried to control-click and drag the button into the second view control, it displayed only three options: push, modal, and custom. I selected push, and when I ran the app and pressed the button it showed a SINABRT error. How can I connect a button to a second View Controller just by pressing it?
You will only see the "show" option if you are working on a project targeting iOS 8 and later, since it is a new feature to help you to determine the proper way to show your new view controller. It will opt to "push" if you are in a navigation controller and "modal" if you are in a regular controller context.
Here you might be working for a project with deploy target for iOS 7 or below. You can choose to use "modal" here to present the view controller from the bottom of screen and implement an exit button. Or you can embed your current view controller into a navigation controller to use "push" to make the new view controller pushed from right hand to left, with a back button to navigating back automatically.

SWRevealView Library, main view should not be accessible after side bar is opened

I am using SWRevealViewController library for making side bar menu in IOS from the link http://www.appcoda.com/ios-programming-sidebar-navigation-menu/
The problem is that when the sidebar menu is opened I don't want the user to access the main view ( it is the viewController in which I have the navigation button and the pan gesture for getting the slider out are present ) so that when side bar is opened and user is touching right of the screen on the main view any button or any tableView on the main view should not be accessible. Can anyone tell me how to do this in this library

Create Modal View with Save/Cancel button

I'm pretty new to Xcode development (I'm using swift), and am building up my application flow in the storyboard. I'm attempting to create an "Add New" dialog in a similar style to that on the Calendar app.
In terms of structure, I have a UITableViewController that has a UINavigationItem on it (There is a UINavigationController before it in the storyboard. I have added a UIBarButtonItem with the Add Identifier, and created a Segue from it to a new UIViewController, using the "Present Modally" option to make the view appear in from the bottom.
On the "Add New" screen, I want to have a Navigation Bar at the top, with a Cancel Button, a Save Button and the page title (the same way the Calendar App Add Event view works).
Initially I figured I would just throw a UIToolBar item onto the page and create those items by hand. However, the apple standards seem to indicate that Toolbars should only ever appear at the bottom of the screen, not the top.
I can change the Segue to "Show", this causes the view to slide in from the right. It also sets the left hand button to a "Back" action (i.e. "
What is the apple-approved structure I should be using to do this? To summarise, I want to do the following:
Segue from the Add button on the List View to the Add View.
Animate the Add View in from the bottom
Display a Navigation Bar on the Add View containing three items:
Cancel (Far Left) - Returns to the Previous View (by sliding the view down)
Title (Middle)
Save (Far Right) - Performs a custom action (I can handle this myself)
You should present the "Add New" dialog inside another UINavigationController, even if you don't intent to push additional view controllers onto it once it is presented. This allows you to easily use navigation items again to show the buttons.

Resources