0

I'm developing a software for iOS using an IPAD 3 (MD368TY/A) as test's hardware. I'm trying to create a blur effect on a background image but i'm getting this result:

enter image description here

The 'correct' should be:

enter image description here (result reached using Iphone 5S simulator)

My code is:

import UIKit

class ProfileMgmtViewController: UIViewController {

  @IBOutlet weak var bgImageContainerView: UIView!
  @IBOutlet weak var userBgImg: UIImageView!
  @IBOutlet weak var userImg: UIImageView!

  override func viewDidLoad() {
    ...

    userBgImg.backgroundColor = UIColor(patternImage: userImg.image!)

    let blurEffect = UIBlurEffect(style: .Light)
    let blurView  = UIVisualEffectView(effect: blurEffect)
    blurView.frame = userBgImg.bounds
    print (userBgImg.bounds)
    userBgImg.addSubview(blurView)
    ...

I was reading that this version of IPAD doesn't supports blur effect. Is that true? There's some way to make blur effect works here?

kye
  • 2,166
  • 3
  • 27
  • 41
chr0x
  • 1,151
  • 3
  • 15
  • 25

1 Answers1

1

That's true, from this WWDC session: http://asciiwwdc.com/2014/sessions/419

So, and to reiterate on what devices we don't blur and that we only do the tinting on the iPad 2 and iPad 3rd generation, we just apply the tint and we skip the blur steps.

On iPad 4th generation, iPad Air, iPad Mini, iPad Mini with retina display, iPhones and the iPod touch we do both the blur and the tinting.

The blur effect is very costly so UI can be easily GPU bound, therefore, blur effect is disabled on earlier version iPad or iPhone. As I know, there is no way to make blur effect work here.

Alternatively, You can detect if a device support Blur effect and do something accordingly.

Community
  • 1
  • 1
ilovecomputer
  • 4,238
  • 1
  • 20
  • 33