RUVIDEO
Поделитесь видео 🙏

UICollectionView Pt 4: CREATE CUSTOM UICOLLECTIONVIEWCELL SUBCLASS, AUTO LAYOUT

JOIN ME IN THIS COURSE FOR FREE: https://ductran.co/p/collectionview

Collection View is what enables us developers to build beautiful and stunning user interface like what you see in App Store, Instagram, Facebook, Spotify, Snapchat and Apple Music.

That's why nowadays ever developer must master these foundational skills to set up UICollectionView and UICollectionViewController.

Join me in this course for free. You'll learn everything about UICollectionView in these 9 lessons:
1 - Introduction to UICollectionView
2 - Set up data structure for the app
3 - Design Collection View in Storyboard with Auto Layout
4. Create Photo Cell subclassing UICollectionViewCell
5. Create Photos CollectionViewController
6. Create multiple sections and section header views
7. Transition to Detail View using UICollectionViewDelegate and Show Segue
8. Add new random items to collection view with animation
9. Delete items from UICollectionView

JOIN ME IN THIS COURSE FOR FREE: https://ductran.co/p/collectionview

********************************
*** ABOUT CODE MASTERY ***
********************************
Code Mastery is hosted by Duc Tran, founder of Developers Academy.

This is his free-style no notes, no teleprompter presentation and live coding broadcast with you guys everyday.

To join Duc's free courses, register for free at http://ductran.co/

*************************
*** MEET DUC TRAN ***
*************************

Duc Tran is founder of Developers Academy, one of the world's leading iOS, Android and Web development trainers.

More than 2,000,000 developers have studied his video trainings; 100,000 developers see his posts each month. Each year, Duc has helped 20,000 plus developers graduate from his online courses or video series.

*************************************************
*** FREE TRAININGS IN IOS DEVELOPMENT ***
*************************************************
To subscribe and get free tutorials, courses and weekly content, visit me at: http://ductran.co/
Connect with Duc on facebook: http://facebook.com/ductranfan
Tweet him: https://twitter.com/ductrongtran
Get daily inspiration: http://instagram.com/ductran.co/

********************
CODE FROM THE COURSE
********************

PhotosCollectionViewController.swift

class PhotosCollectionViewController : UICollectionViewController
{
override func numberOfSections(in collectionView: UICollectionView) - Int {
return photoCategories.count
}

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) - Int {
return photoCategories[section].imageNames.count
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) - UICollectionViewCell
{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Storyboard.photoCell, for: indexPath) as! PhotoCell
let photoCategory = photoCategories[indexPath.section]
let imageNames = photoCategory.imageNames
let imageName = imageNames[indexPath.item]

cell.imageName = imageName
cell.delegate = self

return cell
}

// Section Header View

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) - UICollectionReusableView
{
let sectionHeaderView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: Storyboard.sectionHeaderView, for: indexPath) as! SectionHeaderView
let category = photoCategories[indexPath.section]

sectionHeaderView.photoCategory = category

return sectionHeaderView
}

// MARK: - UICollectionViewDelegate

var selectedImage: UIImage!

override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
{
let category = photoCategories[indexPath.section]
selectedImage = UIImage(named: category.imageNames[indexPath.item])

performSegue(withIdentifier: Storyboard.showDetailVC, sender: nil)
}

// MARK: - Delete Items

override func setEditing(_ editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)

addBarButtonItem.isEnabled = !editing
if let indexPaths = collectionView?.indexPathsForVisibleItems {
for indexPath in indexPaths {
if let cell = collectionView?.cellForItem(at: indexPath) as? PhotoCell {
cell.isEditing = editing
}
}
}
}

To get the full source code, join me in this course: https://ductran.co/p/collectionview

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «UICollectionView Pt 4: CREATE CUSTOM UICOLLECTIONVIEWCELL SUBCLASS, AUTO LAYOUT», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.