Augustyniak / RATreeView

Library providing easy-to-use interface for displaying tree structures on iOS and tvOS.
MIT License
2.49k stars 466 forks source link

[FIX] Fixing "Control may reach end of non-void function" #276

Open El-Moatasem opened 4 years ago

El-Moatasem commented 4 years ago

Hi Sir,

Hope you are doing well

I fixed the error "Control may reach end of non-void function" as it has no default return value as indicated in xcode 11.2.1 Could you accept the merge request ?

Thanks

cherron-aptera commented 4 years ago

While this does make the compiler stop complaining, I'm wondering if this will actually fix the underlying issue -- best I can tell, the problem is because UITableViewStyleInsetGrouped was added to the UITableViewStyle enumeration.

I don't know much about it, but this looked like when it was introduced: https://www.swiftjectivec.com/ios-13-notable-uikit-additions/

In your change, the RATreeViewStyle returned for that UITableViewStyle will be RATreeViewStylePlain, and I'm not sure that's a good default case.

The new InsetGrouped view is also never handled by (UITableViewStyle)tableViewStyleForTreeViewStyle:(RATreeViewStyle)treeViewStyle in this PR.

Your changes fixes the compiler error, yes -- but it doesn't solve adding InsetGrouped support, which I think is the larger issue.