Hello,
I tested the tutorial about searchbar in table view (Candy search : UISearchController Tutorial: Getting Started)
I would know how to add a titleForHeaderInSection for classify by alphabitcal order the candies ?
titleForHeaderInSection = C
name: Chocolate Bar and category : chocolate.
titleForHeaderInSection = D
name: Dark Chocolate and category : Chocolate.
etc.
I have a table view with struct like this :
`struct Lexiquefrsa {
let sectionLetter : String!
let sectionFRSAfr : [String]!
let sectionFRSAsa : [String]!
}
var lexiquefrsaArray = [Lexiquefrsa]()
and in my super.viewDidLoad() :
lexiquefrsaArray = [
Lexiquefrsa(sectionLetter: "A", sectionFRSAfr: ["aa, "ab",... ], sectionFRSAsa: ["aa", "ab", ... ]),
Lexiquefrsa(sectionLetter: "B", sectionFRSAfr: ["ba", "bb", ... ], sectionFRSAsa: ["ba", "bb", ... ]), ... etc.
I tried several solutions but can not find the right method …
Can you help me ?