Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListRepoModuleView presentDetailRepoModuleModule(repo) passes nil repo? #4

Open
apparition47 opened this issue Nov 16, 2016 · 0 comments

Comments

@apparition47
Copy link

Hi, I'm trying to get your project working and I almost have it working with a few tweaks (see below). But when I tap on the list to get to the detail page, the detail page doesn't show the repo's title like it should.

image

Any idea what's going on here?

ListRepoModuleView.swift

func showRepos(repos: Array<Repo>, pulledToRefresh: Bool) {
    self.data = repos;
    self.resetRepoCellModels(pulledToRefresh);
}

func resetRepoCellModels(pulledToRefresh: Bool) {
    var cellModels: Array<RepoCellModel> = Array<RepoCellModel>();
    
    for repo: Repo in self.data {
        let cellModel: RepoCellModel = RepoCellModel(avatarUrl: repo.avatarUrl!, name: repo.name!) { _ in
// **************
            debugPrint(repo.name) // prints nil here ????
            self.presenter?.presentDetailRepoModuleModule(repo); // passed to the next view but is nil
// **************
            self.tableView.deselectRowAtIndexPath(self.tableView.indexPathForSelectedRow!, animated: true);
        };
        
        cellModels.append(cellModel);
    }
    
    Async.main {
        if(self.hakuba.sectionsCount > 0) {
            self.hakuba[0].reset(cellModels)
                .bump();
        } else {
            let section = Section();
            self.hakuba
                .insert(section, atIndex: 1)
                .bump();
            self.hakuba[0].append(cellModels)
                .bump();
        }
    }
// ...
nil
Printing description of repo:
<iOSSwiftStarter.Repo: 0x6180000d5690> (entity: Repo; id: 0xd000000014000000 <x-coredata://ABC1CF60-4B55-48F0-A86C-CA4250C27333/Repo/p1280> ; data: <fault>)

I have your starter here:
git clone -b issue-3 git@github.com:apparition47/iOSSwiftStarter.git

Using XCode 8.1 on macOS 10.11.6.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant