xmartlabs / xlform Goto Github PK
View Code? Open in Web Editor NEWXLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C.
License: MIT License
XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C.
License: MIT License
How to make support ios 6 version?
I removed some libraries from pods, but still have lots of error.
Hi,
I'm using XLForm with Cocoapods in a project developed in Swift and Objective-C.
I tried to use key as XLFormRowDescriptorTypeButton
(from XLForm.h) into my Swift files but when I try to compile, I have those errors:
Undefined symbols for architecture i386:
"_XLFormRowDescriptorTypeButton", referenced from:
__TFC7MyProject26LoginAccountViewController26_getXLFormTypeForInputTypefS0_FSiGSqSS_ in LoginAccountViewController.o
Any suggestion ?
hi,
can i set my custom row click event?
i try to set the tableview 'didSelectRowAtIndexPath' delegate,
then all xlform row's click event is can't work.
how can i to do these ?
thanks very much:)
Currently, all the 'setup' code for an XLForm cell is located inside the 'init' methods. This can cause issues when trying to use a category to modify the cell class. Most of the 'init' methods are themselves category methods. As a result, calls to [super initWithX] have no effect.
This issue could be avoided by moving the actual logic of setting up the cell into a separate method call. Categories and Subclasses would then be able to override this method rather than having to override init.
P.S. The 'dealloc' method would also be a good candidate for this type of change.
I'm using v2.0.0 and I want to change the disable
state of my rows programmatically without reloading the view. But when I do this the rows stay in their previous state. This happens both when I set disabled
to YES
or to NO
.
Once I change the view or scroll the table view down so that some rows are not visible any more and I scroll back then those rows that were invisible for a moment are correctly disabled/enabled.
How can I make everything work without the need to scroll? Any workaround for me to quick-fix this thing? Also I think this is an issue with XLForm and should be fixed within the framework long-term.
Here are three screenshots, when I change the state of the "Availability" switch then all other rows should get enabled/disabled. On the first screenshot everything is fine. On the second I have enabled the switch so everything else should be disabled but it doesn't work. And on the third one you can see the state after scrolling down and up again.
Thank you for your help!
When opening a XLFormViewController modally (UIModalPresentationFormSheet presentation style), the view is first displayed correctly, then get pushed to the right (approximatively 100pt in my landscape iPad app) when the first field automatically obtain focus.
I need to set min/max dates and an interval for the selection. I can't seem to figure out how to do this with the current master branch. I've added some properties to XLFormDateCell to control these and updated setModeToDatePicker: to set the options on the date picker.
-(void)setModeToDatePicker:(UIDatePicker *)datePicker
{
if ((([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDateInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeDate]) && self.formDatePickerMode == XLFormDateDatePickerModeGetFromRowDescriptor) || self.formDatePickerMode == XLFormDateDatePickerModeDate){
datePicker.datePickerMode = UIDatePickerModeDate;
}
else if ((([self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTimeInline] || [self.rowDescriptor.rowType isEqualToString:XLFormRowDescriptorTypeTime]) && self.formDatePickerMode == XLFormDateDatePickerModeGetFromRowDescriptor) || self.formDatePickerMode == XLFormDateDatePickerModeTime){
datePicker.datePickerMode = UIDatePickerModeTime;
}
else{
datePicker.datePickerMode = UIDatePickerModeDateAndTime;
}
if (self.minuteInterval)
datePicker.minuteInterval = self.minuteInterval;
if (self.minimumDate)
datePicker.minimumDate = self.minimumDate;
if (self.maximumDate)
datePicker.maximumDate = self.maximumDate;
}
Then in my form setup I can do this to get the desired effect:
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"ends" rowType:XLFormRowDescriptorTypeTimeInline title:@"Ends"];
row.value = [NSDate dateWithTimeIntervalSinceNow:60*60*25];
XLFormDateCell * dateEndCell = (XLFormDateCell *)[row cellForFormController:self];
dateEndCell.minuteInterval = 15;
dateEndCell.minimumDate = start;
If there is another way to do this without modifying the XLForm code, let me know. If this feature isn't currently supported and my solution seems acceptable to you, I can submit a pull request.
I'm wondering if it has the functionality to reorder the row in a table view, Or you have any plans to do it in near future?
I'm using
row = [XLFormRowDescriptor formRowDescriptorWithTag:kDateInline rowType:XLFormRowDescriptorTypeDateInline title:@"Date"];
row.value = [NSDate new];
[section addFormRow:row];
On touch text color changing, but cell doesn't expand and DatePicker doesn't appear
This library looks fantastic so far but I'm having trouble figuring out how to add a form to an existing application. The flow I want is user taps a control -> Form is displayed in a Modal dialog with the cancel and done buttons displayed. Since the segue from the main screen to the form dialog is defined in the storyboard, there is no 'hook' where I can manually inititalize the NavigationController class. The 'init' methods of the controller classes never get called when using a storyboard, so how do I set up my form?
We use US2FormValidator internally and have built a number of add-on validations/conditions beyond the framework's extensive built-in options. I highly recommend it as a means of effectively extending XLForm's validation capabilities without a lot of labor.
the -(void)configureDataManager:(XLFormDataManager *)dataManager; declared in XLFormViewControllerDelegate is optional but no test is made to ensure it exists...
Results in a crash.
Eg: XLFormViewController line 591
Would like to receive a callback (same as cancel or save buttons) to manually delete my object, without using data manager and network calls; is that possible?
First of all, I'd like to thank you for this wonderful library. Great work 👍
Now about the issue:
Let's say I have a text field cell. Unless the focus moves away from the text field (ie: the keyboard has been dismissed or the user went to the next text field), [[self.form formRowWithTag:@"title"] value]
returns nil
regardless of the contents of the text field. That would be wrong if the text field's text is not empty. So consider this scenario:
At this point, there is a problem because the value of the text field is nil
even though it shouldn't be.
If i click on datetime field then the picker shown to me at the bottom of the screen is transparent if i click on any textfield and then go back to any pickerview related field then it's background color changed from transparent to white.
I Upgraded to 2.0 version and image cell dissapeared...
I am trying to implement an inline map view with XLForm like in the following screenshot:
But for some reason I can't use the XLFormRowDescriptorTypeSelectorPickerViewInline mode to implement the map inline. There's isn't even an autocompletion for it. Was it removed? Why? I need it here ... thank you for any help. Great framework apart from that! Love it. :)
It'd be nice to be able to apply autoformatters to text fields.
For example, if I'm typing a phone number, i want 1234567890 to automatically become (123)456-7890.
Or in field with mm/yy have 0119 automatically become 01/19
Hi,
I would like to set a Done button in an UITextField.
I tried this:
let row = XLFormRowDescriptor(tag : name, rowType : type)
row.cellConfigAtConfigure.setObject(placeholder, forKey: "textField.placeholder")
row.cellConfigAtConfigure.setObject(UIReturnKeyType.Done.toRaw(), forKey: "textField.returnKeyType")
row.required = !optional
But the XLForm SIGABRT in XLFormRowDescriptor at line 69 in cellForFormController
method:
[_cell setValue:value forKeyPath:keyPath];
XLForm seems to be a great library. I'm not able to use it because RestKit requires AFNetworking 1.3.0 and XLForm minimal 2. Is it possible to support the older AFNetworking version, or a subversion of XLForms without the XLDataLoader?
I upgraded from 1.0.1 to 2.0.0 and "Delete" button dissapeared.
[self setShowDeleteButton:YES]; is not working?
Whats the current way to manage the dissapeared feature?
Currently the text view has a fixed size.
It would be helpful to allow the view to resize when the content changes.
Run the demo, select the calendaring event item (first one). Click "starts" and then click the row again to hide. Click the cancel button. Click "Text Field Examples" in the main screen. It will crash all the time in the simulator. Both 32 and 64 bits iOS 7.1
- (void)update
{
...
self.textView.editable = !self.rowDescriptor.disabled;
...
}
I've played around with this library, and must say it's saved me hours! So, thank you for building this.
I was trying to create a combo-box that allows user to select one of the 50 US states. However, from what I could gather, it seems XLForm does not support a combo-box. Is it something that you can add soon? If not, can you please give me some pointers as to how to implement this on my own?
Thanks!
Just wanted to say thanks for the library - saved me hours this weekend. I only just realised how recently you released it, so I thought I'd pop in and let you know that I'm using it and it worked really well.
The only issue I've had is with the label for a selector field not updating, but I'll create a proper issue at some point with more details.
Cheers!
I'm using segues on my project. Navigation is performed using code like
[self performSegueWithIdentifier:@"editData" sender:self];
And the data to be edited is asigned to destination view controller on the prepareForSegue
method
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"editWorkerProfile"])
{
UINavigationController* navController = [segue destinationViewController];
MyEditorViewController *editorController = (MyEditorViewController *) [navController topViewController];
editorController.data = dataToBeEdited;
}
}
The destination ViewController is initialized using "initWithCoder" and form structure is created on the "viewDidLoad" (Because data property is assigned after initialization).
With te "1.0.0" version of XLForm I used a "trick" like this on destination ViewController:
- (id)initWithCoder:(NSCoder*)aDecoder
{
if(self = [super initWithCoder:aDecoder])
{
XLFormDescriptor * form = [XLFormDescriptor formDescriptorWithTitle:@"work profile"];
return [super initWithForm:form]; // Second init... it works with XLFrom 1.0.0!!!
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Form content is built after initialization
[self buildForm: self.form withData: self.data];
}
With the actual git XLForm version this code is not working anymore: form appears empty...
¿What's the correct way to use XLForm with storyboard & segues?
What's the rationale behind having such a tiny font size for the title and text labels?
I don't know about you but that's basically the only thing that your calendar add event example differs in when compared to the original screen.
Why isn't UIFontTextStyleBody
the default value in XLFormDescriptorCell -update methods on your cells instead of UIFontTextStyleHeadline
? Should drop the "Bold" trait as well in order to reproduce iOS defaults.
Am I missing something?
Hi there...
Custom rows and step counter are really nice features that solve manually "patches" I actually use over 1.0.0 version... is there any plan to publish as pod a new version?
Thanks a lot
I'd like a custom row type added. An object would be provided that could modify the title, provide a textual value for a label or a UIView for the label (given a frame) and then perform an editing operation. Perhaps even validation.
This would obviously allow a developer to implement any type of data input method. You could do an image picker, address picker, etc.
If you are really ambitious, you could implement all existing types as subclasses of this object. I see you have XLFormSwitchCell as a base class, which would be a good start. Then the constants like XLFormRowDescriptorTypeText would just be singletons. Validation would be somewhat easier, since each class could do it's own and users could subclass a text field, say, to do custom validation.
You could, of course, have a list of XLFormValidator objects that are passed to each cell, I guess. You'd need types like XLFormRowDescriptorTypeText to be properties that returned a new instance, then, so the user could easily add validators to various cells.
I hope this makes sense. If you are open to this, I'd be open to helping code this solution.
I've been using this custom cell for my own project. Wondering if you like to add it as a cell. it basically a subclass of UIStepper but with current value counter.
Here a example project:
https://github.com/shams-ahmed/SAStepperControl
Great library. Is it possible to select multiple option using Selector?
Looks like a typo or refactor error with the late merge?
hi martin,
i want to use xlform in my ios app.
this is very easy & helpful to draw complex form.
but when i run the demo.
the text input cannot input chinese.
is there have setting to set this?
thasnk~~
Hi,
I created an XLFormRowDescriptorTypeSelectorPush row and added options.
How do I programatically set a selected option?
Thanks for your help
Hi,
Image Picker disappeared in V2.0.
Any plan to bring it back?
Regards
Perhaps shorter text fields for things like city and state and zip, or for an expiration date and cvc code. That would be cool.
@mtnbarreto
Is there a way to change the section title font and style the text to be Sentence case instead of all caps?
Probably need to use a UIPopoverController. While you are at it, maybe add a UIPopoverController row selector.
Any way to deselect the table row once a button is pressed. When I press a button, I need to check some other table rows and may not launch a view controller. In that case I open an alert but must also clear the ‘press’ / ‘selected’ state and can’t see how to.
Thx
Is there any way to dynamically update the value of a row? I have a project where the data for my form is coming from an asynchronous call which prevents me from simply setting the value of each row during the form creation. My initial thought was to lookup each row by tag after I get my data and set row.value to the appropriate model value. As far as I can tell though, changing 'row.value' doesn't actually update the text in the cell. Is there something I'm missing here or is there simply no way to do this right now?
@mtnbarreto Is there a way to set the entire form to be in Readonly mode, with an Edit button (instead of Done)? Clicking this button enables the form's Edit mode and all fields become editable.
Hi,
First of all, I would like to warmly thanks those which created/contributed to this amazing library !
For my needs, I would like to handle when a user click on a row from the UIPickerView displayed by cell of type XLFormRowDescriptorTypeSelectorPickerViewInline.
After some research of the functioning of the XLFormInlineSelectorCell
classe I didn't find any mechanism to allow me to handle the click event of a user on a value inside the UIPickerView.
My question is, should I create a subclass of XLFormInlineSelectorCell
and override the update method to send an event to my main viewcontroller or call a delegate method to my main viewcontroller or is there a better way of doing this ?
Thanks !
If i have button type cell with no buttonViewController set, should the cell default to formRowDescriptorValueHasChanged?
Right now the behavior is present view controller, but if you like to do something that doesn't require another controller how would i get notified. I've tried to use KVO but no such luck.
Thinking of setting self.rowDescriptor.value = nil if buttonViewController not present, but is that there corrent way forward?
I have a "long" form with one row descriptor marked as required
. The row cell is out of visible area.
If I call [self formValidationErrors]
after loading, result is an empty array.
If I scroll down until the required row cell is visible and I call [self formValidationErrors]
, result is the array with the expected NSError object
How to increase font size and cell size for iPad? in iPad it is looking so small fonts and small row height.
Hi,
I'm new with XLForm. I'm trying to use constant XLFormRowDescriptorTypeSelectorPickerView but I have a compiler error:
Undefined symbols for architecture x86_64:
"_XLFormRowDescriptorTypeSelectorPickerView", referenced from:
_TFC12TrocaTudo30NovaOfertaXLFormViewController13initalizeFormfS0_FT_T in NovaOfertaXLFormViewController.o
ld: symbol(s) not found for architecture x86_64
I have put the imports above in my Bridging-Header.h:
The xCode autocomplete is working fine and all the XLForm's classes are being recognized.
Any tip?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.