cwRichardKim / RKSwipeCards

The basics of a swipeable card interface inspired by Tinder
MIT License
2.17k stars 61 forks source link

Xib #13

Closed mimmo00 closed 9 years ago

mimmo00 commented 9 years ago

Hi, there is a way to use xib as card?

I tried this:

//instead of: initWithFrame

[self setupView]; ... [self addSubview:overlayView];

} return self; }

//and -(DraggableView )createDraggableViewWithDataAtIndex:(NSInteger)index { DraggableView draggableView = [[[NSBundle mainBundle] loadNibNamed:@"cardView" owner:self options:nil] objectAtIndex:0];

draggableView.information.text = [[[dataObjectsArray objectAtIndex:index] objectForKey:@"item"] objectForKey:@"title"]; //%%% placeholder for card-specific information
draggableView.delegate = self;

return draggableView;

}

but don't work

Thanks

clsource commented 9 years ago

I used a storyboard with a UIViewController and assigned the card class to its view. Then Instantiated

UIViewController * controller = [self.storyboard instantiateViewControllerWithIdentifier:@"CardController"];

 CardView * card = (CardView *) controller.view;