Search results for

Swift 6

49,211 results found

Post

Replies

Boosts

Views

Activity

Reply to How do I get a list of all possible values of a Swift enum?
I think you will still have to do it by manually creating a list of all possible values of your enum.Perhaps it might seem strange that an enum is not enumerable ... But apart from that I don't think it is particularly surprising.Maybe you could have a look at the new OptionSetType:https://developer.apple.com/library/prerelease/mac/documentation/Swift/Reference/Swift_OptionSetType_Protocol/index.html
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Reply to Abort trap: 6
Maybe the reason the compiler is crashing because your code is trying to override a stored property in obj-c with a computed property in Swift?I would recommend filing a bug with your example code above, since the compiler/sourcekit shouldn't be crashing like that, and should provide an error if there is a problem with the code.Is there a reason why you can't leave out the override of path: and just set it in init like you do with strokeColor?required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) strokeColor = UIColor.blackColor().CGColor path = staffPath() } override init() { super.init() strokeColor = UIColor.blackColor().CGColor path = staffPath() }
Jun ’15
Reply to Swift 1.2 and Swift 2 in the same project?
They did, however, promise binary compatibility so I'm sure they could find a way to allow you to keep using Swift 1.2 in Xcode 7.It's a little disappointing that I won't be able to test the new APIs in iOS9 or take advantage of improvements to LLDB until this all goes stable already, at which point my feedback has much less impact.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
console output in playgrounds 7
Hi,just wondering if the console output has been removed in playgrounds 7?A console panel is available for print() statements in playgrounds 6 when displaying assistant editor, but nothing shows up in (xcode) playgrounds 7. Is this a beta bug or have console panels been deprecated?.-nick
4
0
4.4k
Jun ’15
Using a cell in another file in Swift
I would like to keep the content of a UITableView cell in a separate file as I do in Objective-c even in my TodayExtension Swift table in order to wire it to the storyboard. Yet when I try to do it, it complaints it cannot find the class of the cell; this is the function I use:override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { println(indexPath) let cell = tableView.dequeueReusableCellWithIdentifier( TableViewConstants.cellIdentifier, forIndexPath: indexPath) as! TodayCell return celltodayCell is the class in another file it reports it cannot find:import UIKit class TodayCell: UITableViewCell { @IBOutlet var bus: UILabel @IBOutlet var stopAddress: UILabel! @IBOutlet var destination: UILabel! }Importing the file, even if not needed according the the Swift documentation, moved the error in the import statement.
5
0
1.3k
Jun ’15
UserDomainMask
I have downloaded some Code which had previously worked for the coder, who was able to run ok on his App.However when I try to use the code to save data to iphone memory I get an Error Message stating ...Use of unresolved Identifier UserDomainMask..I have tried using NSUserDomiainMask to replace it and that doesn't seem to solve the problem.It seems that the coder may have been using a Beta version of Xcode 6 for his App.Can anyone please tell me what should replace UserDomainMask in the code below?/ func documentsDirectory() -> string { let documentsFolderPath = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask, UserDomainMask, true)[0] as String return documentsFolderPath }Kind Regards.Del
0
0
322
Jun ’15
Reply to No notification
Hi - As I said earlier, I was not receiveing any notifications for iMessages or E-mails for ever since upgrading to iOS 9 and watchOS 2 Beta when it was released. I had done multiple repairings on the watch and shut down / restore cycles on the phone and nothing worked for more than a few minutes regarding notifications.But finally had SUCCESS yesterday and it continues to work through this morning. As I write this I am receiving my iMessages notifications on the watch and replying to them with no problem. Also receiving my e-mail notifications again. 1. Using iOS9 Apple Watch app on my iPhone I unpaired my watch completely.2. On the iPhone, did a complete Erase All Contents and Settings.3. Waited for iPhone to restart4. Setup the iPhone as a completely NEW iPhone instead of restoring from any backup5. Used my Apple ID to get my iCloud data (again, not from a backup on iCloud, just the stuff on iCloud, like iMessages, mail settings, contacts, etc)6. Waited a while to make sure everything from iCloud
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Any way to combine try with as?
...Its just as you expect given the syntax I used:do { if let x = try NSJSONSerialization ... as? [[ ..., ... ]]{ blah blah blah } // closing brace of let } catch { print(error) }This was just not obvious to me and I had to play around with it before it compiled, I still don't know if it works since I am still working on fixing 2.0 conversion problems...I entered a documentation bug report on this, since the try / catch section of the Swift programming guide doesn't touch on any of this (rdar://21330154)
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Reply to iOS 9 Beta battery life
I like the assumption people make here:You report your findings in a polite manner and :1) You become a peep who is dloading betas just for the heck of it2) You are in panic and shoud be more calm..3) You knew better it's a beta.... (of cours eit is ..this is why i am testing) you should know nnot to install beta (then why do they give it to us??)4) You only own a device (just cause you are reporting issues) why do you have beta on production device? (and who told you this is my production device?)5) It will be fixed so calm down (well i am sure it will..... do you really belive i expect ios 9 to have this battery life??)6) My favourite one... why don't you test like everyone does? Plugged in into the computer so nop worries about battery life!!!! (Yeah like MOBILE devices now have to stay plugged all day.... and of course if you have a training app under development.......who does't train with a power plug behind his back??).Again to all the haters please relax..and calm down..We know it is beta, we
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15