0

How to remove the shadow of the centerViewController on IIViewDeckController 2.2.11 ? I know I have to use a delegate that implements the viewDeckController:applyShadow:withBounds: selector. But I don't know how to do that.

If someone can help me. Thank you

Max
  • 774
  • 7
  • 20

2 Answers2

2

There is a property in the IIViewDeckController called 'shadowEnabled' simply set it to NO in your IIViewDeckController instance variable.

Alternatively in your Storyboard or .Xib file, you can add a User Defined Runtime Attribute with 'shadowEnabled' as the Key Path, 'Boolean' as the type and uncheck the value (making it NO/False)

RndmTsk
  • 1,704
  • 2
  • 12
  • 12
  • To be honest, I'm unsure which version we are running, my apologies if these aren't present pre 2.3 – RndmTsk Sep 24 '14 at 14:41
0

So I found the solution for the version 2.2.11.

I added this to AppDelegate.h:

#import "IIViewDeckController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, IIViewDeckControllerDelegate>

In AppDelegate.m, in didFinishLaunchingWithOptions class:

deckController.delegate = self;

Then I added the viewDeckController:applyShadow:withBounds: selector to the end of AppDelegate.m:

- (void)viewDeckController:(IIViewDeckController *)viewDeckController applyShadow:(CALayer *)shadowLayer withBounds:(CGRect)rect {
    shadowLayer.masksToBounds = NO;
    shadowLayer.shadowRadius = 0;
    shadowLayer.shadowOpacity = 0;
    shadowLayer.shadowColor = nil;
    shadowLayer.shadowOffset = CGSizeZero;
    shadowLayer.shadowPath = nil;
}
Max
  • 774
  • 7
  • 20