Re: Need for Swift

2019-10-16 Thread Charles Srstka via Cocoa-dev
> On Oct 16, 2019, at 2:38 PM, Jean-Daniel via Cocoa-dev > wrote: > >> Le 16 oct. 2019 à 11:49, Stephane Sudre via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> a écrit : >> >> On Tue, Oct 15, 2019 at 2:26 PM Sandor Szatmari via Cocoa-dev >> mailto:cocoa-dev@lists.apple.com>> wrote: >> >>>

Re: Alerts in Xcode 11

2019-10-16 Thread Alex Zavatone via Cocoa-dev
Yeah, one thing you need to do is get the key window’s presentedViewController. You can do this from the shared applicationDelegate. Create a standalone class that gets UIApplication.shared().keywindow.presentedViewController. Think of that as self. And then use that to present the alert. A

Re: Alerts in Xcode 11

2019-10-16 Thread Doug Hardie via Cocoa-dev
I finally got some time to get back to this again. The extension does a lot of what I need. It works great if it is called from any UIViewController. However, if I call it from a function that is not in a view controller then Swift says notificationAlert is not defined. There is another side

Re: Need for Swift

2019-10-16 Thread Jean-Daniel via Cocoa-dev
> Le 16 oct. 2019 à 11:49, Stephane Sudre via Cocoa-dev > a écrit : > > On Tue, Oct 15, 2019 at 2:26 PM Sandor Szatmari via Cocoa-dev > wrote: > >> But honestly, I don’t have enough Swift experience to know if you can write >> bad Swift code. > > I'm just reading Swift code here and there

Re: Need for Swift

2019-10-16 Thread Alex Zavatone via Cocoa-dev
> On Oct 16, 2019, at 4:49 AM, Stephane Sudre via Cocoa-dev > wrote: > > Why do Swift developers think it's mandatory to write code that is illegible? > Is Swift mainly used by freelances or consultants that will not have > to maintain the software? The zest to do things in a way, “because it

Re: Need for Swift

2019-10-16 Thread Stephane Sudre via Cocoa-dev
On Tue, Oct 15, 2019 at 2:26 PM Sandor Szatmari via Cocoa-dev wrote: > But honestly, I don’t have enough Swift experience to know if you can write > bad Swift code. I'm just reading Swift code here and there and it's my personal opinion that 75% of the Swift code I read is bad code. By bad cod