Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



LP0 ON FIRE posted:



Does this mean you can't simply see if a boolean is true by doing something like if(trueBool){...} and requires to put YES or TRUE like if(trueBool==YES){...} ?

No it means that only boolean values can be used like that. If you have an integer you need to go if(intValue != 0) etc but if trueBool {} is fine

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang




And Using Swift with Cocoa and Objective-C
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/index.html

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Damiya posted:

I'm not an iOS dev, so maybe this is a dumb question, but since there's no GC does that mean all memory management has to be done by the programmer?

It uses ARC, so memory management done by the compiler behind the scenes with retain counts.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



What's the difference between Array<String> and String[]? Are they just two different ways of describing the same thing?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Filburt Shellbach posted:

Yep, though I think it was mentioned in the book that String[] is the preferred style.

Nice, I prefer that too :)

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



rjmccall posted:

@objc protocols are implemented via Objective-C message sends, so optional methods are easy to do with just conformsToProtocol/respondsToSelector checks. There's an obvious way to implement this for Swift native protocols, but we just haven't done it yet.

something like @objc in the future being an alias for "messagable"?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Ender.uNF posted:

Oh yes, it's crazy. I'm going to try to buy if possible. I just can't pay 3000-4000 a month for an apartment.

Afaik you want to avoid buying because transfer of ownership means taxes get recalculated in California, so it might be more expensive in the end. Least that's what I heard, I've only rented there.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



rjmccall posted:

We designed it this way two years before that bug came out, but it's certainly a great reminder of why this is the right thing to do. It's also a great cudgel for convincing systems engineers to actually take advantage of the tools we give them.

I am into this, cause every time I write a simple statement like if (a) b() I am tempted to write it like that. Then I rethink it and add the braces, but then I'm like, this is too busy looking plust the braces aren't necessary. Being forced to make the right choice is sometimes a gift, at least if you're a huge idiot like I am.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



I'm playing around with generating Swift programmatically. In C/Objc-C/etc you can put #line 95 "file.ext" to make errors & such point to the correct line in the input file that the Swift is generated from. I guess I can't do that in Swift?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Alright, thanks :tipshat:

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Yeah, there aren't any copies until its necessary.

e: Re this, these WWDC sessions were really good imo:

Building Better Apps with Value Types in Swift
https://developer.apple.com/videos/wwdc/2015/?id=414

Protocol-Oriented Programming in Swift
https://developer.apple.com/videos/wwdc/2015/?id=408

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Most of you have probably seen this newsletter, but for those who haven't:

https://swiftnews.curated.co

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



swift ev proposal, murder everyone who makes grammar PRs

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



rjmccall posted:

I just saw a typography PR go by. They reformatted a document to use French spacing. One of my documents. Animals.

Burn them!

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



ultramiraculous posted:

The Swift compiler is right loving there guys what are you doing.

They're getting closer to the metal.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



that reminds me, are there plans to make swift more expressive?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



rjmccall posted:

No, it's too expressive as it is and we need to cut back.

Nice :c00lbert:

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



rjmccall posted:

That was my first question, but apparently it is super common in numerics.

im gonna tell on you dogg

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



theres really good docs on rjmccall leaking stuff imo

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



You can browse the archives:

https://lists.swift.org/pipermail/swift-evolution/

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



The book Cocoa Design Patterns by Yacktman & Buck taught me a lot about how Objective-C & Cocoa worked, but it's super old. I guess Swift is still too much of a moving target for a similar book on that?

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



dc3k posted:

Such a pain. After our migration we're left with 19 billion fileprivate declarations and it's really annoying to get everyone to update to the proper declarations as they find them. We either end up with pull requests polluted with irrelevant changes, or have to spend time going through each file to fix it all. :sigh:

Dare I say, having 19 billion declarations are a problem in itself ;)

  • Locked thread