iOS Allowing one touch event at one given time - ios

I am using iOS 5 to implement an app.
In this app I have 4 button, each button triggers an animation to unhide a UIView. However, if I press a button and then another, the view that appeared first should disappear and the view for the new button would appear.
I have this working so far. But if the user taps two buttons rapidly it will display the two views. How can I insure that only once touch event is processed?
The action for the button is something like:
- (void)buttonPressed:(id)sender
{
MenuButton *aButton = (MenuButton *)sender;
switch (aButton.tag) {
case 0:
if (displayingView && currentlyDisplayingView != picker1)
[self toggleView:currentlyDisplayingView atIndex:currentIndex];
[self toggleView:picker1 atIndex:aButton.tag];
currentlyDisplayingView = picker1;
currentIndex = aButton.tag;
break;
case 1:
if (displayingView && currentlyDisplayingView != picker2)
[self toggleView:currentlyDisplayingView atIndex:currentIndex];
[self toggleView:picker2 atIndex:aButton.tag];
currentlyDisplayingView = picker2;
currentIndex = aButton.tag;
break;
case 2:
if (displayingView && currentlyDisplayingView != picker3)
[self toggleView:currentlyDisplayingView atIndex:currentIndex];
[self toggleView:picker3 atIndex:aButton.tag];
currentlyDisplayingView = picker3;
currentIndex = aButton.tag;
break;
default:
break;
}
NSLog(#"Pressed %#",[buttonNames objectAtIndex:aButton.tag]);
}
And the animation code:
- (void)toggleView:(UIView *)picker
atIndex:(NSInteger)index
{
if (picker) {
picker.hidden = NO;
[UIView animateWithDuration:0.5
animations:^{
picker.alpha = abs(picker.alpha - 1);
CGRect rect = picker.frame;
if (rect.size.height == 0){
rect.size.height = 76;
} else if (rect.size.height == 76) {
rect.size.height = 0;
}
picker.frame = rect;
for (int i = index+1; i < [viewButtons count]; i++) {
UIButton *aButton = [viewButtons objectAtIndex:i];
CGRect frame = aButton.frame;
if (rect.size.height == 0){
frame.origin.y -= 75;
} else if (rect.size.height == 76) {
frame.origin.y += 75;
}
aButton.frame = frame;
}
}
completion:^(BOOL success){
if (picker.alpha == 0){
picker.hidden = YES;
} else if (picker.alpha == 1) {
picker.hidden = NO;
}
displayingView = !displayingView;
}];
}
}

Call beginIgnoringInteractionEvents before calling animateWithDuration, and call endIgnoring... in the completion handler.

Related

UISlider is flickering

we are using UISlider in our project, we are using that older in order to play audio.for specific audio, when we are playing that, UISlider is flickering for first 13 seconds. for another audio, that UISlider is flickering for first 8 seconds. what can be the solution for this? Thanks in advance.
I have assigned right value to the slider.
- (void)setSliderValue
{
if(self.jwAudioPlayer == nil)
return;
if(self.slider && self.slider.maximumValue == 1.0)
{
self.slider.minimumValue = 0.0;
self.slider.maximumValue = self.jwAudioPlayer.duration;
self.slider.value = 0;
}
}
- (void)setPlayerCurrentPlayingTime
{
if(self.jwAudioPlayer == nil)
return;
if(self.slider.maximumValue <= 0 && self.jwAudioPlayer.duration > 0){
self.slider.maximumValue = self.jwAudioPlayer.duration;
}
CGFloat durationInSeconds = self.jwAudioPlayer.duration;
CGFloat currentTimeInSeconds = self.jwAudioPlayer.position;
if(currentTimeInSeconds >= durationInSeconds)
{
currentTimeInSeconds = durationInSeconds;
[self pause];
}
if(self.durationTime)
{
self.durationTime.text = [self timeFormatted:durationInSeconds];
}
if(self.currentPlayingTime)
{
self.currentPlayingTime.text = [self timeFormatted:currentTimeInSeconds];
}
if(self.slider && self.slider.tag == 0)
{
[self setSliderValue];
[self.slider setValue:currentTimeInSeconds animated:YES];
}
if(self.playerController)
[self.playerController enableDisableSkipImage:currentTimeInSeconds];

Scrolling to specific page using pageControl and ScrollView ios

I know this question has been asked earlier but i am not getting any specific answer to my problem. I am using page control and scrollView to add view controllers and then showing all the pages using swipe. I need to redirect to a particular page on button click. I tried scrollView SetcontentOffet and every other possiblities.
-(void)ScrollToPage:(int)page
{
UIViewController *controller = [self.childViewControllers objectAtIndex:page];
if (controller.view.superview == nil)
{
CGRect frame = self.scrollView.frame;
if (frame.size.width == 0)
{
frame.size.width = self.view.frame.size.width;
frame.size.height = self.view.frame.size.height;
}
frame.origin.x = frame.size.width * page;
frame.origin.y = 0;
controller.view.frame = frame;
[scrollView setContentOffset:CGPointMake(frame.origin.x, frame.origin.y) animated:YES];
self.pageControl.currentPage = page;
[self centerScrollViewContents];
[self.scrollView setContentOffset:CGPointMake(frame.origin.x, frame.origin.y)];
[self.scrollView scrollRectToVisible:frame animated:YES];
[self.scrollView addSubview:controller.view];
}
}
I assume that your pages are using your device width closely. Just follow the below steps.
- (void)viewWillAppear:(BOOL)animated {
self.myCurrentPage = 0;
[self setScrollViewPages];
self.scrollView.delegate = self;
}
- (void)setScrollViewPages {
for (int i = 0; i < numberOfPages; i++) {
UIView *myPageView = [[UIView alloc]initWithFrame:(CGRect) {self.view.frame.size.width * i
+ 10.0f,10.0f,self.view.frame.size.width - 20.0f , self.scrollView.frame.size.height-20.0f}];
myPageView.backgroundColor = [UIColor greenColor];
[self.scrollView addSubview:myPageView];
}
}
On Button Clicked
- (IBAction)buttonClicked:(id)sender {
//Pass the requried page, by default I'm passing 4
self.myCurrentPage = 4;
[self updateMyScrollView];
}
And the respective scroll view setting is
- (void)updateMyScrollView {
[self.scrollView setContentOffset:CGPointMake(self.view.frame.size.width *self.myCurrentPage, 0) animated:YES];
self.pageControl.currentPage = self.myCurrentPage;
}
Additionally, your scrollview delegate would be like this...
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset{
int pageWidth = self.view.frame.size.width ;
int pageX = self.myCurrentPage*pageWidth - scrollView.contentInset.left;
if (targetContentOffset->x<pageX) {
if (self.myCurrentPage>0) {
self.myCurrentPage--;
}
}
else if(targetContentOffset->x>pageX){
if (self.myCurrentPage < numerOfPages) {
self.myCurrentPage++;
}
}
targetContentOffset->x = self.myCurrentPage*pageWidth-scrollView.contentInset.left;
DLog(#"%ld %d", (long)self.myCurrentPage, (int)targetContentOffset->x);
self.pageControl.currentPage = self.myCurrentPage;
}
Hope this helps....

The UIWindow's background application is jumping at the top of views when I switch from a view content to a UITableView

I am in charge to update an application in IOS8. But I have a problem when I want to switch between two view (the old and the new). The background of the UIWindow's Application jumped. It appears during 1 second and disappear. I can not find the issue. I tap on a backButton to change the content view.
- (void)onBackTap
{
NSLog(#"Standard back");
[self goBackWithAnimation:AnimatePushFromLeft];
}
- (void)goBackWithAnimation:(GraphNavigationAnimation)animation
{
NSLog(#"History Before ---> %#", [self currentHistory]);
[[self currentHistory] removeLastObject];
NSLog(#"History After ---> %#", [self currentHistory]);
self.currentVC = [[self currentHistory] lastObject];
[view_ switchContentViewTo:currentVC_.view
navigationItemStack:[[self currentHistory] valueForKey:#"navigationItem"]
isNavbarVisible:navbarVisible_
animation:animation];
}
Thank you for your support if you have already found a solution.
This is my procedure to switch from an old and a new contentView:
-(void)switchContentViewTo:(UIView *)newView navigationItemStack:(NSArray*)navigationItemStack isNavbarVisible:(BOOL)isNavbarVisible animation:GraphNavigationAnimation)animation {
BOOL isPrevNavbarVisible = navbarVisible_;
navbarVisible_ = isNavbarVisible;
if (!contentView_) {
contentView_ = newView;
[self insertSubview:contentView_ belowSubview:navbar_];
[navbar_ setItems:navigationItemStack animated:NO];
[self setNeedsLayout];
return;
}
if (newView == contentView_) {
[navbar_ setItems:navigationItemStack animated:NO];
return;
}
CGRect const bigFrame = self.bounds;
CGRect const smallFrame = CGRectMake(0, navbarHeight_,
self.bounds.size.width, self.bounds.size.height - navbarHeight_);
CGRect centerFrame = isNavbarVisible
? smallFrame
: bigFrame;
void (^step1)(void) = ^{
CGRect newViewStartFrame;
switch (animation) {
case AnimatePushFromRight: {
newViewStartFrame = CGRectOffset(centerFrame, contentView_.bounds.size.width, 0);
break;
}
case AnimatePushFromLeft: {
newViewStartFrame = CGRectOffset(centerFrame, -contentView_.bounds.size.width, 0);
break;
}
default:
newViewStartFrame = centerFrame;
break;
}
navbar_.hidden = !isNavbarVisible && !isPrevNavbarVisible;
if (isNavbarVisible && !isPrevNavbarVisible) {
navbar_.frame = CGRectMake(newViewStartFrame.origin.x, 0,
newViewStartFrame.size.width, navbarHeight_);
}
newView.frame = newViewStartFrame;
[self insertSubview:newView belowSubview:navbar_];
self.userInteractionEnabled = NO;
animating_ = YES;
};
void (^step2)(void) = ^{
CGRect oldViewFinishFrame;
switch (animation) {
case AnimatePushFromRight: {
oldViewFinishFrame = CGRectOffset(
contentView_.frame, -contentView_.bounds.size.width, 0);
break;
}
case AnimatePushFromLeft: {
oldViewFinishFrame = CGRectOffset(
contentView_.frame, contentView_.bounds.size.width, 0);
break;
}
default:
oldViewFinishFrame = contentView_.frame;
break;
}
if (!isNavbarVisible && isPrevNavbarVisible) {
navbar_.frame = CGRectMake(oldViewFinishFrame.origin.x, 0,
oldViewFinishFrame.size.width, navbarHeight_);
} else {
navbar_.frame = CGRectMake(centerFrame.origin.x, 0,
centerFrame.size.width, navbarHeight_);
}
newView.frame = centerFrame;
contentView_.frame = oldViewFinishFrame;
};
void (^step3)(void) = ^{
[contentView_ removeFromSuperview];
contentView_ = newView;
self.userInteractionEnabled = YES;
animating_ = NO;
};
[navbar_ setItems:navigationItemStack animated:(animation != AnimateNone)];
step1();
[UIView animateWithDuration:(animation != AnimateNone ? animationDuration : 0)
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
step2();
}
completion:^(BOOL finished){
step3();
}];
}

Reusing 3 views on UIScrollView's Paging

I did the following code where three views can be reused during Pagination in UIScrollView in order to save live memory-->
#pragma mark - UIScrollView Delegates
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGFloat pageWidth = self.view.frame.size.width;
CGPoint aContentOffSet = [[self scrollView] contentOffset] ;
float currPos = aContentOffSet.x;
int selectedPage = roundf(currPos/pageWidth);
[[self pageControl] setCurrentPage:selectedPage];
[self update:selectedPage];
}
#pragma mark - Custom methods
-(void)update:(int) selectedPage{
BOOL view1FrameShallBeUnchanged = false;
BOOL view2FrameShallBeUnchanged = false;
BOOL view3FrameShallBeUnchanged = false;
BOOL aFrame1Matched = false;
BOOL aFrame2Matched = false;
BOOL aFrame3Matched = false;
CGRect aFrame1 = CGRectMake(selectedPage*self.view.frame.size.width, 0.0f, self.view.frame.size.width, self.scrollView.frame.size.height);
CGRect aFrame2 = CGRectMake((selectedPage-1)*self.view.frame.size.width, 0.0f, self.view.frame.size.width, self.scrollView.frame.size.height);
CGRect aFrame3 = CGRectMake((selectedPage+1)*self.view.frame.size.width, 0.0f, self.view.frame.size.width, self.scrollView.frame.size.height);
ViewOnScrollView *aView1 = (ViewOnScrollView*)[[self scrollView] viewWithTag:1234];
ViewOnScrollView *aView2 = (ViewOnScrollView*)[[self scrollView] viewWithTag:12345];
ViewOnScrollView *aView3 = (ViewOnScrollView*)[[self scrollView] viewWithTag:123456];
if(aView1 && aView2 && aView3){
//Check for Frame 1
if(aFrame1.origin.x == aView1.frame.origin.x){
view1FrameShallBeUnchanged = true;
aFrame1Matched = true;
}
else if(aFrame1.origin.x == aView2.frame.origin.x){
view2FrameShallBeUnchanged = true;
aFrame1Matched = true;
}
else if(aFrame1.origin.x ==aView3.frame.origin.x){
view3FrameShallBeUnchanged = true;
aFrame1Matched = true;
}
//Check for Frame 2
if(aFrame2.origin.x == aView1.frame.origin.x){
view1FrameShallBeUnchanged = true;
aFrame2Matched = true;
}
else if(aFrame2.origin.x == aView2.frame.origin.x){
view2FrameShallBeUnchanged = true;
aFrame2Matched = true;
}
else if(aFrame2.origin.x == aView3.frame.origin.x){
view3FrameShallBeUnchanged = true;
aFrame2Matched = true;
}
//Check for Frame 3
if(aFrame3.origin.x == aView1.frame.origin.x){
view1FrameShallBeUnchanged = true;
aFrame3Matched = true;
}
else if(aFrame3.origin.x == aView2.frame.origin.x){
view2FrameShallBeUnchanged = true;
aFrame3Matched = true;
}
else if(aFrame3.origin.x == aView3.frame.origin.x){
view3FrameShallBeUnchanged = true;
aFrame3Matched = true;
}
if(!view1FrameShallBeUnchanged){
if(!aFrame1Matched){
[aView1 setFrame:aFrame1];
}
else if(!aFrame2Matched){
[aView1 setFrame:aFrame2];
}
else{
[aView1 setFrame:aFrame3];
}
[self hideOrShowTheTabs:aView1];
[self hideShowView:aView1];
}
if(!view2FrameShallBeUnchanged){
if(!aFrame1Matched){
[aView2 setFrame:aFrame1];
}
else if(!aFrame2Matched){
[aView2 setFrame:aFrame2];
}
else{
[aView2 setFrame:aFrame3];
}
[self hideShowView:aView2];
}
if(!view3FrameShallBeUnchanged){
if(!aFrame1Matched){
[aView3 setFrame:aFrame1];
}
else if(!aFrame2Matched){
[aView3 setFrame:aFrame2];
}
else{
[aView3 setFrame:aFrame3];
}
[self hideShowView:aView3];
}
}
}
-(void)hideShowView:(ViewOnScrollView*)theView{
if(theView.frame.origin.x<0 || theView.frame.origin.x>[self.scrollView contentSize].width )
theView.hidden = YES;
else{
theView.hidden = NO;
}
}
Comments/Suggestions/Better ways to do the same are welcome..
check out this class ..maybe it can help.. easy to use...just like UITableview
VSScroller
Its ok, but you have too much code (~40 lines) and too much unnecessary processing. You only need to know when one frame matches (let's say the center frame), and also you should do this only when the page is about to change, not on every scroll event.
This way, whenever the left or right page becomes the current page, you move the opposite page to the other side.
Another bug you had is that you should hide the last+1 page when its frame.origin.x is equal (== , or >=) to the content size, not only bigger (>).
#pragma mark - UIScrollView Delegates
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
int selectedPage = roundf(newsPagesView.contentOffset.x/_pageWidth);
if (selectedPage != _currentPage) {
_currentPage = selectedPage;
[self update:selectedPage];
}
}
#pragma mark - Custom methods
-(void)update:(int) selectedPage{
BOOL page1FrameMatched = false;
BOOL page2FrameMatched = false;
BOOL page3FrameMatched = false;
BOOL frameCurrentMatched = false;
CGRect frameCurrent = CGRectMake(selectedPage*_pageWidth, 0.0f, _pageWidth, _pageHeight);
CGRect frameLeft = CGRectMake((selectedPage-1)*_pageWidth, 0.0f, _pageWidth, _pageHeight);
CGRect frameRight = CGRectMake((selectedPage+1)*_pageWidth, 0.0f, _pageWidth, _pageHeight);
NewsPage *page1 = (NewsPage*)[newsPagesView viewWithTag:100];
NewsPage *page2 = (NewsPage*)[newsPagesView viewWithTag:101];
NewsPage *page3 = (NewsPage*)[newsPagesView viewWithTag:102];
if(page1 && page2 && page3){
//Check for Current
if(frameCurrent.origin.x == page1.frame.origin.x){
page1FrameMatched = true;
frameCurrentMatched = true;
}
else if(frameCurrent.origin.x == page2.frame.origin.x){
page2FrameMatched = true;
frameCurrentMatched = true;
}
else if(frameCurrent.origin.x ==page3.frame.origin.x){
page3FrameMatched = true;
frameCurrentMatched = true;
}
if(frameCurrentMatched){
if(page1FrameMatched){
[page1 setFrame:frameCurrent];
[page2 setFrame:frameLeft];
[page3 setFrame:frameRight];
}
else if(page2FrameMatched){
[page1 setFrame:frameRight];
[page2 setFrame:frameCurrent];
[page3 setFrame:frameLeft];
}
else{
[page1 setFrame:frameLeft];
[page2 setFrame:frameRight];
[page3 setFrame:frameCurrent];
}
[self hideShowView:page1];
[self hideShowView:page2];
[self hideShowView:page3];
}
}
}
/**
* This method hides the view if it is outside the scrollview content bounds, i.e. the
* view before page 0, or the view after last page.
*/
-(void)hideShowView:(NewsPage*)aPage{
if(aPage.frame.origin.x<0 || aPage.frame.origin.x>=[newsPagesView contentSize].width )
aPage.hidden = YES;
else{
aPage.hidden = NO;
}
}
Checkout my example, branch:new
https://github.com/iSevenDays/RecyclingScrollView

iOS - drawRect in UIView : Suggestions to smoothen animation

The following is my code, it's working properly, it's just that the "animation" of a moving line in the line if (guidelineOn) is not smooth. The drawRect is being called every 0.01 seconds.
if (guideLineOn)
{
[self drawGuidanceLineAtPoint:CGPointMake((65+guideLineOffset)*scalingF, 98*scalingF) withAlpha:paramAlpha];
}
It's kind of laggy and sometimes interferes with the user input. How do I resolve this? New to this so open to suggestions.
Thanks in advance for your help.
Pier.
- (void)drawRect:(CGRect)rect
{
scalingF = 1.0; // default : iPhone
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
scalingF = IPAD_SCALING_FACTOR;
}
if (guideLineOn)
{
[self drawGuidanceLineAtPoint:CGPointMake((65+guideLineOffset)*scalingF, 98*scalingF) withAlpha:paramAlpha];
}
// draw staff line
[self drawStaffLineFrom:CGPointMake(65*scalingF, 98*scalingF) toPoint:CGPointMake(420*scalingF, 98*scalingF)];
[self drawStaffLineFrom:CGPointMake(420*scalingF,108*scalingF) toPoint:CGPointMake(420*scalingF, 50*scalingF)];
[self drawStaffLineFrom:CGPointMake(415*scalingF,108*scalingF) toPoint:CGPointMake(415*scalingF, 50*scalingF)];
// cycle through all the static images to draw tbd
float offSet = 0.0;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
offSet += 50.0; // to adjust the metronome down
}
if (metronomeImage)
{
[metronomeImage drawInRect:CGRectMake(410.0f*scalingF, 195.0f*scalingF+offSet, metronomeImage.size.width*scalingF, metronomeImage.size.height*scalingF)];
}
if (circlesImage)
{
[circlesImage drawInRect:CGRectMake(400.0f*scalingF, 255.0f*scalingF+offSet, circlesImage.size.width*scalingF, circlesImage.size.height*scalingF)];
}
for (Note * v in notesArray)
{
UIImage * noteImage = [UIImage imageNamed: v.imageName];
[noteImage drawInRect:CGRectMake(v.notePlacement.x*scalingF, v.notePlacement.y*scalingF, noteImage.size.width*scalingF, noteImage.size.height*scalingF)];
}
if (!clearDisplay)
{
// draw the arrows
for (int i=0; i < arrowsToDrawArray.count; i++)
{
Arrow * arrowObj = [arrowsToDrawArray objectAtIndex:i];
UIColor * colourOfArrow = [arrowObj colourOfArrow]; // colour determines whether right or wrong
CGPoint p = [arrowObj arrowPlacement];
p.x = p.x*scalingF;
p.y = p.y*scalingF;
// CGPoint p = [val CGPointValue];
[self drawRooftopAtTopPointof:p colour:colourOfArrow lineJoin:kCGLineJoinMiter];
}
// draw the ties
for (int j=0; j < tiePointsArray.count; j++)
{
CGPointPair * tiePairToDraw = [tiePointsArray objectAtIndex:j];
CGPoint firstPt = [tiePairToDraw firstPoint];
firstPt.x = firstPt.x *scalingF;
firstPt.y = firstPt.y *scalingF;
CGPoint secondPt = [tiePairToDraw secondPoint];
secondPt.x = secondPt.x *scalingF;
secondPt.y = secondPt.y *scalingF;
[self drawPseudoCurveFromPoint:firstPt toPoint:secondPt];
}
// bool perfect = true;
// int noOfNotesHit = 0;
// draw the tick/cross/arrow
for (int k=0; k < answerObjArray.count; k++)
{
Answer * ansObj = [answerObjArray objectAtIndex:k];
if (ansObj.hit)
{
// noOfNotesHit++;
if (ansObj.earlyOrLate == -1) // early, draw right pointing arrow
{
UIImage * arrowImage = [UIImage imageNamed: #"arrowright.png"];
[arrowImage drawInRect:CGRectMake((ansObj.xPosition-(0.5*arrowImage.size.width))*scalingF, 125*scalingF, arrowImage.size.width*scalingF, arrowImage.size.height*scalingF)];
// perfect = false;
}
else if (ansObj.earlyOrLate == 1) // late, draw left pointing arrow
{
UIImage * arrowImage = [UIImage imageNamed: #"arrowleft.png"];
[arrowImage drawInRect:CGRectMake((ansObj.xPosition-(0.5*arrowImage.size.width))*scalingF, 125*scalingF, arrowImage.size.width*scalingF, arrowImage.size.height*scalingF)];
//perfect = false;
}
else // perfect!
{
// draw a tick
UIImage * tickImage = [UIImage imageNamed: #"tick.png"];
[tickImage drawInRect:CGRectMake((ansObj.xPosition-(0.5*tickImage.size.width))*scalingF, 125*scalingF, tickImage.size.width*scalingF, tickImage.size.height*scalingF)];
}
}
else
{
// draw a cross
UIImage * crossImage = [UIImage imageNamed: #"cross.png"];
[crossImage drawInRect:CGRectMake((ansObj.xPosition-(0.5*crossImage.size.width))*scalingF, 125*scalingF, crossImage.size.width*scalingF, crossImage.size.height*scalingF)];
//perfect = false;
}
}
}
else
{
// draw nothing
clearDisplay = false;
}
}
Here's my Core Animation solution for those interested.
- (void) animateRedLine: (float) alphaParam
{
[self.view addSubview:self.redlineImageView];
/* Start from top left corner */
[self.redlineImageView setFrame:CGRectMake(65.0f*scalingF,
50.0f*scalingF,
self.redlineImageView.image.size.width*scalingF,
self.redlineImageView.image.size.height*scalingF*2)];
[self.redlineImageView setAlpha:alphaParam];
[UIView beginAnimations:#"redLineAnimation"
context:( void *)self.redlineImageView];
/* 3 seconds animation */
[UIView setAnimationDuration:noOfBeatsInBar*timeInSecondsForOneBeat];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
/* Receive animation delegates */
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:
#selector(imageViewDidStop:finished:context:)];
/* End at the bottom right corner */
[self.redlineImageView setFrame:CGRectMake((65.0f+LENGTH_OF_BAR)*scalingF,
50.0f*scalingF,
self.redlineImageView.image.size.width*scalingF,
self.redlineImageView.image.size.height*scalingF*2)];
//[self.redlineImageView setAlpha:0.0f];
[UIView commitAnimations];
}

Resources