|
Re: New syntax in Xcode 12.5.
The first half. Ternary has been there since time began. I’ve never seen this part be legitimate before.
The first half. Ternary has been there since time began. I’ve never seen this part be legitimate before.
|
By
Alex Zavatone
·
#1415
·
|
|
Re: New syntax in Xcode 12.5.
Are you referring to the ternary conditional operator, which has existed in Swift since the beginning, or to the fact that it creates a local variable with the same name (myVar) as a parameter or
Are you referring to the ternary conditional operator, which has existed in Swift since the beginning, or to the fact that it creates a local variable with the same name (myVar) as a parameter or
|
By
Jeremy Hughes
·
#1414
·
|
|
New syntax in Xcode 12.5.
I just saw someone use this syntax in a project and haven’t see it before. It compiles in Xcode 12.5, but not in Xcode 12.4. Does anyone have any more details on it?
let myVar = myVar != someValue
I just saw someone use this syntax in a project and haven’t see it before. It compiles in Xcode 12.5, but not in Xcode 12.4. Does anyone have any more details on it?
let myVar = myVar != someValue
|
By
Alex Zavatone
·
#1413
·
|
|
Re: Help with iOS 15-style UIButton?
Just to finish up this discussion, below is the code I ended up with for my button that is compatible with both pre-15 and post-15 code.
I think that if you subclass UIButton in your current code,
Just to finish up this discussion, below is the code I ended up with for my button that is compatible with both pre-15 and post-15 code.
I think that if you subclass UIButton in your current code,
|
By
Rick Aurbach
·
#1412
·
|
|
Re: CGContext always creating a black rect.
I initially felt that way too, several years ago, when first coming from Obj-C. However, I learned to embrace the tools (which make it easy to find the declaration) and also be mindful of writing
I initially felt that way too, several years ago, when first coming from Obj-C. However, I learned to embrace the tools (which make it easy to find the declaration) and also be mindful of writing
|
By
Ben Kennedy
·
#1411
·
|
|
Re: CGContext always creating a black rect.
Thanks.
I know I don’t need the self, but I want the context. A variable just sitting around tells me nothing about the context in which it exists. I want to see the context and want to see the
Thanks.
I know I don’t need the self, but I want the context. A variable just sitting around tells me nothing about the context in which it exists. I want to see the context and want to see the
|
By
Alex Zavatone
·
#1410
·
|
|
Re: CGContext always creating a black rect.
Move your `backgroundColor` and `isOpaque` calls to the init method(s). I set up a test project with your code, and that solves the problem.
I was going to make that suggestion before I even tested
Move your `backgroundColor` and `isOpaque` calls to the init method(s). I set up a test project with your code, and that solves the problem.
I was going to make that suggestion before I even tested
|
By
Ben Kennedy
·
#1409
·
|
|
CGContext always creating a black rect.
Hi. I’m trying to draw a bezier shape in CGContext on a UIView in Swift with a transparent background and the background is always black. Nothing online helps.
Any ideas? I’ve checked
Hi. I’m trying to draw a bezier shape in CGContext on a UIView in Swift with a transparent background and the background is always black. Nothing online helps.
Any ideas? I’ve checked
|
By
Alex Zavatone
·
#1408
·
|
|
Re: Help with iOS 15-style UIButton?
Hi, Alex.
The work-around was to force the button width to be "expectedWidth" (which is the width of the [unwrapped] text + image padding + image width + 8 points of slop (to account for button
Hi, Alex.
The work-around was to force the button width to be "expectedWidth" (which is the width of the [unwrapped] text + image padding + image width + 8 points of slop (to account for button
|
By
Rick Aurbach
·
#1407
·
Edited
|
|
Re: Help with iOS 15-style UIButton?
And what is, "mirrow above bounds code”?
And what is, "mirrow above bounds code”?
|
By
Alex Zavatone
·
#1406
·
|
|
Re: Help with iOS 15-style UIButton?
Could you point out the specific workaround please?
Could you point out the specific workaround please?
|
By
Alex Zavatone
·
#1405
·
|
|
Re: Help with iOS 15-style UIButton?
I haven't filed a bug yet, but I will. In the meantime, I've constructed the following work around — it's a hack, but it seems to work.
I haven't filed a bug yet, but I will. In the meantime, I've constructed the following work around — it's a hack, but it seems to work.
|
By
Rick Aurbach
·
#1404
·
Edited
|
|
Re: Help with iOS 15-style UIButton?
Can you file a bug?
Maybe they will fix it before iOS 15 is released.
Jeremy
—
Can you file a bug?
Maybe they will fix it before iOS 15 is released.
Jeremy
—
|
By
Jeremy Hughes
·
#1403
·
|
|
Re: Help with iOS 15-style UIButton?
Thanks for the heads up. That’s crappy.
Thanks for the heads up. That’s crappy.
|
By
Alex Zavatone
·
#1402
·
|
|
Re: Help with iOS 15-style UIButton?
Good thought. I'll give it a try.
Re: your "do you have to use the API" remark, the simple answer is that if your deployment target is iOS 15, you ARE using the API, whether you like it or not. There
Good thought. I'll give it a try.
Re: your "do you have to use the API" remark, the simple answer is that if your deployment target is iOS 15, you ARE using the API, whether you like it or not. There
|
By
Rick Aurbach
·
#1401
·
|
|
Re: Help with iOS 15-style UIButton?
Can you set up an observer to watch and see if it’s changed and then change it back? Seems like a real hack, but it’s a thought.
Can you set up an observer to watch and see if it’s changed and then change it back? Seems like a real hack, but it’s a thought.
|
By
Alex Zavatone
·
#1400
·
|
|
Re: Help with iOS 15-style UIButton?
My god, that sucks. I can’t believe this wasn’t tested. We've actually been building custom UI classes for the past month and am familiar with the pain.
Do you have to use the new API?
My god, that sucks. I can’t believe this wasn’t tested. We've actually been building custom UI classes for the past month and am familiar with the pain.
Do you have to use the new API?
|
By
Alex Zavatone
·
#1399
·
|
|
Re: Help with iOS 15-style UIButton?
The problem is unique to the new iOS 15 UIButton API. There is no problem in my logic if the deployment target < iOS15.
Specifically,
I tried setting a constraint on the height of the button. It is
The problem is unique to the new iOS 15 UIButton API. There is no problem in my logic if the deployment target < iOS15.
Specifically,
I tried setting a constraint on the height of the button. It is
|
By
Rick Aurbach
·
#1398
·
|
|
Re: Help with iOS 15-style UIButton?
I did this in UIKit by making the button’s frame.size.width the frame.size.width of the content within + appropriate space buffers.
One trick is if the text component is a UILabel, making the lines
I did this in UIKit by making the button’s frame.size.width the frame.size.width of the content within + appropriate space buffers.
One trick is if the text component is a UILabel, making the lines
|
By
Alex Zavatone
·
#1397
·
|
|
Help with iOS 15-style UIButton?
I am trying to construct a button using the new iOS15 button API. (Xcode 13ß3, UIKit & Storyboards)
The button has a title (aligned .leading) and an image (aligned .trailing). The button has the
I am trying to construct a button using the new iOS15 button API. (Xcode 13ß3, UIKit & Storyboards)
The button has a title (aligned .leading) and an image (aligned .trailing). The button has the
|
By
Rick Aurbach
·
#1396
·
|