Problem with custom classes (Can't choose classes manually)

Hello,

I am learning how to use Xcode (absolutely beginner), I have a problem while creating new swift files inside my project and relate them to the other files inside the same project. I am not a native english speaker, sorry if my english is not perfect.

So, I created a new swift file and write the code:

import UIKit
class CardCollectionViewCell: UICollectionViewCell {
}

Then I go to to the storyboard, view, collection view, and cell, and try to establish that cell like a CardCollectionViewCell with the Identity inspector, with no problem. But when I try to use the assistant to change it form automatic to manual so I can select CardCollectionViewCell instead of automatic ViewController.swift there is no that option, only automatic can be choose.

I am stuck with this and being trying to figure it out for hours so any help would be appreciated. I arrived to this problem while trying to follow this tutorial: How To Build a Match Game - Lesson 4 (Custom Classes) from Chris Youtube Channel.

Thanks!.

1 Like

Hey @Thiago_King. Feel free to zip up your project, and send it over to me, and I will take a look. You can upload the file to a file sharing service like Box, and paste the link in here. Also, make sure to zip up the entire project folder, not just the Xcode file.

Hey @David_Ruvinskiy can you take a look at my project? I’m having the same problems…

Hello David, this is the link to my project: https://www.dropbox.com/s/o0zbpjnd5eivyz6/match%20app.zip?dl=0 , Thanks in advance!

@David_Ruvinskiy Here’s the link to my project as well…

Thanks

Hey @Thiago_King. Can you try manually opening CardCollectionViewCell through the assistant editor. I was able to do that in your project. @Tay5ive Can you please also try that?

Hey @David_Ruvinskiy i think I’ve opened it… whats the next step now?

@David_Ruvinskiy, I can not, the assistant editor doesn’t let me set the option in manual, only automatic, maybe is a configuration in my Xcode program and not something in the code, I don’t know. let me show you: https://www.dropbox.com/s/dqd146mxsab8703/the%20problem%20(automatic%20classes).m4v?dl=0
but thanks for taking the time to check my project, I appreciate it.

I manually opened CardCollectionViewCell, then adding the editor on screen so I can use it with the storyboard side by side. Thanks so much for the help and for taking the time to check my project, I really appreciated it. Have a nice day!

1 Like

You should be able to continue with Chris’s videos then. :slight_smile: Are you having difficulty replicating something Chris is doing?

@David_Ruvinskiy Thanks!, I am going well with Chris videos, struggling a little bit with delegates and protocols but is because this is all new for me, hopefully I will understand them better with some practice. A little question I have is about constraints, when I try to set them to 0, Xcode change them to default, and apparently is not the same, so I am using 1 instead, any way I can set them to 0?

Hey @Thiago_King i have the same problem, so what i do after i set the constraints is manually set them to 0 by clicking the contraints and going over to the trailing alignment constraint and manually putting the constant to 0. Hopefully that will help you.

Thank you @Tay5ive ! I will do that :slight_smile: