As with other data types in swift, arrays and dictionaries can be defined separately as Var,let, which is variables and constants. Arrays and dictionaries that are defined as let constants are immutable. Here's a quick look:
Import Uikit let
courses_dict = [1: "Advanced Mathematics", 2: "College English", 3: "Program Design"] //constant let
Course_array = ["Advanced mathematics", "College English", "Program Design") "] //Constant
Courses_dict.removevalueforkey (3) //error, cannot delete
courses_dict.updatevalue (" level 46 ", Forkey:2) //error, cannot modify
courses_dict[4] = "level 46" //error, cannot insert
course_array.removeatindex (0) //error, cannot delete
COURSE_ARRAY[1] = "level 46" //error, cannot modify
course_array[3] = "linear algebra" //error, cannot insert
GitHub home: https://github.com/chenyufeng1991. You are welcome to visit.