Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift implementation of RKCLLocationValueTransformer ? #31

Open
kpavankotesh opened this issue Apr 15, 2019 · 0 comments
Open

Swift implementation of RKCLLocationValueTransformer ? #31

kpavankotesh opened this issue Apr 15, 2019 · 0 comments

Comments

@kpavankotesh
Copy link

I am using RestKit in my swift project and I need value transformers for a particular use case. I was trying to write this in swift as below just as a simple upper case transformer.

func transformValue(_ inputValue: Any?, toValue outputValue: Any?, of outputValueClass: AnyClass) throws -> Bool {
    var outputValue = outputValue
    
    if outputValueClass is String.Type {
      outputValue = (inputValue as? String)?.uppercased()
    }
    
    return true
  }

When I do this, I get this error RKValueTransformer subclasses must provide a concrete implementation of 'transformValue:toValue:ofClass:error:'

How do I write these lines in swift?

RKValueTransformerTestInputValueIsKindOfClass(inputValue, (@[ [NSDictionary class], [CLLocation class] ]), error);

RKValueTransformerTestOutputValueClassIsSubclassOfClass(outputValueClass, (@[ [NSDictionary class], [CLLocation class] ]), error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant