Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS User Roles Best Practices

I am building an app in which some users will have more access to features than others. The concept is that some users are parents and others are children, and the parents are able to add chores, for example, while children are not. I am wondering what best practices are for implementing this sort of setup including:

1. Should I have separate storyboards and VCs for the parents and children? There are basically some buttons and features that should exist on certain pages for the parents as well as additional screens.

2. Is the best way to do this to have a role attribute in the user class?

3. In general, for an app where information is being shared between users (say one family), what are best practices for design?

If anyone happens to have any Swift sample code for this kind of thing it would be quite helpful to have a look at as I am just starting out with iOS.

Thank you in advance.

like image 530
iOSBeginner Avatar asked Oct 19 '22 15:10

iOSBeginner


1 Answers

In general,

1) No. If there are only small visual differences between the two pages you should just hide/change the elements that the user should not see. If a user requires a special view, just create that view in your storyboard and only show it when appropriate.

2) To do the above you could either have a property on a user entity that indicates the user "type", or you could have several user objects based on the roles and show/hide UI elements based on the entity type.

3) This is a very broad question and really depends on the size and complexity of your app.

All of this is very general. There are many factors that could determine the best way to do this including: where users are imported from or created, the sensitivity of the data, number of different types of users or 'permission sets'.

like image 111
Addison Avatar answered Nov 01 '22 19:11

Addison