# Making Bigger Touch Space in Node Using SpriteKit And Objective-C

I am trying to make simple game, but I have a problem. The node is too small. On iPhones with smaller screen size, the finger can't move it. On iPad and on simulator, however, the node can be moved due to larger sizes of the screens. Due to that, I know it's not the code that causes the issue.

Due to the fact that I am using this paddle image on many levels, I create it as separate file so I can implement it anywhere I want within the app.

Here is what I got:

- (id)init
{
}

- (id)initWithName:(NSString *)name
{
self = [super init];
if (self) {

self.userInteractionEnabled = YES;
self.name = name;
self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.frame.size];
self.physicsBody.dynamic = NO;
self.physicsBody.usesPreciseCollisionDetection = YES;
self.currentTouchValue = nil;
}

return self;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
self.previousTouchesTimestamp = event.timestamp;
for (UITouch *touch in touches) {
self.currentTouchValue = [NSValue valueWithNonretainedObject:touch];
}
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
self.currentTouchValue = nil;
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
for (UITouch *touch in touches) {
NSValue *key = [NSValue valueWithNonretainedObject:touch];
if ([key isEqualToValue:self.currentTouchValue]) {
CGPoint touchPoint = [touch locationInNode:self.scene];
CGPoint movePoint = CGPointMake(self.position.x, touchPoint.y);

if ([self withinParentFrame:movePoint])
self.position = movePoint;
}
}
}

- (BOOL)withinParentFrame:(CGPoint)point
{
CGFloat offset = self.size.height / 2;
if (point.y >= offset && point.y <= self.scene.frame.size.height - offset)
return YES;
else
return NO;
}


P.S. I am learning Objective-C by myself and English is not my first language. So, if it's OK, explain me like you would to little child.

Given that PaddleNode is a subclass of SpriteKit Node, what would be an important thing to do is to first set the size property when using spriteNodeWithImageNamed::

self.size = self.view.scene.frame.size;

//Or, you could set it to somewhere else.
//Example:
//self.size = (CGSize){100.0f, 100.0f};


self.position = (CGPoint){CGRectGetMidX(self.scene.view.frame), CGRectGetMidY(self.scene.view.frame)};