Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Former.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -472,7 +472,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -495,7 +495,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Former;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -514,7 +514,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Former;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
4 changes: 4 additions & 0 deletions Former/Cells/FormSelectorDatePickerCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ open class FormSelectorDatePickerCell: FormCell, SelectorDatePickerFormableRow {
open var selectorDatePicker: UIDatePicker?
open var selectorAccessoryView: UIView?

open override var canBecomeFirstResponder: Bool {
return true
}

public private(set) weak var titleLabel: UILabel!
public private(set) weak var displayLabel: UILabel!

Expand Down
4 changes: 4 additions & 0 deletions Former/Cells/FormSelectorPickerCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ open class FormSelectorPickerCell: FormCell, SelectorPickerFormableRow {
open var selectorPickerView: UIPickerView?
open var selectorAccessoryView: UIView?

open override var canBecomeFirstResponder: Bool {
return true
}

public private(set) weak var titleLabel: UILabel!
public private(set) weak var displayLabel: UILabel!

Expand Down
10 changes: 5 additions & 5 deletions Former/Commons/FormerProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

// MARK: Inline RowFormer

public protocol InlineForm: class {
public protocol InlineForm: AnyObject {

var inlineRowFormer: RowFormer { get }
func editingDidBegin()
Expand Down Expand Up @@ -39,7 +39,7 @@ extension ConfigurableInlineForm where Self: RowFormer {

// MARK: Selector RowFormer

public protocol SelectorForm: class {
public protocol SelectorForm: AnyObject {

func editingDidBegin()
func editingDidEnd()
Expand All @@ -64,7 +64,7 @@ extension UpdatableSelectorForm where Self: RowFormer {

public protocol Formable: SelectableForm, UpdatableForm, ConfigurableForm {}

public protocol SelectableForm: class {}
public protocol SelectableForm: AnyObject {}

public extension SelectableForm where Self: RowFormer {

Expand All @@ -77,7 +77,7 @@ public extension SelectableForm where Self: RowFormer {
}
}

public protocol UpdatableForm: class {}
public protocol UpdatableForm: AnyObject {}

public extension UpdatableForm where Self: RowFormer {

Expand All @@ -97,7 +97,7 @@ public extension UpdatableForm where Self: RowFormer {
}
}

public protocol ConfigurableForm: class {}
public protocol ConfigurableForm: AnyObject {}

public extension ConfigurableForm where Self: RowFormer {

Expand Down
2 changes: 1 addition & 1 deletion Former/Commons/RowFormer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import UIKit

public protocol FormableRow: class {
public protocol FormableRow: AnyObject {

func updateWithRowFormer(_ rowFormer: RowFormer)
}
Expand Down
2 changes: 1 addition & 1 deletion Former/Commons/ViewFormer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import UIKit

public protocol FormableView: class {
public protocol FormableView: AnyObject {

func updateWithViewFormer(_ viewFormer: ViewFormer)
}
Expand Down
4 changes: 3 additions & 1 deletion Former/RowFormers/PickerRowFormer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ open class PickerRowFormer<T: UITableViewCell, S>
cell.selectionStyle = .none

// UPDATES SELECTED ROW TO 0, IN CASE THE COUNT OF UPDATED PICKER ITEMS ARRAY IS LESS THAN PRIOR ARRAY
self.selectedRow = 0
if pickerItems.count <= selectedRow {
selectedRow = 0
}

// RELOADS PICKER VIEW TO UPDATE ITEMS IN INLINE PICKER
let picker = cell.formPickerView()
Expand Down