{ "id": "151070", "key": "TIMOB-19488", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-10-08T01:09:14.000+0000", "created": "2015-09-09T23:13:10.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "3DTouch", "iOS9" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2015-10-27T07:48:17.000+0000", "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" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Apple just presented the new 3DTouch feature of the iPhone6S. User can press a view and will review an instant feedback providing a preview of a view to select different actions, called {{UIPreviewAction}}. Each action have a {{title}}, {{style}} and {{handler}} property. Multiple actions can also be assigned to {{UIPreviewActionGroup}}. That group can have have a {{title}}, {{style}} and {{actions}} property to keep track of the assigned actions.\r\n\r\n*Related documents:*\r\n- https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIPreviewAction_Class/\r\n- https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIPreviewActionGroup_Class/\r\n\r\n*Example:*\r\n{code}\r\nvar sendAction = Ti.UI.iOS.createPreviewAction({\r\n\ttitle : \"Send per Mail\",\r\n\tstyle : Ti.UI.iOS.PREVIEW_ACTION_STYLE_DEFAULT\r\n});\r\n\r\nsendAction.addEventListener(\"click\", function() {\r\n\talert(\"send mail!\");\r\n});\r\n\r\nvar confirmAction = Ti.UI.iOS.createPreviewAction({\r\n\ttitle : \"Confirm\",\r\n\tstyle : Ti.UI.iOS.PREVIEW_ACTION_STYLE_DESTRUCTIVE\r\n});\r\n\r\nvar cancelAction = Ti.UI.iOS.createPreviewAction({\r\n\ttitle : \"Cancel\"\r\n});\r\n\r\nvar deleteAction = Ti.UI.iOS.createPreviewActionGroup({\r\n\ttitle : \"Delete\",\r\n\tactions : [confirmAction, cancelAction],\r\n\tstyle : Ti.UI.iOS.PREVIEW_ACTION_STYLE_DESTRUCTIVE\r\n});\r\n\r\nconfirmAction.addEventListener(\"click\", function() {\r\n\talert(\"delete!\");\r\n});\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"white\"\r\n});\r\n\r\n// The view to be previewed while popping.\r\nvar previewView = Ti.UI.createView({\r\n\tbackgroundColor : \"blue\"\r\n});\r\n\r\npreviewView.add(Ti.UI.createLabel({\r\n\tcolor : \"#fff\",\r\n\ttext : \"Preview!\"\r\n}));\r\n\r\n// The window to be opened after popping the preview.\r\nvar detailWindow = Ti.UI.createWindow({\r\n\tbackgroundColor : \"yellow\"\r\n});\r\n\r\ndetailWindow.add(Ti.UI.createLabel({\r\n\ttext : \"You made it!\"\r\n}));\r\n\r\n// Create the preview context\r\nvar context = Ti.UI.iOS.createPreviewContext({\r\n\tpreview : previewView,\r\n\tactions : [sendAction, deleteAction], // Can have both Ti.UI.iOS.PreviewAction + Ti.UI.iOS.PreviewActionGroup\r\n\tcontentHeight : 100, // When unspecified, we use the available height\r\n\tpop : function(e) {// Called after popping the preview\r\n\t\tdetailWindow.open();\r\n\t}\r\n});\r\n\r\n// Assign the preview context\r\nvar trigger = Ti.UI.createButton({\r\n\ttitle: \"Peek here!\",\r\n\tbackgroundColor : \"#000\",\r\n\ttintColor: \"#fff\",\r\n\twidth : 200,\r\n\theight : 50,\r\n\tpreviewContext : context\r\n});\r\n\r\nwin.add(trigger);\r\nwin.open(); \r\n{code}", "attachment": [ { "id": "56798", "filename": "Peek-And-Pop.jpg", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-22T17:27:52.000+0000", "size": 478799, "mimeType": "image/jpeg" }, { "id": "56727", "filename": "Screen Shot 2015-09-15 at 19.53.07.png", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-16T02:56:27.000+0000", "size": 559001, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS9: 3D-Touch: Support UIPreviewActions (\"Peek and Pop\")", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 494, "state": "closed", "name": "2015 Sprint 20 SDK", "startDate": "2015-09-26T00:29:19.845Z", "endDate": "2015-10-10T00:29:00.000Z", "completeDate": "2015-10-12T05:33:30.964Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "365051", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7235", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-27T22:17:17.000+0000", "updated": "2015-10-08T04:17:28.000+0000" }, { "id": "366177", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR approved and merged.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-08T01:09:02.000+0000", "updated": "2015-10-08T01:09:02.000+0000" }, { "id": "366235", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Building on device and for iTunes Store (just testing the build) fails.\r\n\r\n{code:title=Environment}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.11\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 0.10.38\r\n npm Version = 1.4.28\r\nTitanium CLI\r\n CLI Version = 5.0.4\r\nTitanium SDK\r\n SDK Version = 5.1.0.v20151007194443\r\n SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/5.1.0.v20151007194443\r\n Target Platform = iphone\r\n{code}\r\n\r\n{code}\r\n[ERROR] : ** BUILD FAILED **\r\n[ERROR] : The following build commands failed:\r\n[ERROR] : \tCompileC build/Intermediates/TestApp.build/Release-iphoneos/TestApp.build/Objects-normal/armv7/TiPreviewingDelegate.o Classes/TiPreviewingDelegate.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler\r\n[ERROR] : (1 failure)\r\nTRACE | titanium exited with exit code 1\r\nERROR | Error: ti run exited with error code 1\r\n at ChildProcess. (/Volumes/Data/Users/sebastian/.appcelerator/install/5.0.2/package/node_modules/appc-cli-titanium/plugins/run.js:89:66)\r\n at ChildProcess.emit (events.js:117:20)\r\n at Process.ChildProcess._handle.onexit (child_process.js:820:12)\r\n{code}", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-08T11:13:14.000+0000", "updated": "2015-10-08T11:13:14.000+0000" }, { "id": "366820", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, {{UIPreviewAction}} features working as intended, built to device & for the iTunes Store successfully. \r\n\r\nTested on: iPhone 6S + \r\n\r\nOSX El Capitan 10.11\r\nStudio: 4.3.1.201509302304\r\nTi SDK: 5.1.0.v20151009094506\r\nAppc NPM: 4.2.1-1\r\nAppc CLI: 5.1.0-38\r\n\r\nClosing Ticket. \r\n\r\n", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2015-10-14T20:35:38.000+0000", "updated": "2015-10-14T20:35:38.000+0000" }, { "id": "367625", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Wondering, how I can gain a preview of a listitem.\r\n\r\nI have to initially set the previewView, but I know it only, when I clicked on a listitem and have the id. \r\n\r\nI studied your listView example in https://github.com/hansemannn/titanium_mobile/blob/46a5fcaf10c3aaa4b07b7351da737c57660a171a/apidoc/Titanium/UI/iOS/PreviewContext.yml\r\n\r\nbut I have no idea how to fill the preview with fetched content from the listitem or the listitem index id", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-23T09:42:19.000+0000", "updated": "2015-10-23T09:42:19.000+0000" }, { "id": "367627", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "uh wait... it's the described in the Ti.UI.iOS.createPreviewContext... :facepalm:\r\n\r\nFirst think, then write... Sorry ;)", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-23T09:45:30.000+0000", "updated": "2015-10-23T09:45:30.000+0000" }, { "id": "367781", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hello [~hansknoechel],\r\n\r\nplayed around and think, that it's not working completely.\r\n\r\nI copied your example for integrating in a listview.\r\n\r\nI never get the Ti.API.warn messages. So, I think I never get into the pop function from your example.\r\n\r\nWhat I want to do is:\r\nHaving a listview.\r\nOn preview, I want to show a detailview with some information out of the database.\r\n\r\nBut how do I fill the previewView with some new content? I never get into the detailWindow.open of your example\r\n\r\n", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-26T10:25:39.000+0000", "updated": "2015-10-26T10:25:39.000+0000" }, { "id": "367881", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~benutzername]: It is currently not possible to provide a cell-specific preview, because the current KrollThread implementation of the core does not allow returning a proxy inside a KrollCallback. This issue is tracked in TIMOB-19763.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-26T22:36:29.000+0000", "updated": "2015-10-26T22:36:29.000+0000" }, { "id": "367949", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~hansknoechel] is that the reason, the example in the docs does not work and is not coming into the pop function?", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-27T07:48:17.000+0000", "updated": "2015-10-27T07:48:17.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }