Git Product home page Git Product logo

Comments (20)

davdroman avatar davdroman commented on May 10, 2024

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 :)

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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?

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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.

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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 :)

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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];

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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 :)

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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 πŸ‘Œ

from bohr.

davdroman avatar davdroman commented on May 10, 2024

I'll gladly implement it for alpha 2 then πŸ˜„

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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.

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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?

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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.

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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

from bohr.

davdroman avatar davdroman commented on May 10, 2024

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?

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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.

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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

from bohr.

davdroman avatar davdroman commented on May 10, 2024

Alpha 4 is now up. Check it out. I think layout issues must be mostly gone πŸ˜„

from bohr.

Davvie avatar Davvie commented on May 10, 2024

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

from bohr.

davdroman avatar davdroman commented on May 10, 2024

Cool! I'm closing this now πŸŽ‰

Let me know if you run into any other issue.

from bohr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.