Help us understand the problem. What is going on with this article?

iOS 12の実機でのみ半透明白色がdrawRectでうまく描画できない

More than 1 year has passed since last update.


理由がわからずiOS 12のバグ?とよくやる「人のせいと考える罠」にはまりかけたんですが、やっぱり私のバグでした。

let color = UIColor(red: 255.0, green: 255.0, blue: 255.0, alpha: 0.5)

とまあ、red, green, blueパラメータに1.0じゃなく255.0を代入してたんですよね・・・今までちゃんと動いてたのは、たまたまだったようです。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away