Tag Archives: selector

Custom TimerView in iOS – Swift

By | April 10, 2017

Hello everyone, Here in this tutorial I will show you how you can create a Custom View for Timer without any layout in Swift. Custom Timer Class Our Custom timer class will look like this [java] var timerBorderWidth : Int = 2; var timerWidth : Float = 30; var timeRadius : Float = 40; var timerVal : Int… Read More »

How to call a function in background in Xcode(iPhone)?

By | January 5, 2013

“performSelectorInBackground” will call anyfunction to execute in background and you can also pass string parameters with this method or if you want to pass more params then pass the parameters as an object. [self performSelectorInBackground:@selector(myBackgroundMethod:) withObject:@”String Params”];

How to rotate a body manually in Box2D?

By | January 24, 2011

The below code helps you to rotate a body in Box2D manually. [java] -(void) start { rot_sprite = [CCSprite spriteWithFile:[NSString stringWithFormat:@"rot_sprite.png" ]]; [self addChild: rot_sprite]; b2BodyDef bodyDef; b2Vec2 initVel; b2PolygonShape shape; b2CircleShape circleShape; b2FixtureDef fd; b2Body * rotating_body; b2RevoluteJointDef revJointDef; b2DistanceJointDef jointDef; b2Vec2 pos; bodyDef.position.Set(11.043825f, 4.984064f); bodyDef.angle = 0.000000f; bodyDef.userData = rot_sprite; rotating_body = world->CreateBody(&bodyDef;); initVel.Set(0.000000f, 0.000000f); rotating_body->SetLinearVelocity(initVel);… Read More »