Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24718] iOS: Resolve iOS 8 deprecations for UIAlertView and UIActionSheet

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-06-20T14:59:04.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsiOS
Labelsn/a
ReporterVijay Singh
AssigneeVijay Singh
Created2017-05-23T07:55:50.000+0000
Updated2017-06-21T12:26:10.000+0000

Description

In SDK 6.0.0, we updated the default minimum iOS target to 8.0 as a result of the Xcode 8.x version that is now supported. Doing that, our iOS SDK core shows some deprecation-warnings regarding API's that should be replaced in iOS 8 and later. Remove old UIAlertView and UIActionSheet API's. This is subset of ticket TIMOB-24335.

Comments

  1. Vijay Singh 2017-05-24

    PR: https://github.com/appcelerator/titanium_mobile/pull/9079 Test Case : OptionDialog / ActionSheet
       var win = Ti.UI.createWindow({
         title: 'Click window to test',
         backgroundColor: 'white'
       });
       
       var opts = {
         cancel: 2,
         options: ['Confirm', 'Help', 'Cancel'],
         selectedIndex: 2,
         destructive: 0,
         title: 'Delete File?'
       };
       
       win.addEventListener('click', function(e){
         var dialog = Ti.UI.createOptionDialog(opts).show();
       });
       win.open();
       
    Test Case : AlertDialog / AlertView
       var win = Ti.UI.createWindow({  
         title: 'Click window to test',
         backgroundColor: 'white'
       });
       win.addEventListener('click', function(e){
         var dialog = Ti.UI.createAlertDialog({
           cancel: 1,
           buttonNames: ['Confirm', 'Cancel', 'Help'],
           message: 'Would you like to delete the file?',
           title: 'Delete'
         });
         dialog.addEventListener('click', function(e){
           if (e.index === e.source.cancel) {
             Ti.API.info('The cancel button was clicked');
           }
           Ti.API.info('e.cancel: ' + e.cancel);
           Ti.API.info('e.source.cancel: ' + e.source.cancel);
           Ti.API.info('e.index: ' + e.index);
         });
         dialog.show();
       });
       win.open();
       
  2. Harry Bryant 2017-06-21

    Verifed as fixed, ran test cases for OptionDialog / ActionSheet & AlertDialog / AlertView against iOS8/9/10 with Ti SDK 6.1.0.GA & Master. Tested On: iPhone 7 10.3.2 Device & Simulator iPhone 6S 9.3 / 8.1 Simulators Mac OS Sierra (10.12.5) Ti SDK: 6.2.0.v20170620104530 Appc NPM: 4.2.9 App CLI: 6.2.2 Xcode 8.3.3 Node v4.6.0 *Closing ticket.*

JSON Source