I am changing a value with UISlider and this value is the number of my PDF pages , so when users sliding they can navigate through the pages , because of tiles rendering I need set continuous property to NO, also I need a live page counter that uses with the same slider, so the property should be YES :, how can I set the property yes or no for specific codes with the same slider ?
this part , the property should be NO
navSlider.continuous = NO;
pageInt = CGPDFDocumentGetNumberOfPages(pdfscroll.pdf);
prgress = (int)(navSlider.value + 0.5);
navSlider.maximumValue = pageInt;
navSlider.minimumValue = 1;
[bookController moveToPage:prgress];
and here yes :
navSlider.continuous = YES;
NSString *numberOfPage = [NSString stringWithFormat:@"%d of %d",prgress,pageInt];
pageCounter.text = numberOfPage;
You clearly do need to know about every slider change, so it must be continuous. However, you should not call
[bookController moveToPage:prgress];after every single slider movement. The solution is to update the page number for every slider movement, but only call[bookController moveToPage:prgress];when the slider is released.