{ "id": "174954", "key": "TIMOB-27865", "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": [ { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-01-15T20:09:23.000+0000", "created": "2020-04-24T20:51:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "58796", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "175615", "key": "TIMOB-28175", "fields": { "summary": "iOS: Titanium should add view controllers as children", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "58848", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175646", "key": "TIMOB-28209", "fields": { "summary": "iOS: App orientations stopped when using the search bar in the listview", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-01-28T13:12:51.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": "Copied from [here|https://github.com/appcelerator/titanium_mobile/issues/11651] -\r\n\r\nWhen adding windows to windows (e.g. using Titanium.UI.createNavigationWindow), Titanium ignores the [rules of view controller containment on iOS|https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html] and doesn't add view controllers as children.\r\n\r\nThe code responsible for calling the required methods has been commented out with a TODO: Revisit for almost 5 years (as of writing this issue):\r\n\r\n[titanium_mobile/iphone/TitaniumKit/TitaniumKit/Sources/API/TiWindowProxy.m|https://github.com/appcelerator/titanium_mobile/blob/1afbbfc3f7fbc3f9f69580043d61ba4e75bf7127/iphone/TitaniumKit/TitaniumKit/Sources/API/TiWindowProxy.m#L150-L174]\r\n\r\n\r\n{code:java}\r\n - (void)attachViewToTopContainerController \r\n { \r\n UIViewController *topContainerController = [[[TiApp app] controller] topContainerController]; \r\n UIView *rootView = [topContainerController hostingView]; \r\n TiUIView *theView = [self view]; \r\n [rootView addSubview:theView]; \r\n [rootView bringSubviewToFront:theView]; \r\n \r\n // TODO: Revisit \r\n /* \r\n UIViewController* topContainerController = [[[TiApp app] controller] topContainerController]; \r\n UIView *rootView = [topContainerController hostingView]; \r\n \r\n UIViewController* thisViewController = [self hostingController]; \r\n UIView* theView = [thisViewController view]; \r\n [theView setFrame:[rootView bounds]]; \r\n \r\n [thisViewController willMoveToParentViewController:topContainerController]; \r\n [topContainerController addChildViewController:thisViewController]; \r\n \r\n [rootView addSubview:theView]; \r\n [rootView bringSubviewToFront:theView]; \r\n [thisViewController didMoveToParentViewController:topContainerController]; \r\n */ \r\n }\r\n{code}\r\n \r\nThis causes issues in view-controller-backed modules (such as PSPDFKit), especially during view controller presentation. UIKit eve logs a warning message about this:\r\n\r\n \"Presenting view controllers on detached view controllers is discouraged.\"\r\n\r\nSteps to reproduce- \r\n\r\nCreate a plain window and a navigation window. Run the app and inspect the view hierarchy.\r\n{code:java}\r\nvar window = Titanium.UI.createWindow({\r\n backgroundColor: \"white\",\r\n})\r\n\r\nvar navigationWindow = Titanium.UI.createNavigationWindow({\r\n window: window,\r\n})\r\n\r\nnavigationWindow.open()\r\n\r\n{code}\r\n\r\nExpected behavior -\r\n\r\nEvery view controller in the hierarchy (except for TiRootViewController) has a correctly set parent view controller.\r\n\r\nActual behavior -\r\n\r\nUINavigationController managed by Titanium.UI.NavigationWindow is detached and has no parent view controller. See attached image view \"controller.png\"\r\n", "attachment": [ { "id": "67348", "filename": "viewcontroller.png", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-24T20:52:51.000+0000", "size": 1480420, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Titanium should add view controllers as children", "creator": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1214, "state": "closed", "name": "2021 Sprint 1", "startDate": "2021-01-04T17:38:57.886Z", "endDate": "2021-01-15T17:38:00.000Z", "completeDate": "2021-01-15T20:35:11.006Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "457272", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This also caused TIMOB-28109 / AC-6615 and should be fixed with high priority.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-10-17T14:54:46.000+0000", "updated": "2020-10-17T14:54:46.000+0000" }, { "id": "457406", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator/titanium_mobile/pull/12233", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-10-30T23:55:07.000+0000", "updated": "2020-10-30T23:55:07.000+0000" }, { "id": "458001", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting for Jenkins build.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-14T00:07:25.000+0000", "updated": "2021-01-14T00:07:25.000+0000" }, { "id": "458014", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Merged to master for 10.0.0 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-01-15T20:08:25.000+0000", "updated": "2021-01-15T20:08:25.000+0000" }, { "id": "458108", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-01-28T13:12:42.000+0000", "updated": "2021-01-28T13:12:42.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }