Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1694] iOS: Clipboard does not support multiple items

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2015-05-06T20:34:48.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules, Titanium SDK & CLI
Labelsclipboard, ios
ReporterDaniel Kunzler
AssigneeRadamantis Torres-Lechuga
Created2015-05-06T20:25:02.000+0000
Updated2016-03-08T07:38:11.000+0000

Description

Problem

When requesting Ti.UI.Clipboard.getData(), if the clipboard has several items (e.g. more than one image) it returns only one item.

Test case


        var self = Ti.UI.createView();

	var lblId = Ti.UI.createLabel({
		text : 'No valid files were identified.',
		left : 8,
		right : 8,
		top : 32,
	});
	self.add(lblId);
	
	var imgFile=Ti.UI.createImageView({
		left:8,
		right:8,
		top:80,
		height:200,
	});
	self.add(imgFile);

	var tmrCheck = setInterval(function() {

        //now copy more than one image from iOS Photos (like attachment) and see the result
        //notice that Blob size and image refers to only one image

		if (Ti.UI.Clipboard.hasData('image')) {	
			imgFile.image=Ti.UI.Clipboard.getData('image');
			Ti.API.info(Ti.UI.Clipboard.getData('image').getSize());
			lblId.text = 'Media Identified!';
		}else{
			lblId.text ='No valid files were identified.';
		}
	}, 3000);

Attachments

FileDateSize
iOS Simulator Screen Shot 06.05.2015 17.22.43.png2015-05-06T20:21:16.000+0000198186

Comments

  1. Radamantis Torres-Lechuga 2015-05-06

    This is invalid, per our documentation, "used to save a single item of data" , Here's the link to the docs: [Clipboard](http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.Clipboard)
  2. Daniel Kunzler 2015-05-06

    I saw the sentence in the documentation but it says nothing about retrieving data. Anyway is it possible to you change this issue to an improvement type? I think it's a really important feature missing in the Titanium SDK.

JSON Source