Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 184.108.40.206 release ready!
Owner and Founder. Opencart
In this blog, we are going to talk about what is where clause in swift, and also we will look at different scenarios in which we can use this.
Where clause is mainly used for filtering the value. We can use this with where keyword in swift. We can use this keyword in loops, guard statments switch-cases. However, you can also use where keyword with Extension, Protocol & Generic.
Let’s look into the examples one by one:
In the above program where clause is filtering out all the odd number ranged between 1 to 20. Due to which only even number are printing.
In the above example we are using where clause with Array Extenstion. Hence the getEven() method will only work with Integer Array. And i you try to access this method will other Array then you will get an error message.
Referencing instance method ‘getEven()’ on ‘Array’ requires the types * and ‘Int’ be equivalent
Thank you for reading this article. If you want to read more articles regarding iOS Development click here. If you want to learn more about swift click here.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.