SettingsView
class SettingsView : UIView, UITableViewDelegate, UITableViewDataSource, MFMailComposeViewControllerDelegate
This a Setting View
-
This is a
tableView
to display the setting contents as cellDeclaration
Swift
@IBOutlet var tableView: UITableView!
-
This is background View
Declaration
Swift
@IBOutlet var backgroundView: UIButton!
-
This is a
NSLayoutConstraint
for the bottom constraintDeclaration
Swift
@IBOutlet var tableViewBottomConstraint: NSLayoutConstraint!
-
This is a variable for delegates
Declaration
Swift
var delegate: SettingsViewControllerDelegate?
-
The items on setting view
Declaration
Swift
let items: [String]
-
Show Login
Declaration
Swift
var showLogin: (() -> Void)
-
Customise the view
Declaration
Swift
func customisation()
-
Hide setting View
Declaration
Swift
@IBAction func hideSettingsView(_: Any)
-
Tells the items to return the number of rows in a given section of a table view.
Declaration
Swift
func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int
Parameters
tableView
The table-view object requesting this information.
indexPath
An index number identifying a section in tableView.
Return Value
The number of rows in section.
-
Asks the list of
Centent
for a cell to insert in a particular location of the table view.Declaration
Swift
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
Parameters
tableView
A table-view object requesting the cell.
indexPath
An index path locating a row in tableView.
Return Value
An object inheriting from
UITableViewCel
l that the table view can use for the specified row.UIKit
raises an assertion if you return nil. -
Tells the delegate that the specified row is now selected.
Declaration
Swift
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
Parameters
tableView
A table-view object informing the delegate about the new row selection.
indexPath
An index path locating the new selected row in tableView.
-
Tells the delegate that the user wants to dismiss the mail composition view.
Declaration
Swift
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith _: MFMailComposeResult, error _: Error?)
Parameters
controller
The view controller object that manages the mail composition view.
didFinishWith
The result of the user’s action.
error
If an error occurred, this parameter contains an error object with information about the type of failure.
-
Called after the controller's view is loaded into memory. Load
customisation
Declaration
Swift
override func awakeFromNib()