Code Monkey home page Code Monkey logo

formkit.m's People

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

formkit.m's Issues

Integer type

Hello
I can enter alpha numerics digits in type integer. And i can't enter more than 10 digits
It's posible to define the number of digits and not allow alpha characters?
Thabks

Exception in [FKFormMapper titleForHeaderInSection]

I'm having trouble with FormKit.m. I was able to use BaseKit successfully but require the custom cell functionality.
I get an EXC_BAD_ACCESS exception in [FKFormMapper titleForHeaderInSection] when scrolling or moving to a new cell.
I can email a sample workspace if you want.

Mapping to non-NSString for picker

Hey there,

im trying to map my object for a picker, which looks something like this:

    [formMapping mapAttribute:@"appPlaceCategory"
                        title:@"Type of practice"
                 showInPicker:YES
            selectValuesBlock:^NSArray *(id value, id object, NSInteger *selectedValueIndex){
                *selectedValueIndex = 1;
                return self.categories;

            } valueFromSelectBlock:^id(id value, id object, NSInteger selectedValueIndex) {
                return [self.categories objectAtIndex:selectedValueIndex];

            } labelValueBlock:^id(id value, id object) {
                return value;

            }];

Now, the problem is, appPlaceCategory or AppPlace.AppPlaceCategory is not a string, but rather of an object type (i.e Category). I can't seem to get this to map properly.

Any help would be appreciated.

Thanks!

Keyboard Type

Is there a way of selecting the type of keyboard?

For example I have a FKFormAttributeMappingTypeText and its for the user to enter an email address, I'd like the keyboard type to be UIKeyboardTypeEmailAddress. Or maybe a phone number so I'd like to show UIKeyboardTypeNumberPad.

Please let me know if this is possible, if its not what would be the best approach to accomplish this?

On iOS > 8 row height for invalid rows is wrong.

In iOS < 8 when a row field is invalid the row height is correctly calculated to display the error message.

But with iOS >= 8 the row height is wrong and the cell doesn't displays well the error message.

I was debugging this and the problem is in this line of FKFormMapper.m:

CGFloat rowHeight = attributeMapping.rowHeight > 0 ? attributeMapping.rowHeight : self.tableView.rowHeight;

It always returns 0 so then when the cell is updated it height only has the height of the error label (wich is well calculated).

Create .podspec

Since you're removing FormKit from BaseKit can you create a .podspec for FormKit.m (and TableKit.m) please?

Customize Cells layout

Hello, I'm trying to figure out how to customize the aspect of table cells with FormKit without losing the mapping features.

I tried using the method mapCustomCell: identifier: rowHeight: willDisplayCellBlock: but i cannot set the "type" attribute in any way.

Do I need to subclass the FK Cells?

Thank you.

Keypath save doesn't exist

I get this error:

Error FormKitFormMapping keyPath save doesn't exist for object name User .

This happens when tring to use buttonSave method:

[FKFormMapping mappingForClass:[User class] block:^(FKFormMapping *formMapping) {

    // here some fields added without any problem 
    // and this is the line causing the error. 
    [formMapping buttonSave:@"Save" handler:^{
            [self.formModel save];
            [self afterUserSaved];
    }];
}];
[self.formModel loadFieldsWithObject:user];

Once the error is printed into the console, FormKit.m doesn't trigger the save event. Any help would be appreciated, thanks.

Some minor errors i found from lint test

Warning from pod spec lint test:

-> FormKit.m (0.4.0)
    - NOTE  | [xcodebuild]  ActionSheetPicker2/Pickers/AbstractActionSheetPicker.m:235:40: warning: 'UITextAlignmentCenter' is deprecated: first deprecated in iOS 6.0 [-Wdeprecated-declarations]
    - NOTE  | [xcodebuild]  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h:42:5: note: 'UITextAlignmentCenter' declared here
    - NOTE  | [xcodebuild]  ActionSheetPicker2/Pickers/AbstractActionSheetPicker.m:235:40: warning: implicit conversion from enumeration type 'enum UITextAlignment' to different enumeration type 'NSTextAlignment' (aka 'enum NSTextAlignment') [-Wenum-conversion]
    - NOTE  | [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetStringPicker.m:106:125: warning: cast of type 'SEL' (aka 'SEL *') to 'char *' is deprecated; use sel_getName instead [-Wcast-of-sel-type]
    - NOTE  | [xcodebuild]  ActionSheetPicker2/Pickers/DistancePickerView.m:97:70: warning: using 'stringWithString:' with a literal is redundant [-Wobjc-redundant-literal-use]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:68:65: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:69:67: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:101:18: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:121:18: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:126:62: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:126:97: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetDistancePicker.m:150:47: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/ActionSheetStringPicker.m:103:82: warning: implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/DistancePickerView.m:28:64: warning: implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/DistancePickerView.m:30:104: warning: implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [iOS] [xcodebuild]  ActionSheetPicker2/Pickers/DistancePickerView.m:46:108: warning: implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
    - NOTE  | [xcodebuild]  BWSelectViewController/BWSelectViewController/BWSelectViewController.m:328:10: warning: incompatible pointer to integer conversion initializing 'BOOL' (aka 'signed char') with an expression of type 'UIView *' [-Wint-conversion]
    - NOTE  | [iOS] [xcodebuild]  FormKit.m/FormKit/FKFormMapper.m:463:60: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]

Crashing on Archive (distribution) build

My app is only crashing when I do an archive build but runs completely fine when I've done a normal 'run' build. The app always crashes at the same point when I have entered a value in a UITextField and select a different field or when I've selected a value from the UIPickerView and select the 'done' button.

I've managed to find the point where the app is crashing, which is within the '- (void)setValue:(id)value forAttributeMapping:(FKFormAttributeMapping *)attributeMapping' method in 'FKFormMapper.m' It seems to crash on the 'if (nil != self.formModel.didChangeValueBlock) {' statement line. The only error I can get form the console is below. If I try to do NSLog(@"%@", self.formModel.didChangeValueBlock); then it will crash and not show anything. I am confused as it works fine when running the app from within xcode by doing a 'run' build but when running the app from an archive it will crash every time.

Sep 11 21:11:08 unknown ReportCrash[20645] : Formulating crash report for process GeoJobi[20641]
Sep 11 21:11:08 unknown geod[20642] : Can't get bundle identifier for process 20641
Sep 11 21:11:08 unknown com.apple.launchd[1] : (UIKitApplication:com.geojobi.geojobi[0x56bd]) Job appears to have crashed: Segmentation fault: 11
Sep 11 21:11:08 unknown SpringBoard[52] : Application 'GeoJobi' exited abnormally with signal 11: Segmentation fault: 11
Sep 11 21:11:08 unknown ReportCrash[20645] : libMobileGestalt computeUniqueDeviceID: total time for bb to return imei: 0

UIDatePickerView random crash

There was a problem when using FKFormAttributeMappingTypeDate and rolling the date while simultaneously dismissing the datepicker window. If done at the right moment, the app would crash. The exact moment is to close while the datepicker is stabilizing.

The problem is related to:

[datePicker addTarget:self action:@selector(eventForDatePicker:) forControlEvents:UIControlEventValueChanged];

If the pickerview is dismissed while that event is sent, the app will crash.

A possible solution is to unregister event when the ActionSheetDatePicker is dealloced:

- (void)dealloc {
 [((UIDatePicker*)self.pickerView) removeTarget:self action:@selector(eventForDatePicker:) forControlEvents:UIControlEventValueChanged];
}

Formkit's podspec incompatible with latests CocoaPods version?

Hi there,

I'm getting an error after having updated my cocoapods installation to v 0.20.2 when trying to include FormKit in my Podfile.

I have a very simple Podfile, which looks like this:

platform :ios, '5.0'
pod 'AFNetworking'
pod 'MACollectionUtilities'
pod 'FormKit.m', :git => "https://github.com/brunow/FormKit.m.git", :tag => "0.2.0"

Now I'm getting the following error when doing pod --verbose install

Pod::DSLError - Invalid `FormKit.m.podspec` file: [!] Unsupported version requirements
 #
 #  from /Users/Account/source/Project/Pods/Local Podspecs/FormKit.m.podspec:14
 #  -------------------------------------------
 #    s.dependency 'ActionSheetPicker2'
 >    s.dependency 'BWSelectViewController', :git => "https://github.com/brunow/BWSelectViewController.git", :tag => "0.1.1"
 #  end
#  -------------------------------------------

I checked all three dependency, and they can be included in the Podfile without projects?

Any ideas what might be the problem?

Regards,
Ilja

Scrolling only works with UITableViewController

When using FomKit Demo, the scrolling to show the actual "in focus" field only works, because the UITableView is embedded in a UITableViewController. It does not work, if using an UIViewController and add a UITableView as property: The scrollview does not get, that the keyboard showed up and so the in focus maybe hidden.
I made a demo project and added also a possible solution in form of the OS Component TPKeyboardAvoiding, hosted here on github:
https://github.com/michaeltyson/TPKeyboardAvoiding

Just see the fork at:
https://github.com/appcominteractive/FormKit.m
and checkout feature_autoScrollingWithoutUITableViewController branch.

Question is, if this should be part of FormKit or at least the FormKit Documentation (as warning).

Regards,
Christian

Missing synthesize

Hello, I'm trying to migrate from BaseKit formMapping to FormKit.

I noticed a lot of new properties are missing their getter / setter methods and, in fact, the compiler complains they need to be synthesized.

Anybody else is having this issue? In the meantime i'll try if synthesizing it works or not.

Thanks! :P

UIPickerView - Crashing

If you don't move the UIPickerView and tap on 'Done' the app will crash every time. If you move the list up and down it will work as normal as it should do. Please see the error message below:

* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM objectAtIndex:]: index 2147483647 beyond bounds [0 .. 40]'

iOS7

Can you please confirm this works with iOS7 and matches the style.

If so, will it also look correct on iOS6?

Et alors ?

Et ben ! Ca n'avance plus beaucoup par ici !

Issue with float conversion when using french UIKeyboardTypeDecimalPad

I I've noticed an issue when trying to enter a float value with a french UIKeyboardTypeDecimalPad.
In this case the string value is x,xxx and not x.xxx so [value floatValue] is just returning the decimal part.
What I suggest is to replace it by

float floatValue = [[value stringByReplacingOccurrencesOfString:@"," withString:@"."] floatValue];

in

  • (id)convertValueToObjectPropertyTypeIfNeeded:(NSString*)value attributeMapping:(FKFormAttributeMapping *)attributeMapping

of FKFormMapper.m

Thanks for the good job
Regards
Nicolas

Exception in [FKFormMapper setValue:forAttributeMapping] with CoreData

When I have a CoreData class derived from another I get an exception when updating a field.

2012-08-19 17:44:49.518 FormKitDemo[1975:c07] *** WebKit discarded an uncaught exception in the webView:shouldInsertText:replacingDOMRange:givenAction: delegate: Unacceptable type of value for attribute: property = "numActors"; desired type = NSNumber; given type = __NSCFString; value = 1.

A sample project can be found here https://app.dumptruck.goldenfrog.com/p/I6U688lGVM

Field Validation

Do you have any plans to add form validation blocks to fields? It would be nice to be able to display a badge on a cell or a tooltip indicating an invalid value.

form mapping to sqlite table?

how to customize it so it form mapping to sqlite table? like given sqlite table name, formkit when save will save it to sqlite table.

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.