{ "id": "148037", "key": "TIMOB-19089", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2015-05-20T21:32:42.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "clipboard", "ios" ], "versions": [], "issuelinks": [ { "id": "47842", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "147591", "key": "AC-1694", "fields": { "summary": "iOS: Clipboard does not support multiple items", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-02-28T19:55:50.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem\r\n\r\nWhen requesting Ti.UI.Clipboard.getData(), if the clipboard has several items (e.g. more than one image) it returns only one item. This is an improvement suggestion to support multiple items on clipboard, which is supported by iOS since at least version 5.0.\r\n\r\nh2. Test case\r\n{code:lang=javascript|title=app.js}\r\n\r\n var self = Ti.UI.createView();\r\n\r\n\tvar lblId = Ti.UI.createLabel({\r\n\t\ttext : 'No valid files were identified.',\r\n\t\tleft : 8,\r\n\t\tright : 8,\r\n\t\ttop : 32,\r\n\t});\r\n\tself.add(lblId);\r\n\t\r\n\tvar imgFile=Ti.UI.createImageView({\r\n\t\tleft:8,\r\n\t\tright:8,\r\n\t\ttop:80,\r\n\t\theight:200,\r\n\t});\r\n\tself.add(imgFile);\r\n\r\n\tvar tmrCheck = setInterval(function() {\r\n\r\n //now copy more than one image from iOS Photos (like attachment) and see the result\r\n //notice that Blob size and image refers to only one image\r\n\r\n\t\tif (Ti.UI.Clipboard.hasData('image')) {\t\r\n\t\t\timgFile.image=Ti.UI.Clipboard.getData('image');\r\n\t\t\tTi.API.info(Ti.UI.Clipboard.getData('image').getSize());\r\n\t\t\tlblId.text = 'Media Identified!';\r\n\t\t}else{\r\n\t\t\tlblId.text ='No valid files were identified.';\r\n\t\t}\r\n\t}, 3000);\r\n\r\n{code}", "attachment": [ { "id": "55485", "filename": "iOS Simulator Screen Shot 06.05.2015 17.22.43.png", "author": { "name": "dkcarmo", "key": "dkcarmo", "displayName": "Daniel Kunzler", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-05-20T21:32:43.000+0000", "size": 198186, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Clipboard does not support multiple items", "creator": { "name": "dkcarmo", "key": "dkcarmo", "displayName": "Daniel Kunzler", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dkcarmo", "key": "dkcarmo", "displayName": "Daniel Kunzler", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.10.3\r\n Architecture = 64bit\r\nNode.js\r\n Node.js Version = 0.10.13\r\n npm Version = 1.3.2\r\nTitanium CLI\r\n CLI Version = 3.4.2\r\nTitanium SDK\r\n SDK Version = 3.5.1.GA\r\nSupport/Titanium/mobilesdk/osx/3.5.1.GA\r\n Target Platform = iphone\r\n", "comment": { "comments": [ { "id": "356817", "author": { "name": "dkcarmo", "key": "dkcarmo", "displayName": "Daniel Kunzler", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The following Obj-C code gives the total number of items currently present in the clipboard:\r\n\r\n{code}\r\n-(id)getDataCount:(id)arg\r\n{\r\n \r\n ENSURE_STRING_OR_NIL(arg);\r\n \r\n __block NSInteger result;\r\n TiThreadPerformOnMainThread(^{\r\n UIPasteboard *board = [UIPasteboard generalPasteboard];\r\n NSInteger size = board.numberOfItems;\r\n if (size > 0){\r\n DebugLog(@\"[DEBUG] DataCount: %d\", size);\r\n result = size;\r\n }else{\r\n result = 0;\r\n }\r\n }, YES);\r\n \r\n return NUMLONG(result);\r\n}\r\n{code}", "updateAuthor": { "name": "dkcarmo", "key": "dkcarmo", "displayName": "Daniel Kunzler", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-07-02T21:51:57.000+0000", "updated": "2015-07-02T21:51:57.000+0000" }, { "id": "387366", "author": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "body": "+10", "updateAuthor": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "created": "2016-06-02T02:01:18.000+0000", "updated": "2016-06-02T02:01:18.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }