swiftformsprintingtableviewsegue

Build a tableview form and print in Swift 3


I am trying to build a form for a friend. I've tried doing tableviews, but doing so all the sub pages will have different info to fill in. So I wasn't sure if the best way to do this Is by building each page inside form different and not as a tableview. However way I go about this the print button only shows up once all pages have been filled

Questions I have:

  1. Is it difficult to print all three pages info from AirPrint?
  2. What is the best way to build this? Is it still tableviews?
  3. If not using route of tableviews how do I add up the empty text boxes to bring back a percentage bar?
  4. My first page I have set up is a tableview, if that is the way to do that how can I make a separate view for each row?

enter image description here

enter image description here


Solution

  • If you are looking to build a form I would suggest using the library found here: https://github.com/xmartlabs/Eureka. The library includes a lot of different types of fields and validations for different data types.

    In order to create an action from selecting a button you can use the onCellSelection callback like this:

     +++ Section()
                    <<< ButtonRow() {
                        $0.title = "Tap to force form validation"
                    }
                    .onCellSelection { cell, row in
                       
                       //Do something here once the row has been tapped
                    }