Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift Eureka ios:如何通过if声明更改0.5美元的期权_Swift_Eureka Forms - Fatal编程技术网

Swift Eureka ios:如何通过if声明更改0.5美元的期权

Swift Eureka ios:如何通过if声明更改0.5美元的期权,swift,eureka-forms,Swift,Eureka Forms,我需要根据用户选择的另一行更改一行的选项 我使用这个代码,它没有改变 <<< PushRow<String>(kEncryption) { $0.title = "Encryption" if let r1 : PushRow<aType> = form.rowBy(tag: kProxyFormType), let a = r1.value?.isA, let b = r1.value?.

我需要根据用户选择的另一行更改一行的选项

我使用这个代码,它没有改变

<<< PushRow<String>(kEncryption) {
                $0.title = "Encryption"
                if let r1 : PushRow<aType> = form.rowBy(tag: kProxyFormType), let a = r1.value?.isA, let b = r1.value?.isB {
                        print(a)
                        if (a) {
                            $0.options = ["1","2","3"]
                        }
                        else if (b) {
                            $0.options = ["4","5","6"]
                        }
                    }

反过来,在
PushRow
onChange
关闭中更改
PushRow
的选项,类似于

<<< PushRow<aType>(kProxyFormType) { 
   ...
}.onChange { row in 
    if let encryptionRow = self.form.rowBy(tag: kEncryption) as? PushRow<String> {
       if row.value?.isA {
           encryptionRow.options = ["1","2","3"]
       } else if row.value?.isB {
           encryptionRow.options = ["4","5","6"]
       }
    }
}

反过来,在
PushRow
onChange
关闭中更改
PushRow
的选项,类似于

<<< PushRow<aType>(kProxyFormType) { 
   ...
}.onChange { row in 
    if let encryptionRow = self.form.rowBy(tag: kEncryption) as? PushRow<String> {
       if row.value?.isA {
           encryptionRow.options = ["1","2","3"]
       } else if row.value?.isB {
           encryptionRow.options = ["4","5","6"]
       }
    }
}