Closed datomnurdin closed 9 years ago
Hey, I'm sorry I dropped the ball on responding to you. Did you manage to figure this out?
I am intestered. Can someone please answer? How to load all images from NSArray into this code?
exampleCardLabels = [[NSArray alloc]initWithObjects: [UIImage imageNamed:@"first.jpg"], [UIImage imageNamed:@"second.jpg"], [UIImage imageNamed:@"third.jpg"], [UIImage imageNamed:@"fourth.jpg"], [UIImage imageNamed:@"fifth.jpg"],nil];
-(DraggableView )createDraggableViewWithDataAtIndex:(NSInteger)index { DraggableView draggableView = [[DraggableView alloc]initWithFrame:CGRectMake((self.frame.size.width - CARD_WIDTH)/2, (self.frame.size.height - CARD_HEIGHT)/3, CARD_WIDTH, CARD_HEIGHT)]; draggableView.information.text = [exampleCardLabels objectAtIndex:index]; //%%% placeholder for card-specific information draggableView.delegate = self; return draggableView; }
//%%% loads all the cards and puts the first x in the "loaded cards" array -(void)l
Its not very clear what exactly you're asking. Where are you getting the images from? What do you mean by "load"? Do you mean into an array or from the array onto cards?
I'm still can't figure out until now.
I have the same issue than reported on the original issue by the other folk.
The code shows labels first , two etc. I want to use local pictures for instance how should edit the code?
Luc Ibata LinkedIn.com/in/lucibata "Follow your dream"
On May 9, 2015, at 9:36 AM, datomnurdin notifications@github.com wrote:
I'm still can't figure out until now.
— Reply to this email directly or view it on GitHub.
Ok, so the best I can do (short of actually writing the code for you), is recommend that you guys take the time to read and understand the code before you move on. How do the labels work? Well, I added a UILabel to the draggable view, and then supplied each with information from an array in draggableBackgroundView. So, if the array has ["hello", "two", "goodbye"] then the first card will have "hello", the second card will have "two", and the third card will have "goodbye".
Once you understand how that works, you'll understand how to do the same thing with photos. Just to get you on the right track, here's a general guideline: 1) add a UIImageView to DraggableView as a placeholder for where you want the images to be 2) create an array of the images you want (either download them or grab them locally) 3) set the draggableView.imageView.image = imageArray[indexOfCard]; <-- do not copy and paste that, it's pseudo code, not literal code
How to load all images from NSArray into this code?