Skip to content

Commit

Permalink
changed example
Browse files Browse the repository at this point in the history
  • Loading branch information
cwRichardKim committed Dec 23, 2014
1 parent 44b4c92 commit 5e275ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Binary file not shown.
25 changes: 14 additions & 11 deletions RKNotificationHub/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,35 @@ - (void)viewDidLoad {
[self setupButton];

UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"earth"]];
imageView.frame = CGRectMake(50, 50, 70, 70);
imageView.frame = CGRectMake(self.view.frame.size.width/2 - 35, 70, 70, 70);

hub = [[RKNotificationHub alloc]initWithView:imageView];
[hub moveCircleByX:-5 Y:5];
[hub moveCircleByX:-5 Y:5]; // moves the circle five pixels left and 5 down
[self.view addSubview:imageView];
}

-(UIButton *)setupButton
-(void)testIncrement
{
[hub increment];

[hub pop];
// [hub blink];
// [hub bump];
}

-(void)setupButton
{
UIColor* color = [UIColor colorWithRed:.15 green:.67 blue:.88 alpha:1];

UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(50, 400, 200, 60)];
button.center = self.view.center;
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button setTitle:@"Messages" forState:UIControlStateNormal];
[button setTitle:@"Increment" forState:UIControlStateNormal];
[button setBackgroundColor:color];
button.layer.cornerRadius = 5;
[button addTarget:self action:@selector(testIncrement) forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:button];
return button;
}

-(void)testIncrement
{
[hub increment];
[hub pop];
}

- (void)didReceiveMemoryWarning {
Expand Down

0 comments on commit 5e275ca

Please sign in to comment.