Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- icons = try! fileManager.contentsOfDirectory(at: assetURL, includingPropertiesForKeys: [URLResourceKey.nameKey, URLResourceKey.isDirectoryKey], options: .skipsHiddenFiles)
- func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
- let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "iconCell", for: indexPath)
- let iconItem = icons[indexPath.row]
- // Configure the cell
- var imageView: UIImageView
- let image = UIImage(named: "Images.bundle/(iconItem.lastPathComponent)")?.resizeImage(newWidth: CGFloat(32)).withRenderingMode(.alwaysTemplate)
- iconNames.append(iconItem.lastPathComponent)
- imageView = UIImageView(image: image)
- imageView.tintColor = .black
- imageView.contentMode = .scaleToFill
- cell.contentView.addSubview(imageView)
- return cell
- }
Add Comment
Please, Sign In to add comment