Search results for

Swift 6

49,212 results found

Post

Replies

Boosts

Views

Activity

Java 6 issue SOLVED
Got it working: 1. Download the Java SE 8 DMG from http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html and install.2. In terminal enter the following to turn off rootless and then reboot: sudo nvram boot-args=rootless=03. In term enter these 2 lines: sudo mkdir -p /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
4. sudo mkdir -p /System/Library/Java/Support/Deploy.bundle
5. Turn rootless back on and reboot again: sudo nvram boot-args=rootless=1Enjoy!
2
0
1.3k
Jun ’15
Failable initializers for Classes
Hello,I was wondering about failable initializers in Swift. I noticed that for structs it works as expected (at least by me), for example this is fine:struct Test { var someState: Int init?(value: Int) { if value < 0 { return nil } someState = value // we set the value after validation } }But for classes swift wouldn't allow you to fail until you set internal states like so:class Test { var someState: Int init?(value: Int) { if value < 0 { someState = 0 // this seems unneeded return nil } someState = value } }This seems wrong. Why do I need to populate class' data with unneeded default values before I can fail the initialization? I can see that this is valid for both Swift 1.2 and 2.0 so what am I missing here?
4
0
1.7k
Jun ’15
SIMD Vector Operations in Swift 2
Hi, my first post here.In the video What's new in Swift at https://developer.apple.com/videos/wwdc/2015/?id=106, one of the points listed on the slide of new features (but not discussed) was SIMD vector operations.I looked in the pre-release The Swift Language iBook and couldn't find mention of SIMD, and anything concerning Vectors appeared to be to do with Advanced Operators (as in the previous versions of The Swift Language). Does anyone have any information about what was meant? Is the Accelerate framework being made obsolete? Will we even have to worry about this, or is it an internal compiler optimisation?Thanks,Geordie
5
0
6.3k
Jun ’15
Xcode 6 - Watch App, App icon displaced on real iPhone
I'm building my first Watchkit app, still on non-beta. I got my watch a couple of days ago so I want to deploy to real hardware.When I use XCode to target my iPhone, and run the iPhone app, it runs, but the phone app icon is not displayed normally on thephone, it shows up on the first home page screen, but it's underneath the first app icon, and not responsive. Same thing if I target the watch kit app.Here's a snapshot. I blurred the app icon a bit so as not to give away too much about the app.https://www.dropbox.com/s/l18rs9ts9fdf7jk/badIcon.png?dl=0When I open the Watch App, I see the app, and I can turn on show it on the watch but on the watch, it has no icon (I do have an AppIcon in images.xcassets in the watch app, but they don't show up on the watch, and when I try to run it on the watchSince I can't interact with the phone app button, the only way I found to delete it is to go into settings>usage and delete it.Any ideas what may be wrong here?
0
0
341
Jun ’15
Swift and ObjC interoperability
Hi!In the ios-charts repo, I've had to jump through crooked hoops to make everything available in ObjC.Some function interfaces are not exported to ObjC, and you can see an example here:https://github.com/danielgindi/ios-charts/blob/master/Charts/Classes/Components/ChartLegend.swiftIn the functions `extraColorsObjc`, `colorsObjc` etc.But the weirdest thing is where declaring a variable in the function header as mutable, it prevents the function from being exposed in ObjC for not reason at all!See `setMinimumScaleX`( where I've had to store that variable in a local variable in order to change it unintuitively) in https://github.com/danielgindi/ios-charts/blob/5eefb8fac453d26b65c47f22ab36d484d7de5854/Charts/Classes/Utils/ChartViewPortHandler.swiftNow is there something else that could be done that I'm missing? Maybe a special specifier to make those expose naturally instead of making those hacks?Thanks!Daniel
3
0
708
Jun ’15
Reply to Questions about NSCalendar
I'm getting a bit futher.let dayHourMinuteSecond = NSDateComponentsFormatter() dayHourMinuteSecond.allowedUnits = [.Day, .Hour, .Minute, .Second]Now conforms to the new way Swift 2.0 wants things formatted.I'm trying to figure out the calculated calendar time difference between two dates. Pretty simple. I think the function is the following: (using the autofill template),let userCalendar = NSCalendar.currentCalendar() let difference = userCalendar.components( <#T##unitFlags: NSCalendarUnit##NSCalendarUnit#>, fromDate: <#T##NSDate#>, toDate: <#T##NSDate#>, options: <#T##NSCalendarOptions#>)So my code with my variables would read (with the components used from the formatter above (which the compiler is happy with)let difference = userCalendar.components( dayHourMinuteSecond, fromDate: goHomeYoureDrunkTime, toDate: badPoetryDay, options: NSCalendarOptions)But I can't find any value that satisfies the Options for this. In my other code, WrapComponents was the only value that worke
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Automatic formatting of Swift code
There's a weird behaviour in Xcode when writing Swift code.Try to write this code for example:var fullName: Bool { get { return firstName + + lastName } set { splitFullName(fullName); } }Now what really happens is this:var fullName: Bool { get { return firstName + + lastName } set { splitFullName(fullName); } }That weird indentation is something that Xcode strongly insists on. And I know that although Apple developer seem to think that brackets on the same line is better for some reason, there's no way in **** they think that that indentation is correct!
6
0
11k
Jun ’15
Exchange Mail crashes Mail.app
Every time I try to launch Mail with an Exchange account, it crashes and logs an error about a Root Folder ID:6/11/15 11:58:30.328 AM Mail[711]: Root Folder Id changed from AAMkADE2NTQ2MmEzLWM5MTktNGRhZi04Y2VjLTc5OTBmYjYzYzgwNwAuAAAAAAB36UObOHIYTYg15OKpUhYCAQBxk81w29aJSJP4PRGq7mb6AAAAAX/sAAA= to AAMkADE2NTQ2MmEzLWM5MTktNGRhZi04Y2VjLTc5OTBmYjYzYzgwNwAuAAAAAAB36UObOHIYTYg15OKpUhYCAQBxk81w29aJSJP4PRGq7mb6AAAAAX/rAAA=: once an account is created, the root folder id shouldn't change on the serverIf I disable Exchange mail from the Internet Accounts system preference, it launches.
2
0
1.2k
Jun ’15