ios - UIImageView jumps around -


i call method every 0.2 seconds send uiimageview position via socket.io:

- (void)update {      cgpoint touchlocation = blue.center;      if (!cgpointequaltopoint(touchlocation, lastlocation) && !isanimating) {          nsdictionary *json = [nsdictionary dictionarywithobjectsandkeys:@(touchlocation.x), @"x", @(touchlocation.y), @"y", nil];         [socketio sendjson:json];         lastlocation = touchlocation;     } } 

when other device recieves data, it's displayed so:

- (void)socketio:(socketio *)socket didreceiveevent:(socketiopacket *)packet {     int x = [[packet.name valueforkey:@"x"] intvalue];     int y = [[packet.name valueforkey:@"y"] intvalue];     [uiview animatewithduration:0.2 animations:^{         [red setcenter:cgpointmake(x, y)];     }]; } 

even though animated movement, animation jittery/jumpy on receiving side. send raw data touchesmoved: i'm sending lot of data. i've tried changing update interval 0.05 i'm sending 100 packets every 5 seconds per player. lot? there better way this?


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -