2016-10-17 80 views
-1

我有我的tableview原生廣告,他們利用這種indexpath顯示:更改didSelectRowAtIndexPath方法FUNC IndexPath

indexPath.row - Int(indexPath.row/adRowStep) 

我如何更改didSelectRowAtIndexPath方法功能使用上述indexPath?

編輯

這是從的cellForRowAtIndexPath FUNC代碼

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! NearMeCell 


let venue = venues[indexPath.row - Int(indexPath.row/adRowStep)] 

let venueTittle = (venue["Name"] as! String) 

cell.venueName.text = venueTitle 

return cell 
    } 

這是原生廣告代碼:

func configureAdManagerAndLoadAds() { 
     if adsManager == nil { 
      adsManager = FBNativeAdsManager(placementID: "adID", forNumAdsRequested: 2) 
      FBAdSettings.addTestDevice("clientID") 
      adsManager.delegate = self 
      adsManager.loadAds() 

     } 
    } 
+0

如何使用相同的代碼? – alexburtnik

+0

您發佈的代碼行不顯示任何內容,更不用說「原生廣告」。我們需要更多信息。 –

+0

@alexburtnik如何更改didSelectRowAtIndexPath func以適應不同的索引路徑,因爲我可以告訴它使用的是標準indexPath.row –

回答

0

我還是不明白廣告是如何正在顯示,但根據您提供的信息,我希望你在你的需要這個didSelectRowAtIndexPath

let venue = venues[indexPath.row + Int(indexPath.row/adRowStep)] 
相關問題