Hello,
I am following your examples and there is an apparent problem. I am attempting to configure my sidedrawer here.
class DrawerContentController: UIViewController, TKSideDrawerDelegate {
var sideDrawerView: TKSideDrawerView? = nil
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.view.backgroundColor = UIColor.whiteColor()
sideDrawerView = TKSideDrawerView(frame: self.view.bounds)
self.view.addSubview(sideDrawerView!)
let navBar = UINavigationBar(frame: CGRectMake(0, 0, self.view.frame.size.width, 64))
let navItem = UINavigationItem(title: "Getting Started")
let showSideDrawerButton = UIBarButtonItem(title: "Show", style: UIBarButtonItemStyle.Plain, target: self, action: "showSideDrawer")
navItem.leftBarButtonItem = showSideDrawerButton
navBar.items = [navItem]
sideDrawerView!.mainView.addSubview(navBar)
let sideDrawer = sideDrawerView!.sideDrawer
sideDrawer.title = "Navigation Menu"
sideDrawer.fill = TKSolidFill(color: UIColor(red: 28 / 255.0, green: 250/255.0, blue: 241/255.0, alpha:1.5))
sideDrawer.delegate = self
sideDrawer.style.headerHeight = 80
let sectionPrimary = sideDrawerView!.sideDrawer.addSectionWithTitle("Primary")
sectionPrimary.addItemWithTitle("Social")
sectionPrimary.addItemWithTitle("Promotions")
let sectionLabels = sideDrawerView!.sideDrawer.addSectionWithTitle("Labels")
sectionLabels.addItemWithTitle("Social")
sectionLabels.addItemWithTitle("Promotions")
sectionLabels.addItemWithTitle("Sent Mail")
sectionLabels.addItemWithTitle("Drafts")
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func showSideDrawer() {
self.sideDrawerView!.sideDrawer.show()
}
func sideDrawer(sideDrawer: TKSideDrawer!, updateVisualsForItemAtIndexPath indexPath: NSIndexPath!) {
let section = sideDrawer.sections()[indexPath.section] as! TKSideDrawerSection
let item = section.items()[indexPath.item] as! TKSideDrawerItem
item.style.contentInsets = UIEdgeInset
Of particular focus to me is the background color. With this code I am still getting the default background with no changes. I am using this object as content for my drawer. I am using this object in my app delegate like so:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let contentController = DrawerContentController()
let sideDrawerController = TKSideDrawerController(content: contentController)
self.window?.rootViewController = sideDrawerController
return true
}
I just want to be able to change the background color of the drawer.
Please assist. Thank you