Skip to content

Commit

Permalink
Updated to version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Apr 2, 2014
1 parent 263e813 commit 5a3ee67
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions FXForms.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = 'FXForms'
s.version = '1.1'
s.version = '1.1.1'
s.license = 'zlib'
s.summary = 'FXForms is an Objective-C library for easily creating table-based forms on iOS. It is ideal for settings pages or user data entry tasks.'
s.homepage = 'https://github.com/nicklockwood/FXForms'
s.authors = 'Nick Lockwood'
s.source = { :git => "https://github.com/nicklockwood/FXForms.git", :tag => "1.1" }
s.source = { :git => "https://github.com/nicklockwood/FXForms.git", :tag => "1.1.1" }
s.source_files = 'FXForms'
s.requires_arc = true
s.ios.deployment_target = '5.0'
Expand Down
2 changes: 1 addition & 1 deletion FXForms/FXForms.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FXForms.h
//
// Version 1.1
// Version 1.1.1
//
// Created by Nick Lockwood on 13/02/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
Expand Down
27 changes: 12 additions & 15 deletions FXForms/FXForms.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FXForms.m
//
// Version 1.1
// Version 1.1.1
//
// Created by Nick Lockwood on 13/02/2014.
// Copyright (c) 2014 Charcoal Design. All rights reserved.
Expand Down Expand Up @@ -488,7 +488,7 @@ - (instancetype)initWithForm:(id<FXForm>)form controller:(FXFormController *)for
- (BOOL)isIndexedType
{
//return YES if value should be set as index of option, not value of option
if ([@[FXFormFieldTypeInteger, FXFormFieldTypeNumber] containsObject:self.type])
if ([self.valueClass isSubclassOfClass:[NSNumber class]])
{
return ![[self.options firstObject] isKindOfClass:[NSNumber class]];
}
Expand Down Expand Up @@ -2376,13 +2376,11 @@ - (void)setUp
self.pickerView.delegate = self;
}

- (BOOL)canBecomeFirstResponder
{
return YES;
}

- (BOOL)becomeFirstResponder
- (void)update
{
self.textLabel.text = self.field.title;
self.detailTextLabel.text = [self.field fieldDescription] ?: [self.field.placeholder fieldDescription];

NSUInteger index = self.field.value? [self.field.options indexOfObject:self.field.value]: NSNotFound;
if (self.field.placeholder)
{
Expand All @@ -2393,7 +2391,12 @@ - (BOOL)becomeFirstResponder
[self.pickerView selectRow:index inComponent:0 animated:NO];
}

return [super becomeFirstResponder];
[self setNeedsLayout];
}

- (BOOL)canBecomeFirstResponder
{
return YES;
}

- (UIView *)inputView
Expand All @@ -2407,9 +2410,6 @@ - (void)didSelectWithTableView:(UITableView *)tableView controller:(__unused UIV
[tableView selectRowAtIndexPath:nil animated:YES scrollPosition:UITableViewScrollPositionNone];
}

#pragma mark -
#pragma mark UIPickerViewDataSource

- (NSInteger)numberOfComponentsInPickerView:(__unused UIPickerView *)pickerView
{
return 1;
Expand All @@ -2420,9 +2420,6 @@ - (NSInteger)pickerView:(__unused UIPickerView *)pickerView numberOfRowsInCompon
return [self.field.options count] + (self.field.placeholder? 1: 0);
}

#pragma mark -
#pragma mark UIPickerViewDelegate

- (NSString *)pickerView:(__unused UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(__unused NSInteger)component
{
if (row == 0)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FXForms

version 1.1, March 28th, 2014
version 1.1.1, April 2nd, 2014

Copyright (C) 2014 Charcoal Design

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ Once you have created your custom cell, you can use it as follows:
Release notes
--------------

Version 1.1.1

- Fixed bug with indexed options fields
- FXFormOptionPickerCell selected index is now set correctly when tabbing between fields

Version 1.1

- Added support for multi-select option fields - just use a collection type such NSArray, NSSet or NSIndexSet for your options field
Expand Down

0 comments on commit 5a3ee67

Please sign in to comment.