0

I have the following class:

class ServicePaymentRate : AnyObject {

    var servicePaymentRateUid : String = ""
    var servicePaymentCode : String = ""
    var description : String = ""
    var paymentPercentage : Float = 0
    var isPrimary : Bool = false
    var isFacility : Bool = false

}

Then the class is popullated in order to get an array of that class:

var rates : Array<ServicePaymentRate>

What I need now is to create a String array from the above object array by filtering description property. That way I will have a string array that will contain only description property values.

Any clue

1 Answer 1

4

let descriptions = rates.map { $0.description }

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.