Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

Associate Multiple Values Swift

enum Marks {

 // associate multiple Double values
case gpa(Double, Double, Double)

// associate multiple String values
case grade(String, String, String)
}

// pass three Double values to gpa
var marks1 = Marks.gpa(3.6, 2.9, 3.8)
print(marks1)

// pass three string values to grade
var marks2 = Marks.grade("A", "B", "C")
print(marks2)
Comment

PREVIOUS NEXT
Code Example
Swift :: swift constants 
Swift :: customize change color size MDCActivityIndicator swift 
Swift :: swift integer 
Swift :: convert meter to miles swift 
Swift :: change textview link color swift 
Swift :: swiftui slide menu 
Swift :: swift 5 uidatepicker display inline 
Swift :: Swift Find Number of Set Elements 
Swift :: how to declare populated dictionary in swift 
Swift :: swift optionals 
Swift :: Swift Labeled Statement with continue 
Swift :: get links from string or html a tag swift 
Swift :: Swift Modify the Elements of an Array 
Swift :: Swift continue Statement With for Loop 
Swift :: Swift Check if an Array is Empty 
Swift :: xcode combine calayer into an image 
Ruby :: 2 decimal places ruby 
Ruby :: rspec check array without order 
Ruby :: rails status migrations 
Ruby :: ruby get file name 
Ruby :: add references rails migration 
Ruby :: ruby each_with_object 
Ruby :: rails crud 
Ruby :: how to link to with font awesome rails 
Ruby :: ruby change directory 
Ruby :: rails logger stdout 
Ruby :: ruby pry syntax 
Ruby :: What does inject in ruby do 
Ruby :: rails 6 TypeError: $(...).tooltip is not a function 
Ruby :: ruby reduce hash 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =