@@ -43,12 +43,11 @@ export class ImagePicker extends data_observable.Observable {
43
43
super ( ) ;
44
44
45
45
this . _hostView = hostView ;
46
- this . _imagePickerControllerDelegate = new ImagePickerControllerDelegate ( ) ;
46
+ this . _imagePickerControllerDelegate = ImagePickerControllerDelegate . new ( ) ;
47
47
48
48
let imagePickerController = QBImagePickerController . alloc ( ) . init ( ) ;
49
49
imagePickerController . assetCollectionSubtypes = defaultAssetCollectionSubtypes ;
50
50
imagePickerController . mediaType = options . mediaType ? < QBImagePickerMediaType > options . mediaType . valueOf ( ) : QBImagePickerMediaType . Any ;
51
- imagePickerController . delegate = this . _imagePickerControllerDelegate ;
52
51
imagePickerController . allowsMultipleSelection = options . mode !== 'single' ;
53
52
imagePickerController . minimumNumberOfSelection = options . minimumNumberOfSelection || 0 ;
54
53
imagePickerController . maximumNumberOfSelection = options . maximumNumberOfSelection || 0 ;
@@ -80,7 +79,9 @@ export class ImagePicker extends data_observable.Observable {
80
79
this . _imagePickerControllerDelegate . _resolve = resolve ;
81
80
this . _imagePickerControllerDelegate . _reject = reject ;
82
81
83
- this . hostController . presentViewControllerAnimatedCompletion ( this . _imagePickerController , true , null ) ;
82
+ this . hostController . presentViewControllerAnimatedCompletion ( this . _imagePickerController , true , ( ) => {
83
+ this . _imagePickerController . delegate = this . _imagePickerControllerDelegate ;
84
+ } ) ;
84
85
} ) ;
85
86
}
86
87
}
@@ -129,4 +130,3 @@ export class ImagePickerControllerDelegate extends NSObject implements QBImagePi
129
130
export function create ( options ?: Options , hostView ?: View ) : ImagePicker {
130
131
return new ImagePicker ( options , hostView ) ;
131
132
}
132
-
0 commit comments