Closed sunshinejr closed 8 years ago
Hi, I have tested the code, the copy method works as expected. I see I was mistaken when I wrote that problem was with copyView
being shallow, now with the copy of constrains everything is fine.
Also using the itemsFactory
is without problem and very easy change in my code. Good work.
Perfect! itemsFactory
is just another way of specifying items, you still can do it by init
or by property .items
, but we have to be aware that only one should be used for the setup, not both. Thanks for checking it out! 🎉
@sunshinejr Ok, just tested this on my project and if I use the itemsFactory
and always return a new view there it works great, thanks a lot!
I think my previous comment about adding a note to the docs as a warning for the copyView
implementation detail still applies to the case when you init the carousel using the items
property instead of the itemsFactory
closure.
Hey guys! 🎉 So I had some time and tried to repair #11 with improving copying method and adding new method that takes closure and
itemsCount
as parameters instead of static views. I'd love if you could check this out @aocenas and @irodrigo17 to check if everything is now clear on your part. You can use development pod or:Thanks! Log from the PR:
itemsFactory(itemsCount:factory:)
method which can be used instead of items variable to set the carousel views.init(frame:choices:)
toinit(frame:items:)
.itemsFactory(itemsCount:factory:)
instead ofitems
.UIView().copyView()
(it will copy also constraints now for view & subviews). Thanks to @afilipowicz.