Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23778

iOS: Improve warning when calling iOS10 visual effects for Ti.UI.iOS.BlurView on < iOS10

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 5.5.0
    • Fix Version/s: Release 5.5.0
    • Component/s: iOS
    • Labels:
    • Environment:

      iPhone 6S (10.0) Device & Simulator
      Mac OSX El Capitan 10.11.6
      Ti SDK: 5.5.0.v20160815115302
      Appc Studio: 4.7.0.201607250649
      Appc NPM: 4.2.7
      App CLI: 6.0.0-25
      Xcode 8.0 beta 5 (8S193k)
      Node v4.4.7

      Description

      Two new visual effects for iOS10 were exposed for Ti.UI.iOS.BlurView:
      Ti.UI.iOS.BLUR_EFFECT_STYLE_REGULAR
      Ti.UI.iOS.BLUR_EFFECT_STYLE_PROMINENT

      Currently, when running an app with these styles on a device < iOS10, the following error is returned:

      [ERROR] Invalid type passed to function. expected: Number, was: NSNull -[TiUIiOSBlurView setEffect_:] (TiUIiOSBlurView.m:43)
      

      It would be beneficial to handle this better through the form of a warning, stating that the currently selected style is not supported for the current iOS version.

      TEST CODE:

      var win = Ti.UI.createWindow({
          backgroundColor: "#fff"
      });
       
      // Reference image (or view)
      var img = Ti.UI.createImageView({
          image: "/default_app_logo.png",
          top: 100,
          width: 300,
          height: 300
      });
       
      // Blur view
      var blur = Ti.UI.iOS.createBlurView({
          width: Ti.UI.FILL,
          height: Ti.UI.FILL
      });
       
      img.add(blur);
       
      // Effect controls
      var tabs = Ti.UI.iOS.createTabbedBar({
          labels: ["Extra light", "Light", "Dark", "Regular", "Prominent"],
          bottom: 100
      });
       
      // Available blur effects
      var effects = [
          Ti.UI.iOS.BLUR_EFFECT_STYLE_EXTRA_LIGHT,
          Ti.UI.iOS.BLUR_EFFECT_STYLE_LIGHT,
          Ti.UI.iOS.BLUR_EFFECT_STYLE_DARK,
          Ti.UI.iOS.BLUR_EFFECT_STYLE_REGULAR,
          Ti.UI.iOS.BLUR_EFFECT_STYLE_PROMINENT
      ];
       
      tabs.addEventListener("click", function(e) {
          blur.setEffect(effects[e.index]);
      });
       
      win.add(tabs);
      win.add(img);
      win.open();
      

      Steps to Reproduce

      1. Create a new classic mobile application.
      2. Copy test code to app.js file.
      3. Build the app to an iOS device / sim < iOS10.
      4. Launch the app and select "Regular" or "Prominent" buttons.

      Actual Result

      Error is returned to the console, which does not clearly describe the issue.

      Expected Result

      Appropriate warning message should be returned stating that the style is not supported for the current version.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                htbryant Harry Bryant
                Reviewer:
                Angel Petkov
                Tester:
                Harry Bryant
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration