Я считаю, что вам нужно придерживаться другого подхода.Я покажу вам пример для горизонтальной линии, вертикальный случай будет очень похожим.Используйте обычный UIView для представления вашей строки с начальным кадром, например:
UIView *lineView = [[UIView alloc] initWithFrame:
CGRectMake(startX,startY,1,lineThickness)];//Line starts as 1 pixel long.
//Then you need to animate this inside loadView:
[UIView animateWithDuration:1//Amount of time the animation takes.
delay:0//Amount of time after which animation starts.
options: UIViewAnimationCurveEaseOut//How the animation will behave.
animations:^{
//here you can either set a CGAffineTransform, or change your view's frame.
//Both will work just fine.
lineView = CGAffineTransformMakeScale (
scaleForX,//say 100, Now the line will be a 100 pixels long.
scaleForY//say 1, Maintain line thickness.
//direction.
//Note* you could also set the frame for a similar effect.
//view's frame.
//lineView.frame = CGRectMake(startX,startY,finalLength,lineThickness)
}
completion:^(BOOL finished){//This block is called when the animation completes.
NSLog(@"Done!");
}];