Eureka 不支持 Swift 5 |斯威夫特/Xcode

发布于 2025-01-16 01:40:40 字数 1971 浏览 5 评论 0原文

我必须从用户那里收集三个不同部分的数据。我决定使用第三方 Pod,而不是自己构建所有表单并花费很长时间。我发现Eureka被大量使用。由于某种原因,无论我遵循什么教程,它都不适合我。

这是我的 Podfile:

# 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

我在这里做错了什么?尤里卡已经过时了吗?就像它没有识别出它是正确的尤里卡格式一样。是否有更好的表单生成器允许我使用带有文本字段和内部日期选择器的可扩展/可折叠部分?

I've got to gather three different sections of data from users. Instead of building all the forms myself and it taking forever, I decided to use a third party pod. I found that Eureka is largely used. For some reason, it WILL NOT work for me, no matter what tutorial I follow.

Here is my Podfile:

# 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

It says I installed the pod successfully. Inside my project, I try to run this code:

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()
    }
    
}

but I'm getting the following error:

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

for this line of code:

form +++ Section("About You")

and this error:

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

for this line of code:

<<< TextRow() { row in

What am I doing wrong here?? Is Eureka outdated? It's like it's not recognizing that it's proper Eureka formatting. Is there a better form builder that will allow me to use expandable/collapsable sections with textfields and a date picker inside?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬心 2025-01-23 01:40:41

Eureka Swift 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
            }
        }

Eureka Swift 5 fix: Add Eureka. before Section

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
            }
        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文