Tag: UITableViewSWIFT XCODE6

如何使用Swift在UITableview中加载自定义单元格(Xib)

这是我的代码 func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 10 } func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { var cell :UITableViewCell = tableView.dequeueReusableCellWithIdentifier("discovered") as UITableViewCell! bluetoothlog.registerNib(UINib(nibName: "devicedet", bundle: nil), forCellReuseIdentifier: "discovered") //NSBundle.mainBundle().loadNibNamed("devicedet", owner: nil, options: nil)[0] as UITableViewCell cell = blucell devname.text = peri[indexPath.row] devstrength.text = signalstrength[indexPath.row] bluetoothlog.backgroundColor = UIColor.clearColor() return […]