xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.78k stars 1.33k forks source link

Eureka not working for Swift 5 | Xcode #2214

Closed cjwhitaker closed 2 years ago

cjwhitaker commented 2 years ago

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?? It's like it's not recognizing that it's proper Eureka formatting. It says in my build settings that I'm using Swift 5.

mats-claassen commented 2 years ago

Maybe you have a different class named Section and the compiler is taking that one. Try prepending Eureka's Section with Eureka.:

form +++ Eureka.Section("About You")
                <<< TextRow() { row in
                    row.title = "Name"
                    row.placeholder = "Your Name"
                }

It could also be one of the other classes like TextRow

cjwhitaker commented 2 years ago

This worked, thank you!