Closed staguer closed 6 years ago
LOKLinearLayoutOptions *linearLayoutOptions = [LOKLinearLayoutOptions new];
linearLayoutOptions.arrangement = /* */
linearLayoutOptions.size = CGSizeMake(10, 10);
LOKLinearLayout *linearLayout = [LOKLinearLayout newWithOptions:options];
This PR should be ready for review now. Two things are still missing from it: documentation comments and some support for splitting out the ObjC support code. I'll be working on the first one and investigating the second one.
Regarding question (2) of how to avoid the overhead of this new code for Swift consumers, @chenxiao0228 's suggestion is to make a separate GitHub repo and Cocoapod named something like LayoutKit-objc. These wrapper classes and sample app in this PR would not go into this LayoutKit repo but into the new LayoutKit-objc repo/pod and the new pod would import the current LayoutKit pod. Swift consumers will continue to use this repo/pod without incurring the weight of this new code.
Additional to @chenxiao0228 comment, we can still keep them in the same repo, but 2 x pods and that would be easier to manage.
Also, we need to setup the test for wrappers because the current CI doesn't compile objective-c wrappers
This is related to issue #178 regarding adding support for Objective-C consumers. This objc-api branch is now ready for review.
Two of the open questions are: 1) How do we make these long initializers more convenient for use from Objective-C? I have several options in mind. 2) Should we make these new classes unavailable from Swift somehow? My understanding is that there's a way to use pods to exclude some directories at import time?
The builders for (1) can be added as a separate follow-up change. Currently working on figuring out what we can do for (2).