Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Datasource in separate class #49

Open
drmaxmad opened this issue May 25, 2016 · 0 comments
Open

Datasource in separate class #49

drmaxmad opened this issue May 25, 2016 · 0 comments

Comments

@drmaxmad
Copy link

Hi,

I am trying to create few picker on same viewcontroller, now when i try to separate the datasource into another class in never shows the data, be it text or image.

here is the class and the way i am creating the picker.

class imagePickerDataSource : NSObject, AKPickerViewDataSource {
    func numberOfItemsInPickerView(pickerView: AKPickerView) -> Int {
        return imageInputs.count;
    }

    func pickerView(pickerView: AKPickerView, imageForItem item: Int) -> UIImage {
        let image = UIImage(named: imageInputs[item])!;
        return image;
    }
}

Here is how i am calling it.

 let imageDS = imagePickerDataSource();
 self.imageInputPicker.delegate = self;
 self.imageInputPicker.dataSource = imageDS;

The datasource functions are called but picker is never filled with image.

@drmaxmad drmaxmad changed the title Datasourece in separate class. Datasource in separate class May 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant