Git Product home page Git Product logo

bohr's People

Contributors

argent avatar davdroman avatar gmoledina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bohr's Issues

change cell text - question

So i have a BOButtonTableViewCell with Turn Passcode On when the user first open settings.
When the user taps the button a lock view appears where he can enable a passcode for the app.
When the lockview is dismissed and the user has set his desired passcode i want the text of the button to change to Turn Passcode Off

is there any other way to achieve this besides keeping a reference of the cell and changing the title?
i mean just reloading a simple cell
thanks

Pod set up

Hi, The pod installation seems to be missing a significant number of files? Such as BOTableViewSection ?

accessing text values of all cells

this is less of an issue, and more of a question about how to use the library, since there isn't much documentation.

I'm using Bohr as a settings page. 3 of the cells are username, name, and email. Another cell is a button cell. The button cell saves the changed data from the other cells to the server. In the button cell, how can I access the text field values of the other cells? For example, in the main tableviewcontroller:

[section addCell:[BOButtonTableViewCell cellWithTitle:@"Save Info" key:nil handler:^(BOButtonTableViewCell *cell) {
        cell.actionBlock = ^{
           // usernamecell.Textfield.text here
          // emailcell.textfield.text here
          // API call to save new data to server here
          };
    }]];

any help would be appreciated, thanks

About the datePicker.datePickerMode

Hi David,
Thanks for your Bohr,it help me a lot in my project.
But now I have to change the datePicker.datePickerMode=UIDatePickerModeDateAndTime,
When I scroll the datePicker at today,the project will crash and the log is in the following:
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]' ***
Can you help me and tell me how to solve this problem?
Thanks a lot.

Cell with icon on the left side

Does it support adding an icon on the left side of the cell, similar to the iPhone settings ? or should i edit the source code so it supports adding an icon ?

IOS 7 support.

it crashes when using the layoutMargins
is there any solution for apps that still support IOS 7?
thanks

[Feature] DatePickerCell

Hi there!

I really love your library, I think there're no resources like this apart from InAppSettingsKit and I really support your job.

I just open the issue to let you know that a big feature to this awesome library would be to support DatePicker. I know this is easily extensible and I'll try to implement this feature after this week of holidays as I need it to my settings view.

Keep It up and I'm really looking forward to your next release!

Label and Text fields are not properly aligned

The labels and fields in Section 2 of the demo app are not aligned. The accessory view is slightly misaligned on the Y axis. The blue text field should be moved down a couple of pixels, it seems:

Issue Image

ValueDidChange in BOSetting

The setValueDidChangeBlock method in BOSetting is not exposed in the header file.
I'm wondering how the Model layer can register to be notified for any changes (so without adding itself as a target in the UI layer) ?

Adding an image to the cell

to use an image before the text do we need to subclass the cell or just mess with BOTableViewCell.m and add it there?
i used the default imageview of the cell so i added it in the BOTableViewCell.m by adjusting the class method like so:

+ (instancetype)cellWithTitle:(NSString *)title key:(NSString *)key image:(UIImage*)image handler:(void (^)(id cell))handler;

NSLayoutConstaint Issue with UITextField - BOTextTableViewCell

Steps to recreate:

  1. Add another BOTimeTableViewCell in the Section 2 of demo example.
  2. Tap to open the Cell
    Everything works perfectly
  3. Tap to close the pickerView
    Oops!!
Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0x7feaa363edb0 H:[UITableViewLabel:0x7feaa3631b90'Text']-(15)-[UITextField:0x7feaa363b070](LTR)>",
    "<NSLayoutConstraint:0x7feaa363ee00 UITextField:0x7feaa363b070.right == UITableViewCellContentView:0x7feaa3631a50.rightMargin>",
    "<NSAutoresizingMaskLayoutConstraint:0x7feaa37ddfc0 h=--& v=--& UITableViewLabel:0x7feaa3631b90'Text'.midX == + 187.5>",
    "<NSAutoresizingMaskLayoutConstraint:0x7feaa37de010 h=--& v=--& H:[UITableViewLabel:0x7feaa3631b90'Text'(343)]>",
    "<NSLayoutConstraint:0x7feaa37f3c00 'UIView-Encapsulated-Layout-Width' H:[UITableViewCellContentView:0x7feaa3631a50(375)]>",
    "<NSAutoresizingMaskLayoutConstraint:0x7feaa37ef590 h=--& v=--& 'UIView-Encapsulated-Layout-Left' H:|-(0)-[UITableViewCellContentView:0x7feaa3631a50]   (Names: '|':BOTextTableViewCell:0x7feaa3631040 )>"
)

This happens when a pickerView closes and the BOTimeTableViewCell has been dequeued. So when the TableViewcreates it again it throws the above error.

Swift 2.0 and Xcode 7 Support?

Is swift supported and if so.. How do I go about using this control in my project? Could you update the "Read Me" or just answer here in this issue?

title disappear after click on BOButtonTableViewCell

I create a BOButtonTableViewCell and set destinationViewController for it, but after go the destination view controller and then go back to Bohr controller, the item's title disappears!

        [section addCell:[BOButtonTableViewCell cellWithTitle:@"Sample Text" key:nil handler:^(BOButtonTableViewCell *cell) {
            cell.mainFont = [UIFont fontWithName:FONT_MAIN size:18];

            SampleViewController *dvc = [[SampleViewController alloc] init];
            cell.destinationViewController = dvc;

        }]];

Before:
<img width="321"src="https://cloud.githubusercontent.com/assets/611607/13378298/30b7de66-de17-11e5-87cf-2e8b3148a30f.png">

After:

How to solve this issue?

callback when choice is changed

Hello and thanks for this great library.
I was wondering if there is a way to know when a user changes a value in an BOChoiceTableViewCell cell. I haven't subclassed the cell so i am using the demo for now.
So i want to be able to do something when i user changes his choice in the cell.
can you help?
thanks

Feature request: set static footer programmatically

Common thing on settings screens - to show version and build number in footer. This can't be done from storyboard, only in runtime, so I want property like defaultFooterTitle. It even can be configured for each section. So priorities for section footers will be: 1) storyboard 2) default from property 3) cells dynamic footers.

Thanks!

How to make a uislider inside?

Hi!

How can i add my own subclass so i can have a uislider inside the cell?

I've tried with the following code, but it seems like the constrains are messing it up.

self.slider = [UISlider new];
//frame for the slider
//create and initialize the slider
self.slider = [[UISlider alloc] init];
//set the minimum value
self.slider.minimumValue = 100.0f;
//set the maximum value
self.slider.maximumValue = 2000.0f;
//set the initial value
self.slider.backgroundColor = [UIColor blackColor];

[self.slider addTarget:self action:@selector(toggleSwitchValueDidChange) forControlEvents:UIControlEventValueChanged];

[self.contentView addSubview:self.slider];

NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint constraintWithItem:self.slider attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.slider.superview attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
NSLayoutConstraint *rightConstraint = [NSLayoutConstraint constraintWithItem:self.slider attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.slider.superview attribute:NSLayoutAttributeRightMargin multiplier:1 constant:0];

self.slider.translatesAutoresizingMaskIntoConstraints = NO;
[self.slider.superview addConstraints:@[centerYConstraint, rightConstraint]];

Small Animation Issue

in the demo project i added the following line between the 2 switches in the 1st section:

[section addCell:[BOStepperTableViewCell cellWithTitle:@"Stepper" key:@"stepper" handler:nil]];

Now if you try to change value of the 1st switch there is a small animation issue while the tableview is trying to animate switch 2 into the view.

Same goes if i put the stepper as the 1st cell. if however i put the stepper as the 3rd cell (last one of 1st section) the animation works fine

[FEATURE] Number TextField

Hi there!

I'm working now with your library and I've come with a feature that could be an extension for BOTextViewCell which only accepts int numbers or decimal numbers on it. Do you think is viable? Or it's reachable with the current library?

Regards!

BOStepperTableViewCell.h missing

when testing the latest version it fails to work as the BOStepperTableViewCell header file is missing from the public headers in the Bohr framework target.
adding it makes everything work just fine 👍

plus it would a good idea to add it to the demo too :)

Alpha.3 Bug.

I think this file is in the project by mistake BOTableViewCell (MacBook Pro de David's conflicted copy 2015-08-26).h

It produces an error when you try to execute the app (Duplicate interface definition) using cocoapods. Should be fixed once is removed.

Drop storyboard support?

Bohr started out without any storyboard support whatsoever until it was introduced in version 2. The thing is IB isn't quite ready to support IBDesignable cells inside its UITableViewControllers (and doesn't look like it will anytime soon). Besides, there have been some reported issues about resizing and autolayout that I found are related to storyboard being the way to set up the table view controller.

The only advantage storyboard support adds is IBInspectables, but without IBDesignable support this looses great part of its importance.

This advantage vs. all the other disadvantages drive me to think I should drop storyboard support as part of a version 3 release. That way, the whole setup process would be made in a same place (setup method of your BOTableViewController subclass) and would allow for issues like #8 to be fixed.

What's your opinion on this? Is storyboard a must-have for Bohr or would you be just fine setting it up programmatically? I feel like it would bring many benefits.

Nothing happens in BOOptionTableViewCell

// AppDelegate.m

[[NSUserDefaults standardUserDefaults] registerDefaults:@{
                                                              @"settings.language": @0,
                                                              }];

// SettingsTableViewController.m

