Advertisement
Guest User

Untitled

a guest
Jun 1st, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class DataSource: UITableViewDataSource {
  2. // UITableViewDataSourceの処理は今回はいらないので省略
  3.  
  4. // handlerは追加する分のNSIndexPathの配列を返す
  5. func reloadData(#handler: ([NSIndexPath] -> Void)) {
  6. // ここでAPIとごにょごにょ
  7. var indexPaths:[NSIndexPath] = []
  8. //
  9. // NSIndexPathを追加する処理
  10. //
  11.  
  12. handler(indexPaths)
  13. }
  14.  
  15. // handlerは追加する分のNSIndexPathの配列を返す
  16. func addData(#handler: ([NSIndexPath] -> Void)) {
  17. // ここでAPIとごにょごにょ
  18. var indexPaths:[NSIndexPath] = []
  19. //
  20. // NSIndexPathを追加する処理
  21. //
  22.  
  23. handler(indexPaths)
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement