Facebook initiated this technology more than 10 years ago. Since then, lots of famous companies implemented this element into their operation. Brief explanation for those, who don’t know – it is a special panel, which appears after swiping on the screen, eventually, from left to right or by pressing a particular button on the display. It helps to navigate through the entertainment and to access other pages in 2 clicks. It is super convenient for complex games. We will explain how to create such sidebar in the Microgaming casino app. We will use swift program, which empowers open source system, called SWRevealViewController. Such library, in fact, has an Objective-C code.
What Should We Get
The main purpose of such report – to create a single demo version of an application. It won’t have all the functions though. Nevertheless, such Microgaming app should have a navigation bar with special boxes for modifying a screen division. The system will work like that:
- A gambler will press the “list” box on the highest line of the display or, simple, move a finger from one side to another on the screen.
- Automatically, a special window will appear.
- A player will use the same button or swipe to the opposite way in order to close this detail.
Container View Controller
In order to settle the number of easy-assessed figures, there should be a base. To save your time, we suggest to use some template in the Xcode. On Internet, there are thousands of them as well. Open a storyboard and establish some controllers in the special container form through the SWRevealViewController. You can write there some topics, which are appropriate, for instance, news, terms and conditions, bonuses. Notwithstanding, there may be more than 3 of them. It should be a static blocs, because the process it different for dynamic groups.
Working With SWRevealViewController
Firstly, download a relevant file from the internet (zip format). Extract it to the folder, which would likely be named as SWRevealViewController. Inside – 2 documents: SWRevealViewController.m and SWRevealViewController.h. Secondly, open the Xcode project (which you created already, look above), choose a SidebarMenu on the left part. Click on it and initiate the group, set up a title. Thirdly, drag there both files from the SWRevealViewController folder. Xcode will ask for the confirmation – accept it. Lastly, you will see a new file in this group, SidebarMenu-Bridging-Header.h, generated automatically. Start this document and type an additional line – #import”SWRevealViewController.h to finish this part”.
Now, you should associate the future entertainment with SWRevealViewController using segue. The Storyboard will have 2 controller views: front and rear ones. The first one represents general content. The second – it is a new panel, which will appear. So, transport SWRevealViewController of the rear to the view one of the Menu. You will discover some options to continue – choose “reveal view…”. It will initiate a separate file, called “SWRevealViewControllerSetSegue”. Change it into “sw_rear”. Make the same manipulations from the front controller. However, the identifier here should be “sw_front”.
Microgaming App Menu Segues
The process is almost done. The last crucial issue is to connect the navigating item to the relevant link. For instance, we should associate a “bonus” with the gift’s page. In the Microgaming casino storyboard, press and wait for the appropriate title, move it all to the view with this information and click on “reveal view…”. The same mechanism applies for other names, like terms and conditions, news. Save the changes!
Designing and Customizing
Some cosmetic modifications will be at stake after the main work. It is individually and depends on each person. SWRevealViewController provides solutions, it has different ideas, how it can look like. In case of any problems or incorrect performance – go to viewDidLoad in the NewsTableViewController and change the settings. However, even skipping this part – it will function without problems!