#TabMan
- Create floors and add tables of 4 types on them.
- The app makes sure the tables do not overlap.
- Floors can be saved and can be edited.
- Tables can change position on editing of saved
floorand add more tables.
- Install Cocoapods
- clone the repo
- Do a
pod install - Start the app from
TabMan.xcworkspace iOS 9.2is minimum version needed to run the app.- Use
Xcode 7.2
The project is divided into the following:
Utils
DragDropManager: Manages the whole drag and drop in the system. Takes decision on adding and delete of Tables based on its start and destination superviews. Also, puts back a view to its picked up location if it ended on invalid location. It usesUIPanGestureRecognizerto handle drag gestures.DragContext: The current drag context. It has all information of the current dragged view.GroupManager: Manages the creation of table groups. Table groups are a group of selected tables by the user inside a single border.
Views
TableImageView: Subclass ofUIImageViewwhich changes image based on the type of the table.
Models
Table: Stores information about a table like table type, table location on floor, area and number.Floor: It stores the flooridand a list ofTablewhich are kept on the floor.
-
ViewController: Handles the button press actions, decides what to do based on when the save button was pressed, decides when to show the saved floor selectorUITableViewand when to show the table type selector. -
Main.storyboard: Autolayout is used to layout views. The size of the table picker is kept constant and the size of the floor changes in different screen sizes.
- I used
realmfor percistance because of its simplicity and readability. - The drag and drop is handled in a separate class
DragDropManagerto avoid large viewController. - Group management is handled in a separate class
GroupManager. - While making this came to know a lot about
convex hullas well asconcave hullalgorithms. Though they were not used in this project.