[TIMOB-23495] iOS: Support parent property on Ti.Filesystem.File
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-11-14T00:12:03.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.0.0 |
| Components | iOS |
| Labels | parity |
| Reporter | Christopher Williams |
| Assignee | Hans Knöchel |
| Created | 2016-06-10T19:01:45.000+0000 |
| Updated | 2017-11-14T22:59:49.000+0000 |
Description
iOS is the only platform that doesn't support Ti.Filesystem.File.parent property. We should ideally support it for parity's sake.
PR: https://github.com/appcelerator/titanium_mobile/pull/9285 Test-Case (additionally to the unit-test):
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var btn = Ti.UI.createButton({ title: 'Log parent file path' }); btn.addEventListener('click', function() { var file = Ti.Filesystem.getFile('app.js'); Ti.API.warn('Native Path (File):'); Ti.API.warn(file.nativePath); // Will return the file path Ti.API.warn('Getter (file.getParent()): Should return a (deprecated) String reference'); Ti.API.warn(file.getParent()); // Will return the parent path Ti.API.warn('Property (file.parent): Should return a Ti.Filesystem.File reference'); Ti.API.warn(file.parent); // Will print the path of the file because of the class-description Ti.API.warn(file.parent.nativePath); // Will return the paren path Ti.API.warn(file.parent.getNativePath()); // Will return the parent path }); win.add(btn); win.open();FR passed; PR merged.
Verified in SDK build: 7.0.0.v20171114134144