Home > Mobile >  Ios in the same function may return how to deal with two different types of cost?
Ios in the same function may return how to deal with two different types of cost?

Time:02-23

Met a problem today, the client just gave it to a interface function returns a value, but now requires us in this interface, implement two different functions, the first requirement is to return a string, the second requirement is to return a bool type, this can not by the end of the service to interface implementations,
The following is the train of thought, I'm a failure beginners do not blame, consult the following how in main body can only return value type and function change, want to do, the effect of implement the picture

CodePudding user response:

Return value type to object, the object of the first member is a string, the second member is bool is
Or returns the object array, the first element is a string array, the second element is a bool
  •  Tags:  
  • iOS
  • Related