Skip to content
This repository has been archived by the owner on Aug 24, 2020. It is now read-only.

Support for long cell titles #8

Closed
Davvie opened this issue Jul 17, 2015 · 20 comments
Closed

Support for long cell titles #8

Davvie opened this issue Jul 17, 2015 · 20 comments

Comments

@Davvie
Copy link

Davvie commented Jul 17, 2015

Bohr is great. But with the support (automatic resizing) of long cell titles it would become even better.

2015-07-17 14 43 33

@davdroman
Copy link
Owner

That is definitely on my checklist. The thing is it's pretty tricky due to some Autolayout needs in certain cells. But yeah, I'm on working on it :)

@davdroman
Copy link
Owner

So I've been trying to make it work but seems like storyboard's UITableViewControllers aren't quite ready for this kind of business.

I'll keep trying, but the idea of dropping storyboard support and make it all programmatic is growing in me. It's just much cleaner + allows for this kind of stuff.

What's your opinion on this?

@Davvie
Copy link
Author

Davvie commented Aug 7, 2015

Sorry for a late reply.

I believe you're right. Dropping storyboard support indeed gives more freedom.

There is a nice example of using a programmatic approach in a similar field. For instance, here's the way you can describe form fields in FXForms:

- (NSArray *)fields
{
    return @[
             @{FXFormFieldKey: @"email", FXFormFieldTitle: @"Email Address"},
             ...other fields...
            ];
}

I guess Bohr could benefit from using a similar approach by describing settings in code.

@davdroman
Copy link
Owner

Good to hear your thoughts about this. I'll start working on v3 then :)

@davdroman
Copy link
Owner

Hey there @Davvie!

I just pushed v3.0.0 alpha 1 and I'd like it if you gave it a try. I'm pretty positive this bug is now gone since the nasty Autolayout hack is now longer necessary :)

@Davvie
Copy link
Author

Davvie commented Aug 28, 2015

Great to hear version 3 is out!

I tried to set it up but it doesn't seem to work at all :(

1

I guess, you've dropped Storyboard support. So I tried to do everything in code but I'm surely doing something wrong.

I've got a view controller which is a subclass of BOTableViewController. It is assigned to a storyboard scene.

The first and major problem is that setup() is never called.

That's how I tried to add settings to Bohr:

BOTableViewSection *basicSettings = [[BOTableViewSection alloc] init];
    BOSwitchTableViewCell *autoLoginCell = [[BOSwitchTableViewCell alloc] init];
    autoLoginCell.textLabel.text = @"Automatic login";
    autoLoginCell.key = @"Settings_AutoLogin";
    BOSwitchTableViewCell *episodePriorityCell = [[BOSwitchTableViewCell alloc] init];
    episodePriorityCell.textLabel.text = @"Show new episodes first";
    episodePriorityCell.key = @"Settings_NewOnTop";
    [basicSettings addCell:autoLoginCell];
    [basicSettings addCell:episodePriorityCell];
    [self addSection:basicSettings];

@davdroman
Copy link
Owner

Yeah storyboard support is completely dropped, meaning not even assigning a subclass to a UITableViewController in a storyboard will work. I could include that little feature in next alpha if storyboards are really that mandatory.

Please try running the demo project on Xcode 7 :)

@Davvie
Copy link
Author

Davvie commented Aug 28, 2015

Aaah, I see. Well, in my current app I have a few buttons that initiate a storyboard segue. So having this little feature would be handy for me to migrate from v2 to v3 :)

But I think in my future projects I will anyway do everything settings-related just in code so it will be more extensible in the long run. Plus, sometimes it takes forever for Xcode to launch Interface Builder if the storyboard is complex.

I'm going to install Xcode 7 tomorrow, so I'll write back once I try it out 👌

@davdroman
Copy link
Owner

I'll gladly implement it for alpha 2 then 😄

@davdroman
Copy link
Owner

Hey! I just released alpha 2. BOTableViewController should now be attachable as a class to storyboards' UITableViewControllers.

@Davvie
Copy link
Author

Davvie commented Aug 29, 2015

Yay! Thank you for the Storyboard support, I've just moved to v3, so far so great :)

While running the demo project in Xcode 7 I encountered a few runtime error messages in the console:

Aug 29 16:47:39 BohrDemo[50912] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Aug 29 16:47:39 BohrDemo[50912] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Aug 29 16:47:39 BohrDemo[50912] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

screen shot 2015-08-29 at 16 52 29

but the demo app itself works perfectly fine.

@davdroman
Copy link
Owner

Hmm, that simulator screen is pretty weird. The text cell and footer title's font are bigger than they should be. Was it you who modified such values or is it a bug?

@Davvie
Copy link
Author

Davvie commented Aug 29, 2015

Oh, it does look weird. Haven't noticed it when I first took the screenshot.

No, I didn't change anything code-wise, just ran the project as it is.

@davdroman
Copy link
Owner

Ok we have a few problems then. Let me install Xcode 7 myself and check out what's happening.

@davdroman
Copy link
Owner

I've checked it out and seems like the problem with the text cell isn't ocurring for me, although footers are indeed displayed with a huge font size too. I'll work on that.

Do you see the text cell with the height displayed on the screenshot right when opening the app, or is it reproducible?

@Davvie
Copy link
Author

Davvie commented Aug 30, 2015

Just tried again, I can't seem to reproduce it. Tapped at all possible buttons and switches but everything's okay anyway.

Btw, noticed one minor issue while running in my current app (with Storyboard). If you start scrolling or changing settings the cells begin to resize (sometimes quite noticeably). But it happens only once.

@Davvie
Copy link
Author

Davvie commented Aug 30, 2015

Seems like there are some other iOS 9-related problems. Here's what happened when I tried to run my app: https://vid.me/Qx57

@davdroman
Copy link
Owner

Alpha 4 is now up. Check it out. I think layout issues must be mostly gone 😄

@Davvie
Copy link
Author

Davvie commented Sep 5, 2015

Great! Thank you, now I don't experience any layout issues at all :)

@davdroman
Copy link
Owner

Cool! I'm closing this now 🎉

Let me know if you run into any other issue.

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

No branches or pull requests

2 participants