Tag: dictionary
-
Tip: Deep Dive into Any? Dictionaries
In many factory methods, you’ll find parameters with type Any? like this: userInfo parameters in iOS and context in watchOS use these. You can place anything there, but most often, you’ll use a dictionary of type [String:Any]. This is a great way of moving multiple values from one method to another without making a class…
-
How to Make Drill-Down Tables in Swift
Table views are a lot like potato chips: You can’t have just one. Often, table views relate to each other in what is often referred to as a drill-down. Drill downs typically take the selected data and provide another list in a table about the selection. It creates a hierarchical selection. You might have a…
-
Swift WatchKit: Selecting With Multiple Rows in Apple Watch
In the last lesson we created a multi-row table. However, we can only view the table, not select from the table. Multi-row tables provide some challenges with selection. Along the way, we’ll make a new interface to display selected information, using a technique we have not yet covered in this series: A dictionary as a…
-
The Swift Swift Tutorial: Using Dictionaries and Optional Types
[Updated for Swift 2.0/iOS9 9/10/2015 – SJL ] In our last lesson, The PizzaDemo App so far told us some information about pizza sizes. What would be nice is for it to tell us the price for a pizza, based on the area of the pizza. We can learn about Swift dictionaries that way. For…