Line drawing in two modes simultaneously

I am making an application in which I need to draw strings in one view, and this should automatically appear in another view. Any help would be appreciated.

I have tried this.

- (void)viewDidLoad { [super viewDidLoad]; slv = [[SmoothLineView alloc] initWithFrame:CGRectMake(DrawingView.bounds.origin.x, DrawingView.bounds.origin.y + 42, DrawingView.bounds.size.width, DrawingView.bounds.size.height - 42)]; slv.delegate = self; [DrawingView addSubview:slv]; } -(IBAction)btnAnotherView:(UIButton *)sender { [zoomingTypingView setUserInteractionEnabled:YES]; if(sender.tag == 123) { [self.view setBackgroundColor:[UIColor colorWithWhite:0.500 alpha:1.000]]; [UIView animateWithDuration:0.5 delay:0.1 options:UIViewAnimationTransitionCurlUp animations:^{ //animation code zoomingTypingView.frame = CGRectMake(0, 549, 768, 451); } completion:^(BOOL finished) { }]; CGRect imageFrame = CGRectMake(50, 50, 220, 120); ResizableView = [[SPUserResizableView alloc] initWithFrame:imageFrame]; CGRect gripFrame = CGRectMake(50,50, 220,120); UIView *zoom = [[UIView alloc]initWithFrame:gripFrame]; UIScrollView *zoomscroll = [[UIScrollView alloc]initWithFrame:gripFrame]; [zoomscroll setZoomScale:32.0]; [zoomscroll setMaximumZoomScale:32.0]; [zoom addSubview:zoomscroll]; [ResizableView setContentView:zoom]; ResizableView.delegate = self; [DrawingView addSubview:ResizableView]; sender.tag = 246; } else { [UIView animateWithDuration:0.5 delay:0.1 options:UIViewAnimationTransitionCurlUp animations:^{ //animation code zoomingTypingView.frame = CGRectMake(0, 999, 768, 451); } completion:^(BOOL finished) { [self.view setBackgroundColor:[UIColor whiteColor]]; }]; [ResizableView removeFromSuperview]; [DrawingView addSubview:slv1]; sender.tag = 123; } 

}

enter image description here

In the above image, WhiteColored View is a new view, and if I draw in this whiteColoredView, which should reflect both views.

You can get more information by watching the NOTE TAKER HD APP app.

http://www.youtube.com/watch?v=FdGDnUKZcMM

+4
source share
1 answer

If you have two types defined:

 @property(nonatomic) UIView *view1; @property(nonatomic) UIView *view2; 

instead of do self.view, you can have a drawing function for one view:

 -(void)drawView:(UIView*)view{ //your drawing code here } 

And just call the same function twice, passing different views.

0
source

Source: https://habr.com/ru/post/1444100/


All Articles