Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ra1028/Former
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymona82 committed Dec 19, 2018
2 parents 289a9e0 + 0d5dd47 commit fa3991f
Show file tree
Hide file tree
Showing 22 changed files with 211 additions and 82 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.2
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Contributing
If you're interesting in helping us improve and maintain Former, it is highly encouraged that you fork the repository and submit a pull request with your updates.

If you do chose to submit a pull request, please make sure to clearly document what changes you have made in the description of the PR.

We will try to get this merged as soon as possible and included in an official cocoapod release as soon as it makes sense to do so.
4 changes: 2 additions & 2 deletions Former-Demo/Former-Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.Former-Demo";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
Expand All @@ -475,7 +475,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.ryo.Former-Demo";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions Former-Demo/Former-Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let navigationController = UINavigationController(rootViewController: TopViewContoller())
configureNavigationBar(navigationBar: navigationController.navigationBar)
Expand All @@ -25,8 +25,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private func configureNavigationBar(navigationBar: UINavigationBar) {
navigationBar.tintColor = .white
navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.white,
NSAttributedStringKey.font: UIFont.boldSystemFont(ofSize: 20)
NSAttributedString.Key.foregroundColor: UIColor.white,
NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 20)
]
navigationBar.isTranslucent = false
navigationBar.shadowImage = UIImage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ final class AddEventViewController: FormViewController {
$0.datePicker.datePickerMode = .dateAndTime
}.displayTextFromDate(String.mediumDateShortTime)
let endRow = InlineDatePickerRowFormer<FormInlineDatePickerCell>() {
$0.titleLabel.text = "Start"
$0.titleLabel.text = "End"
$0.titleLabel.textColor = .formerColor()
$0.titleLabel.font = .boldSystemFont(ofSize: 15)
$0.displayLabel.textColor = .formerSubColor()
Expand Down Expand Up @@ -125,7 +125,7 @@ final class AddEventViewController: FormViewController {
let never = Repeat.Never
$0.pickerItems.append(
InlinePickerItem(title: never.title(),
displayTitle: NSAttributedString(string: never.title(), attributes: [NSAttributedStringKey.foregroundColor: UIColor.lightGray]),
displayTitle: NSAttributedString(string: never.title(), attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray]),
value: never)
)
$0.pickerItems += Repeat.values().map {
Expand All @@ -142,7 +142,7 @@ final class AddEventViewController: FormViewController {
let none = Alert.None
$0.pickerItems.append(
InlinePickerItem(title: none.title(),
displayTitle: NSAttributedString(string: none.title(), attributes: [NSAttributedStringKey.foregroundColor: UIColor.lightGray]),
displayTitle: NSAttributedString(string: none.title(), attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray]),
value: none)
)
$0.pickerItems += Alert.values().map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class CustomCellViewController: FormViewController {
$0.body = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
$0.bodyColor = colors[0]
}.configure {
$0.rowHeight = UITableViewAutomaticDimension
$0.rowHeight = UITableView.automaticDimension
}

let colorListRow = CustomRowFormer<ColorListCell>(instantiateType: .Nib(nibName: "ColorListCell")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ final class DefaultsViewController: FormViewController {
$0.titleLabel.text = "Segmented"
}.configure {
$0.segmentTitles = ["Opt1", "Opt2", "Opt3"]
$0.selectedIndex = UISegmentedControlNoSegment
$0.selectedIndex = UISegmentedControl.noSegment
}

let sliderRow = SliderRowFormer<FormSliderCell>(){
Expand Down
24 changes: 12 additions & 12 deletions Former-Demo/Former-Demo/Controllers/ExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import UIKit
import Former

private extension UITableViewRowAnimation {
private extension UITableView.RowAnimation {

static func names() -> [String] {
return ["None", "Fade", "Right", "Left", "Top", "Bottom", "Middle", "Automatic"]
}

static func all() -> [UITableViewRowAnimation] {
static func all() -> [UITableView.RowAnimation] {
return [.none, .fade, .right, .left, .top, .bottom, .middle, .automatic]
}
}
Expand Down Expand Up @@ -96,17 +96,17 @@ final class ExampleViewController: FormViewController {
self?.insertRowPosition = InsertPosition(rawValue: index)!
}

let insertRowAnimationRow = InlinePickerRowFormer<FormInlinePickerCell, UITableViewRowAnimation>(instantiateType: .Class) {
let insertRowAnimationRow = InlinePickerRowFormer<FormInlinePickerCell, UITableView.RowAnimation>(instantiateType: .Class) {
$0.titleLabel.text = "Animation"
$0.titleLabel.textColor = .formerColor()
$0.titleLabel.font = .boldSystemFont(ofSize: 16)
$0.displayLabel.textColor = .formerSubColor()
$0.displayLabel.font = .boldSystemFont(ofSize: 14)
}.configure {
$0.pickerItems = UITableViewRowAnimation.names().enumerated().map {
InlinePickerItem(title: $0.element, value: UITableViewRowAnimation.all()[$0.offset])
$0.pickerItems = UITableView.RowAnimation.names().enumerated().map {
InlinePickerItem(title: $0.element, value: UITableView.RowAnimation.all()[$0.offset])
}
$0.selectedRow = UITableViewRowAnimation.all().index(of: insertRowAnimation) ?? 0
$0.selectedRow = UITableView.RowAnimation.all().index(of: insertRowAnimation) ?? 0
$0.displayEditingColor = .formerHighlightedSubColor()
}.onValueChanged { [weak self] in
self?.insertRowAnimation = $0.value!
Expand Down Expand Up @@ -137,17 +137,17 @@ final class ExampleViewController: FormViewController {
self?.insertSectionPosition = InsertPosition(rawValue: index)!
}

let insertSectionAnimationRow = InlinePickerRowFormer<FormInlinePickerCell, UITableViewRowAnimation>(instantiateType: .Class) {
let insertSectionAnimationRow = InlinePickerRowFormer<FormInlinePickerCell, UITableView.RowAnimation>(instantiateType: .Class) {
$0.titleLabel.text = "Animation"
$0.titleLabel.textColor = .formerColor()
$0.titleLabel.font = .boldSystemFont(ofSize: 16)
$0.displayLabel.textColor = .formerSubColor()
$0.displayLabel.font = .boldSystemFont(ofSize: 14)
}.configure {
$0.pickerItems = UITableViewRowAnimation.names().enumerated().map {
InlinePickerItem(title: $0.element, value: UITableViewRowAnimation.all()[$0.offset])
$0.pickerItems = UITableView.RowAnimation.names().enumerated().map {
InlinePickerItem(title: $0.element, value: UITableView.RowAnimation.all()[$0.offset])
}
$0.selectedRow = UITableViewRowAnimation.all().index(of: insertSectionAnimation) ?? 0
$0.selectedRow = UITableView.RowAnimation.all().index(of: insertSectionAnimation) ?? 0
$0.displayEditingColor = .formerHighlightedSubColor()
}.onValueChanged { [weak self] in
self?.insertSectionAnimation = $0.value!
Expand Down Expand Up @@ -263,8 +263,8 @@ final class ExampleViewController: FormViewController {
case Below, Above
}

private var insertRowAnimation = UITableViewRowAnimation.left
private var insertSectionAnimation = UITableViewRowAnimation.fade
private var insertRowAnimation = UITableView.RowAnimation.left
private var insertSectionAnimation = UITableView.RowAnimation.fade
private var insertRowPosition: InsertPosition = .Below
private var insertSectionPosition: InsertPosition = .Below

Expand Down
4 changes: 2 additions & 2 deletions Former-Demo/Former-Demo/Views/FormerInputAccessoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ final class FormerInputAccessoryView: UIToolbar {
isUserInteractionEnabled = true

let flexible = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let leftArrow = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem(rawValue: 105)!, target: self, action: #selector(FormerInputAccessoryView.handleBackButton))
let leftArrow = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem(rawValue: 105)!, target: self, action: #selector(FormerInputAccessoryView.handleBackButton))
let space = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
space.width = 20
let rightArrow = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem(rawValue: 106)!, target: self, action: #selector(FormerInputAccessoryView.handleForwardButton))
let rightArrow = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem(rawValue: 106)!, target: self, action: #selector(FormerInputAccessoryView.handleForwardButton))
let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(FormerInputAccessoryView.handleDoneButton))
let rightSpace = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil)
setItems([leftArrow, space, rightArrow, flexible, doneButton, rightSpace], animated: false)
Expand Down
2 changes: 1 addition & 1 deletion Former.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Former"
spec.version = "1.6.1"
spec.version = "1.7.0"
spec.author = { "ra1028" => "[email protected]" }
spec.homepage = "https://github.com/ra1028"
spec.summary = "Former is a fully customizable Swift library for easy creating UITableView based form."
Expand Down
4 changes: 2 additions & 2 deletions Former.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Former;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -494,7 +494,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Former;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Former/Cells/FormCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open class FormCell: UITableViewCell, FormableRow {
setup()
}

override public init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setup()
}
Expand Down
2 changes: 1 addition & 1 deletion Former/Cells/FormTextFieldCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ open class FormTextFieldCell: FormCell, TextFieldFormableRow {
super.setup()

let titleLabel = UILabel()
titleLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 500), for: UILayoutConstraintAxis.horizontal)
titleLabel.setContentHuggingPriority(UILayoutPriority(rawValue: 500), for: NSLayoutConstraint.Axis.horizontal)
titleLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 1000), for: .horizontal)
titleLabel.translatesAutoresizingMaskIntoConstraints = false
contentView.insertSubview(titleLabel, at: 0)
Expand Down
Loading

0 comments on commit fa3991f

Please sign in to comment.