koheihayakawa / khaform Goto Github PK
View Code? Open in Web Editor NEWSimple tableview form in swift
License: MIT License
Simple tableview form in swift
License: MIT License
datePickerCell.datePicker.minuteInterval = 30 doesn't change anything. It will set the value, but the UI doesnt change.
Hello,
I'm facing a scenario in which I don't have a navigation bar visible, but the Selection cell does.
In KHASelectionFormViewController.swift i made some changes:
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(true)
self.navigationController?.navigationBarHidden = true
}
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBarHidden = false
tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: cellID)
tableView.reloadData()
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.tableView.scrollToRowAtIndexPath(NSIndexPath(forRow: self.selectedIndex, inSection: 0), atScrollPosition: .Middle, animated: false)
})
}
in order to preserver the backbutton of Selection view controller and hide the nav bar when I'm back outside of the Selection.
Is it possible to implement such a mechanism using a flag on selection cell? May be something like:
cell.parentHasHiddenNavBar = true
in order to hide the parent nav bar only when the flag is true?
What do you think?
at line 51 you have if selectedIndex == indexPath.row {
it should be
if selectedIndex == indexPath.row {
cell.accessoryType = .Checkmark
} else {
cell.accessoryType = .None
}
because if you have a tableview with several cells, the checkmark will be showed "randomly" because of the reuse of cell.
Addition: if we have a selected index, moving the tableview for showing the selected row would be perfect! http://stackoverflow.com/questions/5856427/how-to-scroll-uitableview-to-specific-position
Hello, I would to thank you of the selection cell type to have implemented.
I've something to point out about the date cell. The current type should be named "DateTime", and a new cell "Date" should be implemented. Suppose we have to make a birthday field in the form, the time is useless, just to make the user to select the date is the best practice. Do you agree?
Hi, you control is very helpful but is missing a thing.
A sort of picker or selection list for custom elements.
(i.e.: If I want to select a country from a very large list > 100 items, it would be helpful to use a new cell type, that prompt a new table from which the user selects an element)
what do you think about it?
I'm addressing a strange issue with the selection cell.
Here is the code
http://pastebin.com/L2q48jpM
It crashes on line 117 with "fatal error: Array index out of range"
let country = countryCell.selections[countryCell.selectedIndex]
I'm trying to debug countryCell object.
selections = 0 values {}
selectedIndex = 0
It seems the cell losts references. However, it happens ONLY when I change the default date for the date cell picker. I'll try to help you to find out what the problem is and probably to fix it.
(KHAForm.KHAFormCell) countryCell = 0x00000001519e37e0 {
UIKit.UITableViewCell = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
button = 0x00000001519e3b80 {
UIKit.UIControl = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
}
date = 0x000000017020c6c0 2015-05-13 14:49:09 UTC
dateFormatter = 0x0000000170a5b750 {
Foundation.NSFormatter = {
ObjectiveC.NSObject = {}
}
}
datePickerMode = DateAndTime
datePicker = 0x00000001519e3da0 {
UIKit.UIControl = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
}
segmentedControl = 0x00000001519e43a0 {
UIKit.UIControl = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
}
sswitch = 0x00000001519e4520 {
UIKit.UIControl = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
}
textField = 0x00000001519e52d0 {
UIKit.UIControl = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
}
textView = 0x000000014e806e00 {
UIKit.UITextView = {
UIKit.UIScrollView = {
UIKit.UIView = {
UIKit.UIResponder = {
ObjectiveC.NSObject = {}
}
}
}
}
placeholderLabel.storage = nil
placeholderColor = 0x0000000174e47fe0 {
ObjectiveC.NSObject = {}
}
placeholder = 0x00000001977d4350 ""
}
selections = 0 values {}
selectedIndex = 0
}
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.