The choice of the members of the society to buy food from outside is their right.
No law can be enforced restricting the members to buy food from outside agencies namely Swiggy or Zomato.
The society cannot make it a rule to compel the members to buy food from their restaurant alone, if there is any such law then it will be treated as an illegal act especially preventing someone to exercise their rights in this regard.
The society approved vendor running a restaurant within the society campus cannot restrict the members/owners from cooking their food in their kitchen neither the vendors have entered into any treaty or agreement with the members that they have to purchase eatables from their restaurant only.
Your question itself is not relevant to law, hence underand the law involved in this regard before raising such irrelevant questions. ,