While it is great that we can now code selections in swift, everything we have done so far is button based. Now, lets expand it a little to make navigation a little nicer. In Visual Basic and various other programming languages we can use checkboxes to control our selection structures.
Swift does not have checkboxes but we can use Switches and Segmented Controls to achieve most of the things we need. So lets have a quick look at doing this.
Sam wants an application in which he can enter the quantity of an item that a customer purchases and the item’s price. Customers who work at Sam’s company are entitled to a 10% employee discount. The application should calculate and display the total amount the customer owes.
Comments