Swift Questions

Asked 2 years ago, Updated 2 years ago, 38 views

// Enumerated definition
enum Result: Int {
    case Success = 0
    caseError=9
    funcgetMsg()->String{
        Data is coming into switchself {//
            case.Success:
                return "OK "
            case.Error:
                return"NG"
        }
    }
}

What does -> in the above code stand for?

swift

2022-09-30 21:15

1 Answers

&gt; is a special way of writing HTML and XML for ">".In HTML and XML, > and < are used for tags, so you just want to write symbols instead of tags.

It is likely that & was left where >>> should have been displayed due to a defect in the referenced site.

In other words, it's

funcgetMsg()->String{

Therefore, without the argument getMsg(), it is a method that returns a String.


2022-09-30 21:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.