Mega Gold Challenge modal view issue


#1

I added a ColorPickerController as modal view controller which handles its own view. This view has been designed as XIB file and hooked to a controller named ColorPickerController… I have added all the necessary color buttons and set the view’s simulated size as free-form. The background color has been set as clear color…
Here is the TouchDrawView code snippet wherein i launch the XIB view through the colorpickercontroller.

[code]-(void)endTouches:(NSSet *)touches{
// Remove ending touches from dictionary
NSLog(@“touches- %lu”,(unsigned long)touches.count);
for (UITouch *touch in touches) {
NSValue *key= [NSValue valueWithNonretainedObject:touch];
NSLog(@“key- %@,touch- %@”,key,touch);
Line *line= [linesInProcess objectForKey:key];
NSLog(@“line-%@”,line);
// If this is a double tap, ‘line’ will be nil, so make sure not to add it to the array
if (line) {

            [self.rootObj.completeLines addObject:line];
            NSLog(@"lines made- %@",self.rootObj.completeLines);
            [linesInProcess removeObjectForKey:key];
        }

}
if (touches.count==3) {
    NSLog(@"3 finger swipe");
    
    ColorPickerController *colorPicker= [[ColorPickerController alloc] init];
    [colorPicker setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
    [colorPicker setModalPresentationStyle:UIModalPresentationFormSheet];
    [self.window.rootViewController presentViewController:colorPicker  animated:YES completion:nil];
}
//    Redraw
[self setNeedsDisplay];

}[/code]

I idea is that when i perform a 3 finger swipe (by drawing 3 lines simultaneously) and let go of the screen thereby ending the 3 touches, the modal view (wherein i choose the colors) should be loaded. When i run this on the device, it isn’t functioning this way. I do the 3-finger touch and as soon as end it, the color chooser view doesn’t appear. But after i have done this (3-finger touch), i’m not able to draw lines anymore… This is driving me crazy… I don’t understand why this is happening… I know that in order for 3-finger swipe gesture to be realized this is not the right way (i should be handling gestures in the gesture method), but that doesnt mean the above approach shouldn’t work. What is wrong with the above implementation?? :confused: … Pls assist…I need a solution urgently.