SwipeView
SwipeView copied to clipboard
Two swipeViews on the screen?
Is it possible to have two or more swipeViews on the screen but having different data in them?
Something like this:
if (swipeView == firstSwipeView) {
view = [[NSBundle mainBundle] loadNibNamed:@"FirstSwipeView" owner:self options:nil][0];
// Do additional stuff
} else {
view = [[NSBundle mainBundle] loadNibNamed:@"SecondSwipeView" owner:self options:nil][0];
}
Yes. You'd do it like that.
It would be easier and best practise to have multiple data source classes and set those as the delegate and data source for the appropriate swipe view. That way you keep everything separate and encapsulated. Then if you change your mind later or want to reuse the source you can more easily.
On 2 Dec 2014, at 19:09, Kirill Pahnev [email protected] wrote:
Is it possible to have two or more swipeViews on the screen but having different data in them?
For example first one would load from
if (swipeView == firstSwipeView) { view = [[NSBundle mainBundle] loadNibNamed:@"FirstSwipeView" owner:self options:nil][0]; // Do additional stuff } else { view = [[NSBundle mainBundle] loadNibNamed:@"SecondSwipeView" owner:self options:nil][0]; } — Reply to this email directly or view it on GitHub.
That's also true :-)
I just tried my code again and it worked. Guess I had a typo or something before. Maybe I'll try that other method too as it would eliminate a lot of if-statements.