last day (149 days later) » 

8:54 PM
Welcome to Swift!
 
9:23 PM
Hi!
 
hi;)
 
Having fun learning the new language yet?
 
yea
always fun learning something new
 
I'm only on the first chapter of the book!
This playground seems pretty useful so far
 
I didn't read it yet, trying to make a simple app with my knowledge of objective C
 
9:28 PM
This exists..?
O...kay.
 
Destroy fellow Charcoalers! :P
 
user2629998
Oy
 
invades
Wait, we're not blue here
 
9:28 PM
CHARGE!!!
 
I tried to make a label that way and it failed
 
@AnnonomusPenguin ... that ping sounded so weird
 
@Logan Is there even any documentation yet?
 
There's an ebook
 
@Seth should be out today
 
9:29 PM
@Seth The book.
 
@Logan Ah.
 
Apple just released it, I don't know if it counts as docs though
 
@hichris123 the book is the Bible, technically
 
meh. the book of Swift. better?
 
amount of messages that are on-topic here now: ~5%
 
9:30 PM
got this atm
http://drop.ghservers.org/i/538cec034b819.png
 
oh well
 
@Doorknob Make that ~4% after the one you posted :D
 
@JordiKroon Yea, I tried to add a label and realized I should probably check the book out first.
 
Is the documentation about cocoa touch or just about swift?
 
Ooh, I can put objects and primitive data side by side in an array
I'm not sure, I assume it will talk about cocoa later, I'm just working through the basics right now.
Lemme check the chapters
Doesn't look like much about cocoa
 
9:35 PM
aah okay, I hate reading..
 
Has a couple examples about cocoa integration, might be a good starting place. It has side by side ObjC / Swift
 
thx
wow, I just created my first label xD
 
I'm trying to replace an object at an index in playground with fail :(
I guess if you have an array w/ primitive types its immutable?
or something weird is happening, not really sure.
 
Logan, is their any difference between let and var?
 
let is constant var is variable
so I think if your variable is always the same object, you use let, if it might change, use var
 
9:49 PM
ah oke, so if I want a label with text "something" I can use let, but when I want to change the label later to "Something else" I should use var
 
No,
because the text is a property of the label, not the label itself
as long as the variable 'yourLabel' will always point to the same memory, I think you use 'let'
If you wanted 'yourLabel' to later be a different label, use var
 
oke I understand it
 
Ok, I can change objects in mixed data type arrays, but I have to declare it an Array explicitly
Have you tried playground?
It's awesome! Instant debugging :)
 
I have tried it yes
Nice for fast code testing
cool documentation playgrounds
 
10:05 PM
Oooh, add objects to list w/ array += newObject
 
thats easy
 
10:23 PM
The more I use this playground, the more I like it.
 
Yes, but xcode 6 is very unstable
 
Yea, crashed the first three times I opened it.
 
Did anyone's computer completely crash?
My mbp froze completely and I had to hard reboot
 
Not yet but the fist DP is very unstable and lots of apps do crash
 
Also func makeIncrementer() -> (Int -> Int) does that mean a function that returns a function that returns an Int?
 
10:36 PM
I'm in the functions ection now, I'll let you know in a se
 
ok
 
Looks like it does
 
So it looks like when you make functions as params to functions you need to declare the return type of the function you are passing in
 
why this "Hello (TestConcat) World" as "Hello " + TestConcat + " World" is much clearer
 
What page?
 
10:42 PM
it would be "hello (TestConcat) World"
 
I think you can use whichever you prefer.
The () syntax is good for doing operations
For example, "The sum is: (someNumb + someOtherNumb)"
 
I thought it would be "hello \(TestConcat) World"
 
whereas this wouldn't work
 
oh
It's taking out the \\
There we go.
So it would be For example, "The sum is: \(someNumb + someOtherNumb)"
It's formatting those out.
 
10:44 PM
yes
 
yup
 
What page is that @D.Singh?
 
Lol nothing, I shouldn't try to learn something new when drunk
 
I like the variable arguments
Much simpler syntax
I'm confused about how to receive multiple returns from a function.
Oh, I figured it out ... works well with the inferred variable types
So var someReturn = getMultipleReturns()
someReturn.0 is object1
someReturn.1 is object2
 
@Logan you can get length of someReturn right?
 
10:49 PM
@Johnston Is this from the docs?
 
@Logan To what are you referring?
 
D.Singh -- I haven't found it
Johnston -- your function that returned a function that returned an int
NVM, I found it. Yes, I would say that is what it does.
 
@Logan Yes. Page 17
@Logan Ok
So you append to arrays by +=
 
This function: func testThis(Test:NSString, Test2:NSArray) -> String
 
Yup, I like that new append syntax
 
10:52 PM
When I call it I have to use object.testThis("test", Test2: objectArray);
 
Variable arguments excites me. The interaction is so simple and easy
 
Why do I need Test2 at the second parameter
and why I shouldn't need Test: for the first parameter
 
Not sure, If I work w/ cocoa, it let's me keep the little identifiers, otherwise it throws errors.
 
11:05 PM
How to I pass a function w/ no args and no return?
 
func test() { .. }
 
Now how would I pass that as an argument?
func passTest(someFunc: ->) {...}
?
 
hmm let me check
I don't think it is possible, an argument should always have a type, type nothing is impossible
 
shouldn't there be void though?
void is showing error
 
void is gone, its ()
No return type means void
 
11:14 PM
That's what I was trying first
Oh, I figured it out
I was passing the argument because I was doing
someFunc(someFuncAsArg())
instead of someFunc(someFuncAsArg)
so it was trying to submit the return type as the argument, which wasn't valid.
I'm dumb
 
newbie :D
 
Yea, that's bush league
 
haha
 
11:31 PM
That scrolling tab on safari looks nice
Oooh, and birds eye view :)
 
11:48 PM
void is just capitalized ... it does exist though!
Or rather, doesn't exist
 
Anyone know about this ItemType?
 

  last day (149 days later) »