Code Monkey home page Code Monkey logo

khaform's People

Contributors

alexsteinerde avatar jonathanlu2393 avatar koheihayakawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

khaform's Issues

Selection and NavBar

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?

KHASelectionFormViewController and cell's checkmark

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

Date Cell

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?

selection list

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?

crash

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.