Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift storyboard: tableview appearance not grouped #695

Open
twestley opened this issue Sep 14, 2014 · 4 comments
Open

Swift storyboard: tableview appearance not grouped #695

twestley opened this issue Sep 14, 2014 · 4 comments

Comments

@twestley
Copy link

I've added QD to a swift project via CocoaPods and bridging header. My subclassed QuickDialogController is one of three controllers in container views. Some of that seems relevant to the fact that the tableview does not appear to be grouped. I've set a breakpoint in initWithController to find that controller.root.grouped == YES and that self.style == UITableViewStyleGrouped. Everything works as expected -- including printing boolValue when selected -- except that the tableview appears plain:

notgrouped

import Foundation

class ControlsViewController : QuickDialogController {

    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.root = QRootElement()
        self.root.grouped = true
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        var section = QSection()
        var airplaneMode = QBooleanElement(title: "Airplane Mode", boolValue: false)
        airplaneMode.onSelected = {
            println("airplaneMode=\(airplaneMode.boolValue)")
        }

        self.root.addSection(section)
        section.addElement(airplaneMode)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }    
}

QuickDialog v1.0 (CocoaPods)
OS X Mavericks 10.9.4
Xcode 6 GM
iOS simulator: iPad Retina (8.0)

@SteveGreenley
Copy link

It may be that it worked correctly. If you open Settings in iOS8, that presents a grouped table and it looks just like what you have there.

@twestley
Copy link
Author

I think what you see in Settings in IOS8 are sections in a plain style table, not grouped style table. Grouped tables should still be possible, see https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html. However, I can't find an example in Apple iOS 8 apps. They seem to have moved away from grouped style for their apps.

@JoshOldenburg
Copy link

Settings is grouped, Contacts is not. Grouped tables have a gap at the beginning, end, and between sections; standard tables have no gaps and the headers stretch across the whole screen.

@twestley
Copy link
Author

I'm having trouble reconciling that with Apple statement (from https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html):

A grouped table view also displays a list of information, but it groups related rows in visually distinct sections. As shown in Figure 1-4, each section has rounded corners and by default appears against a bluish-gray background. [emphasis added]

What am I missing? Is there another property that needs to be set (in addition to grouped) to get the rounded corners and bluish-gray background? Or perhaps this just can't be done with QuickDialog table views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants