خرید بک لینک

Vote count: 0

I'm struggling to extract the exact value form a Eureka Form. Below is my source code thus far:

    class CommunityReportViewController: FormViewController, MFMailComposeViewControllerDelegate{

        @IBOutlet weak var activityIndicator: UIActivityIndicatorView!
        var userTitleChoice: String = ""
        var userCategoryChoice : String = ""
        var userDescriptionChoice: String = ""



        @IBOutlet weak var submitReport: UIButton!



        override func viewDidLoad() {
            super.viewDidLoad()
            form +++ Section("Feedback Type")
                <<< SegmentedRow<String>("feedbackType"){
                    $0.options = ["Comments", "Bug Reports", "Questions"]
                    $0.value = "Comments"
                    }.onChange{ row in
                        let userDefault = NSUserDefaults.standardUserDefaults()
                        userDefault.setValue(row.value, forKey: "feedbackType")
                }

                +++ Section("Follow up?")
                <<< ActionSheetRow<String>("officeLocation"){
                    $0.title = "Where are you?"
                    $0.selectorTitle = "Please select the office you are located in"
                    $0.options = ["Singapore", "Prague", "New Jersey"]

                }
                +++ Section("Best time to contact you?")

                <<< PopoverSelectorRow<String>("preferredMethod"){
                    $0.title = "Preferred Method"
                    $0.options = ["Phone", "Email", "Do Not Contact"]

                }
                <<< DateRow("preferredDate"){
                    $0.title = "Preferred date"

                }
                <<< TimeInlineRow("preferredTime"){
                    $0.title = "Preferred time"
                    $0.noValueDisplayText = "-:--"

                }




                <<< ButtonRow() {
                $0.title = "Submit Feedback!"
                $0.onCellSelection(self.buttonTapped)
                }



        }

    func buttonTapped(cell: ButtonCellOf<String>, row: ButtonRow) {
        let valuesDictionary = form.values(includeHidden:true)
        print (valuesDictionary["feedbackType"], "Feedback")
        print (valuesDictionary["officeLocation"], "Office")
        print (valuesDictionary["preferredTime"], "Time")
        print (valuesDictionary["preferredMethod"], "Method")
        print (valuesDictionary["preferredDate"], "Date")
}
}

The valuesDictionary retued result retued as below when no input is provided:

Optional(Optional("Comments")) Feedback
Optional(nil) Office
Optional(nil) Time
Optional(nil) Method
Optional(nil) Date

When correct inputs are provided , the following result is retued :

Optional(Optional("Comments")) Feedback
Optional(Optional("New Jersey")) Office
Optional(Optional(2016-07-08 10:00:23 +0000)) Time
Optional(Optional("Email")) Method
Optional(Optional(2016-07-11 07:00:16 +0000)) Date

Is there a way to retued only the values that is selected by the user? Because the retued results are difficult to parse. Example I only want the following results retued

Comments
New Jersey
2016-07-08 10:00:23 +0000
2016-07-11 07:00:16 +0000

asked 33 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 18 تير 1395 ساعت: 14:20

صفحه بندی