[self addSection:[BOTableViewSection sectionWithHeaderTitle:DPLocalizedString(@"settings.navbar.title", nil) handler:^(BOTableViewSection *section) {

        [section addCell:[BOChoiceTableViewCell cellWithTitle:DPLocalizedString(@"settings.table.language", nil) key:@"settings.language" handler:^(BOChoiceTableViewCell *cell) {
            cell.options = @[@"English", @"Swedish", @"Russian", @"Uzbek"];
            cell.destinationViewController = [LanguageSettingsViewController new];
        }]];

    }]];

// LanguageSettingsViewController.m

- (void)setup {

    self.title = DPLocalizedString(@"settings.table.language", nil);

    [self addSection:[BOTableViewSection sectionWithHeaderTitle:DPLocalizedString(@"settings.table.language", nil) handler:^(BOTableViewSection *section) {

        [section addCell:[BOOptionTableViewCell cellWithTitle:@"English" key:@"settings.language" handler:nil]];

        [section addCell:[BOOptionTableViewCell cellWithTitle:@"Swedish" key:@"settings.language" handler:nil]];

        [section addCell:[BOOptionTableViewCell cellWithTitle:@"Russian" key:@"settings.language" handler:nil]];

        [section addCell:[BOOptionTableViewCell cellWithTitle:@"Uzbek" key:@"settings.language" handler:nil]];

    }]];

}

It displays LanguageSettingsViewController but nothing happens when I select any of the options.

Support "dynamic" options

Use case:

  1. There is a option called "Custom endpoint"
  2. Switching it to on uncovers one more option below: "URL"

I have some ideas how implement that in a nice way, now I have a flag in my viewController:

        if (self.flag) {
            [section addCell:[BODateTableViewCell cellWithTitle:@"url" key:@"url" handler:nil]];
        }

rebuilding list is done by:

[self setup];
[self.tableView reloadData];

I have some ideas how to do it in more declarative way, and ready to discuss them if you think it's worthy to have this feature.

heightForFooterInSection does not take font into account

When I set a footerTitleFont (eg section.footerTitleFont = UIFont(name: "Avenir-Book", size: 9)), that font is not taken into account (here. This is particularly noticeable when you have a string which is a different number of lines with the applied font vs the default font. Example:

Default font:

simulator screen shot nov 8 2015 1 04 09 pm

Custom font (observed):

simulator screen shot nov 8 2015 1 03 58 pm

I made some changes in a fork to take the font into consideration, but I don't really like having to assume the padding around the textLabel (observed to be 16 on the left and right and 7 on the top and bottom). I'll have a think about how to remove that without making things too complicated, though perhaps you have a better idea.

Custom font (expected):

simulator screen shot nov 8 2015 1 04 41 pm

Preload data on BOChoiceTableViewCell

Hi David!

I have used your component, it's awesome!! I have a question I use it for create a calendar event, user can select one or multiple valid days for his event, at this point I subclassed BOTableViewController and works perfectly! but at the moment of edition I cannot found a way to "preload" multiple previous selections.

I used BOOptionTableViewCell and wrote in handler:
cell.accessoryType = UITableViewCellAccessoryCheckmark;
for each cell that I want to be marked but it doesn't work

Any ideas?

Thanks in advance!

Ability to observe the values changes

If I'm storing my settings on some external server, I'd love to have a way to monitor their changes. Right now I'm doing it in the .visibilityBlock, with the key set to the field's key:

    [section addCell:[BOSwitchTableViewCell cellWithTitle:@"Push Notifications" key:@"push_notif" handler:^(BOSwitchTableViewCell *cell) {
        cell.visibilityKey = @"push_notif";
        cell.visibilityBlock = ^BOOL (id settingValue ){
            [self setPushTo:[settingValue boolValue]];
            return YES;
        };

    }]];

but I doubt this is the preferred way to handle it.

With BOButtonTableViewCell I have an access to the .actionBlock, but with other cell types it's not there, even it could be useful.

Add an option to change the BOTableViewSection appearance

In order to change the background and font colors of a section I need to use this workaround:

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section{
    // Background color
    view.tintColor = [UIColor blackColor];
    UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
    [header.textLabel setTextColor:[UIColor whiteColor]];
}

It should be handled by the appearance proxy.

[self bo_setFont:font] → -[__NSCFNumber length]: unrecognized selector

Thanks for providing Bohr. It's been very helpful!

I'm having one issue. Here are the steps producing the crash:

  1. During app launch, I enumerate a tabbar's view controller array -- 1 VC is a subclass of BohrTableViewController
  2. Attempt to present a UIPickerView from a completely separate, non-bohr-subclass tableview and the app crashes
#import "UILabel+DatePickerCustomization.h"

// line 85
- (void)bo_setFont:(UIFont *)font {
.... [self bo_setFont:font] ;
}

Dismiss keyboard on background tap or activating other cells

After presenting a keyboard for textfield the only way to hide it - click Done button. If I click other cells or even go through navigation controller keyboard still persists on screen. Personally I want to hide it on interaction with other cells or even with tap on tableview background.

This can be optional configurable behaviour.

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.