rnystrom / RNFrostedSidebar

A Control Center-esque control with blurred background and toggle animations.
MIT License
2.12k stars 340 forks source link

No animation when selecting an image from the sidebar #34

Open massdonati opened 10 years ago

massdonati commented 10 years ago

68747470733a2f2f7261772e6769746875622e636f6d2f726e797374726f6d2f524e46726f737465644d656e752f6d61737465722f696d616765732f636c69636b2e676966

I followed your steps:

-(RNFrostedSidebar *) sideBar {
  if (!_sideBar) {
    _indexSet = [NSMutableIndexSet indexSetWithIndex:1];
    _images = @[[UIImage imageNamed:@"fixing_tools"],
                [UIImage imageNamed:@"red_cross"],
                [UIImage imageNamed:@"settings"],
                ];
    _colors = @[[UIColor greenColor],
                [UIColor whiteColor],
                [UIColor yellowColor]
                ];
    _sideBar = [[RNFrostedSidebar alloc] initWithImages:_images selectedIndices:self.indexSet borderColors:_colors];
    _sideBar.delegate = self;
  }
  return _sideBar;
}
-(void)sidebar:(RNFrostedSidebar *)sidebar didTapItemAtIndex:(NSUInteger)index {
  [[[WFAppDelegate sharedDelegate] window] setRootViewController:[self.controllers objectAtIndex:index]];
}

-(void)sidebar:(RNFrostedSidebar *)sidebar didEnable:(BOOL)itemEnabled itemAtIndex:(NSUInteger)index  {

  if (itemEnabled) {
    [self.indexSet addIndex:index];
  }
  else {
    [self.indexSet removeIndex:index];
  }
}

But nothing happens.

skull-squadron commented 10 years ago

A similar setup is animating in a production dev env (iOS 7.1 + XCode 5.1.1)

Got all the right frameworks, esp. QuartzCore?