top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to provide external parameter name to a function parameter name in SWIFT

0 votes
360 views

I am facing situation to use external parameter name to a function parameter name .. How to achieve this

posted Sep 11, 2014 by Arun

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

parameter name to a function parameter name

func join(string s1: String, toString s2: String, withJoiner joiner: String)
    -> String {
        return s1 + joiner + s2
}

To call function above

join(string: "hello", toString: "world", withJoiner: ", ")
answer Sep 22, 2014 by Raju
Similar Questions
+1 vote

How to declare single parameter which accept multiple values.

+1 vote

How to use default values for parameter in function. What will happens when value is not passed for a default parameters.

0 votes

Is it possible to set multiple return type for function in SWIFT. If yes please provide me syntax .

0 votes

How to set return type for function in SWIFT.

0 votes

How to say to my view controller to use UITableViewDataSource and UITableViewDelegate

class listItems: UIViewController {

    var aTableView:UITableView = UITableView()

    override func viewDidLoad() {
        super.viewDidLoad()
        aTableView.delegate = self
        aTableView.dataSource = self
        self.view.addSubview(aTableView)
    }

}
...