Home>
I was wondering when I was learning Swift, but I found many Swift delegate methods with the same name.
func tableView (_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
<# code #>
}
func tableView (_ tableView: UITableView, heightForRowAt indexPath: IndexPath)->CGFloat {
view.frame.size.height/6
}
I think that these are different depending on the argument, etc., but is this mechanism unique to the delegate method? Or, this is possible even when creating and calling your own function Would you like ...?
I would be pleased if anyone could advise me.
-
Answer # 1
Related articles
- python - about image processing of hog method
- ios - about processing when data could not be obtained by api
- python about iterative processing with specified numbers
- python - about the feature selection method
- programming language - about method argument types
- [java] about equals method (reason why nullpointerexception does not occur even if null is passed/override)
- ios - about farebase user registration
- please tell me about the extraction method when the parentheses of the json part are nested in python3 scraping
- java - about the minus of the method
- go - for c: = range ch {} about the method of close (ch) when sending a value to ch in the clause
- java print method? about
- about the return statement of processing (character string)
- about byte processing clipping in python
- java - about the stringutilsisempty () method
- python - about the target method when nothing is returned for the query of table
- python - about processing of for statement
- javascript - about processing when you want to pass a query to the url at the time of page transition on the website
- python 3x - [python] about the method of totaling for each data frame and element
- bash - about the deletion method when the character strings of two files are compared and match
- about the output result of iloc method of python
Related questions
- ios - [xcode] regarding the screen transition, it became a strange screen display
- ios - i can't see the keyboard in the xcode simulator
- [ios] effect of setting enable bitcode to false
- ios - data of authauth () currentuser? uid cannot be deleted even if the application is deleted
- ios - i want to change the title from the keyboard when i tap annotation in swift
- ios - i want to pass an array containing tuples in swift and userdefaults
- ios - i want to display the initial text value of uitextfield in swiftui
- ios - i want to set the title on the screen with tabbar under navigationcontroller in swift5
- ios - i don't see the xcode simulator
- ios - i want to convert string to date type in swift4
You can also make your own.
Defining the same name method with different arguments is called overloading.
Try searching for "swift overload".
About function overloading
About multiple methods with the same name in a class