Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Haroon Akhtar
3,129 Pointsbuild a block feature for iOS Ribbit
How could we build a block feature for the ribbit iOS app, so we can block users and not receive any messages from them?
Patrick Cooney
12,216 PointsMy first instinct would be to make a table in your back end that associates the user with the users they block. It would be a one to many relationship. Then before you associate the message with the user it's being sent to you check it against the block list. If the user sending the message is on the block list the message never gets associated with the user who was supposed to receive it. If the user sending the message is not on the block list then you go ahead and assign the message to the user receiving it. It's pretty rudimentary but should be fairly easy to implement.
Haroon Akhtar
3,129 PointsPatrick Cooney For us beginners its a little difficult, any demonstration would be very helpful. the other way is to only receive messages from friends and not any random user.
arnavthecoder
3,453 Pointsarnavthecoder
3,453 PointsGood Question. I would like to know how too.