Eureka 无法与Swift 5配合使用|Swift/Xcode公司

e0bqpujr  于 2022-11-18  发布在  Swift
关注(0)|答案(1)|浏览(177)

我必须从用户那里收集三个不同部分的数据。我决定使用第三方pod,而不是自己构建所有的表单,这会花很长时间。我发现Eureka 被大量使用。出于某种原因,它对我不起作用,无论我遵循什么教程。
这是我的播客文件:

# Uncomment the next line to define a global platform for your project
 platform :ios, '10.0'

target 'Pics2Report' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Pics2Report
pod 'IQKeyboardManagerSwift'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Storage'
  target 'Pics2ReportTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'Pics2ReportUITests' do
    # Pods for testing
  end

pod 'SCLAlertView'
pod 'HGPlaceholders'
pod 'FloatingPanel'
pod 'BEMCheckBox'
pod 'Eureka'

end

它说我成功地安装了pod。在我的项目中,我尝试运行以下代码:

import Foundation
import Eureka
import UIKit

class FileDetailsViewController: FormViewController {
        
        override func viewDidLoad() {
            super.viewDidLoad()
            
            form +++ Section("About You")
                <<< TextRow() { row in
                    row.title = "Name"
                    row.placeholder = "Your Name"
                }
        }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        //Lock screen into portrait mode
        AppUtility.lockOrientation(.portrait)
        self.hideKeyboardWhenTappedAround()
    }
    
}

但我得到以下错误:

Missing arguments for parameters 'options', 'isOpened' in call

对于这一行代码:

form +++ Section("About You")

和此错误:

Binary operator '<<<' cannot be applied to operands of type 'Section' and 'TextRow'

对于这一行代码:

<<< TextRow() { row in

我在这里做错了什么??Eureka 过时了吗?它好像没有意识到它是正确的Eureka格式。有没有更好的表单生成器,允许我使用带有文本字段和日期选择器的可展开/可折叠部分?

bn31dyow

bn31dyow1#

Eureka 斯威夫特5修复:在章节前添加Eureka .

form
    +++ Eureka.Section("mysection")
        <<< TextRow("myrow") {
            $0.title = "Title"
            $0.placeholder = "Placeholder"
            $0.value = "myvalue"
            $0.add(rule: RuleRequired())
            $0.validationOptions = .validatesOnChange
        }.cellUpdate { cell, row in
            if !row.isValid {
                cell.titleLabel?.textColor = .systemRed
            }
        }

相关问题