|
I'm interested. But I'm curious as to why?
|
# ¿ Jun 2, 2014 20:16 |
|
|
# ¿ Apr 28, 2024 23:53 |
|
Read some of the book while flying this morning, excited to start trying it out. Thanks for answering our questions rjmccall!
|
# ¿ Jun 4, 2014 20:39 |
|
I think he was trying to be nice by not revealing what her heard because, as rjmccall had mentioned earlier, they try to keep their non released names quiet?
|
# ¿ Jun 6, 2014 14:15 |
|
I do iOS development for my job and I figured I should start learning how to use Swift, so I made TicTacToe. If anyone is bored could you please give me some pointers? I definitely found myself doing a lot of stuff incorrectly because I'm so used to Obj-C so I know I didn't do things in the proper "Swift" way (if that even exists?). https://github.com/BayPhillips/TicTacToe Thank you!
|
# ¿ Sep 22, 2014 02:47 |
|
eschaton posted:Where are your tests? YOLO eschaton posted:You should follow similar naming conventions to Objective-C with Swift, i.e. start properties and method names with a lower-case letter, make the name of a method read as a sentence, etc. I don't know why I ended up naming a lot of my properties and functions like that. For some reason I started combining C#/Java into it all. But do we really need to stay with the old naming convention? I'm used to it but . Also, howcome you can't right click -> refactor -> rename swift files? And yeah I need to move those classes into their own files. While I was making it I just kept it in one file so I could see it all while working on it. General code cleanup would be great.
|
# ¿ Sep 22, 2014 16:09 |
|
Doctor w-rw-rw- posted:deserializer. This
|
# ¿ Sep 22, 2014 20:57 |
|
Hey, could someone please clarify something in regards to using Swift code in Objective-C for me? I have a library, "CompatibleAlertController", that I've written in Swift and it works great. I want to also use it in Objective-C, but I want to add a prefix to it because it's "How We Do Things in Objective-C". So I add the following: code:
If so, why is it that the header file that gets generated for the Swift code to Objective-C ends up looking like this: code:
|
# ¿ Dec 4, 2014 16:57 |
|
No but I can! I always first assume that I'm doing something wrong and don't want to speak outta my rear end about something. I've never done it before but I'll do it tonight fleshweasel posted:It doesn't seem stable to try to make the class have different names in the two languages. Living with the prefix in swift is no big deal. Oh I know, but then I got yelled at because I added the prefix to the library by some nerds.
|
# ¿ Dec 4, 2014 19:52 |
|
Are you seeing the errors in the objective-c code that references the swift code in its bridging header file?
|
# ¿ Jan 24, 2015 23:11 |
|
Yeah, that's what I'd meant. But yeah, I had a lot of trouble with fake errors that went away when building that were "fixed" when I included it in each file I wanted to use it.
|
# ¿ Jan 24, 2015 23:32 |
|
Started new job where our new solution is all Swift. Are we doing something wrong where most of the objects aren't debuggable? I can't do po myObject anymore. Just get a slew of lldb errors. Is it some build configuration setting?
|
# ¿ Feb 5, 2015 02:45 |
|
Ender.uNF posted:Check for warnings or problems in your headers. If there's anything amiss it will put lldb into a tailspin. Hmm there was one about some weird rear end library search header. Trying it now. pokeyman posted:I'll get certain files or parts of certain files where any debugger action just spews errors instead. I can't be arsed to track down the problematic parts, but maybe knowing that you're not alone will help. Ugh this sucks. Do you also have Xcode randomly freak out and have the cursor jump around a file from time to time?
|
# ¿ Feb 5, 2015 16:02 |
|
So how the hell do we debug properly? println everywhere?
|
# ¿ Feb 5, 2015 16:55 |
|
Thanks for that rjmccall. While I understood about half of what you said, I do know that there's plenty of reasons for stuff not working. Definitely appreciate your perspective on it, just a bit frustrated at how unfinished it is. I know you're saying it should have been called a Beta, and I would have been cool with that label, but it sucks that Apple as a whole isn't calling it that. This is most definitely not a 1.0.
|
# ¿ Feb 5, 2015 21:42 |
|
Hey rjmccall, How do I println the size of an object in memory? I want to print the size of my NSCache but it yells at me when I try to do a malloc_size(UnsafePointer<NSCache>(self.cache)).
|
# ¿ Mar 5, 2015 00:39 |
|
rjmccall posted:The direct answer is that you can make an Unmanaged reference and then get that as an opaque pointer. Hmm, okay. Would instruments be the true way to get the actual size of those objects than?
|
# ¿ Mar 5, 2015 15:46 |
|
rjmccall posted:Instruments might help. It doesn't look like NSCache has much in the way of API for it; I think you're just supposed to trust that it's doing the right thing. Yeah, that's what I'm worried about! But thank you for the help! I've been learning quite a bit as I reinvent the wheel and create my very own super performant (read: non-crashing) image cache.
|
# ¿ Mar 5, 2015 22:07 |
|
Kallikrates posted:Not swift related, but if you have same sized images, or same sized groups of images you should look into Fast Image Cache from Path, its a cool library. We pull very large images out of it with zero latency. Fully aware of good, proven, image caches out there, definitely. Decision was to run our own so I do as I'm told!
|
# ¿ Mar 6, 2015 00:16 |
|
It all depends on the file you're currently editing. The more lines of code it has, the more likely the autocomplete is crashing and burning in the background and unable to actually do anything useful for you (besides causing Xcode to crawl and throw random errors at you).
|
# ¿ Apr 5, 2015 04:33 |
|
Anyone else use Circle CI / Travis CI for your builds with tests? Getting a lot of hangups and time outs in our Swift solution. Happens in both xcodebuild and xctool and I'm kind of at a loss.
|
# ¿ Apr 6, 2015 22:01 |
|
King of Gulps posted:I had some SJW <BS> in mine This was pretty funny
|
# ¿ Apr 13, 2015 14:26 |
|
Getting tons of segmentation fault: 11 errors with any action besides Run in Xcode 6.3.1 in our Swift solution. Anyone else running into this? Googling brings up other issues as well.
|
# ¿ Apr 24, 2015 16:18 |
|
*edit* Nevermind, I'm dumb and can't read.
|
# ¿ Apr 30, 2015 16:10 |
|
Hey rjmccall, We're getting segmentation faults during compilation on a select few view controllers. All of them inherit from a base subclassed UITableViewController. This crashes in any configuration where "Swift Compiler Code Generation - Optimization level is set to anything above [None]. We no longer get the segmentation faults after having removed any of the optimization levels. Have you seen this before? Doh004 fucked around with this message at 23:08 on May 5, 2015 |
# ¿ May 5, 2015 22:43 |
|
How're folks handling functions in Enums? Basically, I'm trying to grasp how "big" I allow some of my enums to get. For example, I have an activity tracker: code:
code:
code:
|
# ¿ May 28, 2015 20:27 |
|
Perhaps that wasn't the best example ever. I guess I'm more curious to people's thoughts as to when enums should own responsibility of more than just their values.
|
# ¿ May 28, 2015 22:26 |
|
pokeyman posted:I'm struggling to come up with a convincing reason for the enum to have anything unrelated to its value. You can certainly have methods, computed properties, and so on, but I reckon they shouldn't involve much beyond the enum itself. I could see that. Maybe for example I could do: code:
|
# ¿ May 29, 2015 02:38 |
|
Wish I could be there!
|
# ¿ Jun 8, 2015 16:38 |
|
Very cool news, congratulations rjmccall!
|
# ¿ Jun 8, 2015 20:00 |
|
Great job rjmccall! Super excited to get our stuff upgraded to 2.0
|
# ¿ Jun 10, 2015 16:24 |
|
The more Swift we do, the less and less I'm willing to allow force unwraps to make it through code reviews. Is that completely misguided or is having lots of if lets what we do with Swift?
|
# ¿ Jun 16, 2015 15:09 |
|
Playing with Swift 2 and I need to upgrade some code. Why can't I add @availability to stored properties?code:
quote:Stored properties cannot be marked potentially unavailable with 'introduced=' Thanks!
|
# ¿ Jul 7, 2015 23:31 |
|
rjmccall posted:Not sure, but it probably has something to do with the storage actually needing to exist and be initialized independent of the runtime OS version. I mean, it's not that these are unsolvable problems, but it's something that hasn't been done. Okay! Just wanted to ask as it is something that I'd really like to be able to do. I have a wrapper that is a compatible UIAlertController for iOS 7. I can't state that the entire class is only available to iOS 8 (therefore defeating the purpose) so I'm kinda unsure of how to proceed with Swift 2. Looks like I might need to refactor it out to a separate subclass? It's just confusing, because XCode offers this solution for the UIAlertControllerStyle: It looks like you should be able to do it. Doh004 fucked around with this message at 15:10 on Jul 8, 2015 |
# ¿ Jul 8, 2015 14:51 |
|
rjmccall posted:If we're offering an illegal fix-it, that's always a bug. Filed a bug on radar 21726433
|
# ¿ Jul 8, 2015 18:10 |
|
Swift is fantastic. The only thing (obviously generalizing here) holding it back is XCode, compilation times, and debugging randomly not working. It's just drat tiring.
|
# ¿ Jul 14, 2015 16:11 |
|
He was the same way before WWDC and Swift 2.0 soooo....
|
# ¿ Jul 21, 2015 18:14 |
|
Am I just mistaken, but do I need to add my UIViewControllers (and subsequent dependencies) to my test targets in order to unit test them? Particularly in the instance where I would like to instantiate my viewController from a Storyboard. This is for 1.2 of course. 2.0 can't come soon enough
|
# ¿ Aug 4, 2015 15:18 |
|
I don't see iOS 7 simulators in Xcode 7 Beta 5 to download. Will they be downloadable in the near future so we can still test for iOS 7?Meat Street posted:That's one way, or you can make the methods you want to test (and the classes they're declared in) public. Either way the issue you're running into is that your classes aren't exposed outside the app module, so your test target can't see them. Sorry I forgot to respond to this. My classes are public; however, when trying to load the storyboard, it assumes it's in the UnitTest module. Doh004 fucked around with this message at 14:58 on Aug 11, 2015 |
# ¿ Aug 11, 2015 04:43 |
|
Ender.uNF posted:LLDB gets very confused with certain Swift constructs. I haven't been able to find a pattern yet. Seemingly simple classes will cause the debugger to say it can't po self or some local variable. Closures seem to make it worse. In every case the variables pane shows everything just fine. I've given up trying to make sense of it. If I really need to debug something really badly, a quick clean, clean build folders and wiping out derived data fixes my problems (sometimes). If that doesn't work, well I just give up for the day and go home.
|
# ¿ Aug 17, 2015 02:26 |
|
|
# ¿ Apr 28, 2024 23:53 |
|
Anyone have any tips on how to cut down on compilation times? Or rather, how to find out why some files take forever to compile? I ran my build in XCTool and almost every one of our swift files take > 1000ms to compile, with the worst one coming in at > 6000ms. Google has suggested a tool to merge all swift code into one big file (because multiple files decreases compilation time), cutting down on nested type inference and last but not least: writing code in Objective-C.
|
# ¿ Aug 26, 2015 15:26 |