Swiftのコードを見ていたらわからない記述があり,自分でも調べて見たのですが、わかりませんでした
ご存知の方教えていただけませんでしょうか
swift
1func setCollectionViewDataSourceDelegate 2 <D: UICollectionViewDataSource & UICollectionViewDelegate> 3 (dataSourceDelegate: D, forRow row: Int) { 4 5 shopCollectionView.delegate = dataSourceDelegate 6 shopCollectionView.dataSource = dataSourceDelegate 7 shopCollectionView.reloadData() 8 9 }
この関数の
swift
1func setCollectionViewDataSourceDelegate 2 <D: UICollectionViewDataSource & UICollectionViewDelegate> 3 (dataSourceDelegate: D, forRow row: Int)
の部分なのですが、<D: UICollectionViewDataSource & UICollectionViewDelegate>(dataSourceDelegate: D, forRow row: Int)の部分はどういう意味なのでしょうか?
よろしくお願いします
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/12/04 03:42