Tech-Today
Swift Sliding Menu
Swift Sliding Menu
1.) First, Download the SWRevealViewController library from github
2.) Inside the folder, move the SWRevealViewController.h and SWRevealViewController.m to your project. Create a header file and insert the following line
#import "SWRevealViewController.h"
3.) You'll be needing the following ViewControllers
4.) In the storyboard, select the view which has a label SWRevealViewController and change its class to SWRevealViewController. Next, control-drag from SWRevealViewController to sw_rear.
Select the "reveal view controller set segue". Select the segue and change its identifier to "sw_rear" under the identity inspector.
Next, repeat the same procedures to connect SWRevealViewController with the navigation controller of the news view controller. Again, select “reveal view controller set segue” when prompted.Set the identifier of the segue to “sw_front”.
5.) Inside the viewdidload of the swift file of sw_front, insert the following lines of code:
if self.revealViewController() != nil {
menuButton.target = self.revealViewController()
menuButton.action = "revealToggle:"
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
}
6.) To be able to switch to different cell, drag to the navigation controller of the view controllers and select the “reveal view controller push controller” segue under Selection Segue.
-
Create A Simple Table View App In Xcode
Open Xcode and create a new Single View Application. For product name, use SimpleTableView and then fill out the Organization Name and Company Identifier with your customary values. Select iPhone for Devices. Drag a table view inside the view controller....
-
Xcode: Create A Simple Alertview
Open Xcode and create a new Single View Application. For product name, use SimpleAlertView and then fill out the Organization Name and Company Identifier with your customary values. Select iPhone for Devices. Drag a button inside the view controller...
-
How To Differentiate Between 3.5 And 4 Inch Iphone
Open Xcode and create a new Single View Application. For product name, use DifferentiateIphoneSize and then fill out the Organization Name and Company Identifier with your customary values. Select iPhone for Devices. For demonstration purposes, add a...
-
Display Time Picker On Textfield Click In Xcode
Open Xcode and create a new Single View Application. For product name, use TextFieldTimePicker and then fill out the Organization Name and Company Identifier with your customary values. Select iPhone for Devices. For setting up the user interface, first,...
-
Webview Tutorial In Ios 8 With Swift
The UIWebView class is use to embed web content in an application. It can be done by simply creating a UIWebView object and attaching it to a window and then sending it a request to load web content. Open Xcode and create a new Single View Application....
Tech-Today