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

Update XLFormRowDescriptor.m #1041

Merged
merged 2 commits into from
Jan 8, 2019
Merged

Conversation

bagatte
Copy link
Contributor

@bagatte bagatte commented Jan 7, 2019

@mats-claassen That's the correct fix for the issue I've opened a few weeks ago. This way custom cells with xib files can be declared using <Class>.self or "<Class>". It's much cleaner than using NSStringFromClass as you've implemented in the other fix:

XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeRate] = XLFormRatingCell.self

or

XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeRate] = "XLFormRatingCell"

I would revert the change done in d8ece14 and use this one.

@mats-claassen That's the correct fix for the issue I've opened a few weeks ago. This way custom cells with xib files can be declared using `<Class>.self` or `"<Class>"`. It's much cleaner than using `NSStringFromClass` as you've implemented in the other fix:

`XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeRate] =  XLFormRatingCell.self`

or 

`XLFormViewController.cellClassesForRowDescriptorTypes()[XLFormRowDescriptorTypeRate] =  "XLFormRatingCell`

I would revert the change done in xmartlabs@d8ece14 and use this one.
@mats-claassen
Copy link
Member

@bagatte Have you tested if the examples work with this? Not only he Swift Examples which were changed in the other PR but also the ObjC examples which also use NSStringFromClass?

@bagatte
Copy link
Contributor Author

bagatte commented Jan 7, 2019

@bagatte Have you tested if the examples work with this? Not only he Swift Examples which were changed in the other PR but also the ObjC examples which also use NSStringFromClass?

Yes, it works! In Swift, NSStringFromClass is not gonna work anymore. I think that’s fine because it’s not a very good practice to do that in Swift but I can add that as well if you want me to.

Supporting `NSStringFromClass`
@bagatte
Copy link
Contributor Author

bagatte commented Jan 8, 2019

@mats-claassen I've updated this PR to also support NSStringFromClass(<Class>.self) definition. It's supported in both Objective-C and Swift. Also, the nice thing with this change is that now in Objective-C is possible to use [<Class> class] or NSStringFromClass([<Class> class]).

@mats-claassen mats-claassen merged commit 81aca9c into xmartlabs:master Jan 8, 2019
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

Successfully merging this pull request may close these issues.

2 participants