Search results for

Swift 6

49,210 results found

Post

Replies

Boosts

Views

Activity

Reply to iOS 9 Beta battery life
Reposting this with more info:When the beta came out yesterday, I did an upgrade and not a restore. Today I litterally watched the battery percentage drop 1 percent every two minutes while I only had the home screen active (background apps disabled, location services disabled, etc). I kept checking the Settings -> Battery page and it show Home Screen at 15% of the usage, which was completely wrong.Today I did a complete restore and now things are better. The Settings -> Battery screen not only showed Photo App as the top user (I have over 8 gigs of phots and videos), but it also showed it as Background Activity. I didn't see that before I did the complete restore. Now, Mail, Messages and Calendar also show that. I'm sure the battery will still drain faster than with a production version, but at least it seems like the reporting is working correctly and it allowed me to understand what was sucking the life out of my battery.---------------------------------------------------------As an update, I have an
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Watch OS 2 Beta
Mine is stuck on a 3/4 finished ring. The second ring during the update - the first ring completed and the watch reset itself after that and started on a second ring (which is stuck). The iPhone 6 came back and said the Watch has been updated. I'm scared to touch it in case it just extremely slow - I think I'm stuck though. Thanks, Cory
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
CTRubyAnnotation changes (need help fixing error)
I'm currently running into some problems when creating an NSAttributedString that displays the ruby annotation for a string. var reading = [.passRetained(ねこ) as Unmanaged<CFStringRef>?, .None, .None, .None] let annotation = CTRubyAnnotationCreate(.Auto, .Auto, 0.5, &reading) as CTRubyAnnotationRef let attributed = NSAttributedString(string: 猫, attributes: [ NSFontAttributeName: font, NSVerticalGlyphFormAttributeName: verticalLayout, kCTRubyAnnotationAttributeName: annotation.takeUnretainedValue() ])This is giving me the error that CTAnnotationRef doesn't have a member named takeUnretainedValue.Has there been a change in swift or iOS 9 that now means the code doesn't work as expected? Also, is there a better way I could be creating the NSAttributedString?The code above works fine under swift 1.2 / iOS 8.Thanks,Matt Delves
0
0
264
Jun ’15
datamitigator Carousel quit unexpectedly
Every time I try to run a watch app in the simulator I get these errors:Carousel quit unexpectedlyApplication Specific Information:Assertion failed: (false), function -[CSLHexAppGraph decrementNeighborCountsForHex:], file /BuildRoot/Library/Caches/com.apple.xbs/Sources/Carousel_Sim/Carousel-342.5/Carousel/UI/Mazda/Models/CSLHexAppGraph.mm, line 859.CoreSimulator 159 - Device: Apple Watch - 38mm - Runtime: watchOS 2.0 (13S5254w) - DeviceType: Apple Watch - 38mmcom.apple.datamitigator quit unexpectedlyApplication Specific Information:*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSFileManager enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:]: URL is nil'terminating with uncaught exception of type NSExceptionabort() calledCoreSimulator 159 - Device: iPhone 6 - Runtime: iOS 9.0 (13A4254u) - DeviceType: iPhone 6Reinstalled xcode 7 twice now to see if it would fix
0
0
844
Jun ’15
Unable to download any beta software :(
Has anyone else experienced the problem when you try to download ios9, wos2, swift, xcode that you get redirected to your member account page and have to login. I am not receiving any of the 'sent' verification emails to confirm my account again. I've been a developer since 2011 and now it wants me to re-confirm....help please!-v4
3
0
542
Jun ’15
Cannot update Notes from iPad
Hi,I have iPhone 6 and iPad Air now. I've upgraded both devices to iOS 9 beta 1.On iPad, when I opend Notes.app, app asked me to update notes to enable new features, but I chose Not Now.Then in iPhone, I updated notes and completed successfully.When I came back to iPad and opened Notes.app, app asked me again to update notes so I accepted it this time, but it shows animated loading circle all the time and never completes.Anyone facing same issue?Regards,TKN
1
0
292
Jun ’15
Command Line Tool - Can't link to custom Swift Framework
With OS X Yosemite and Xcode 6, it was not possible to build a Swift command line tool that link to my own made or third party Swift Frameworks.Chris Lattner well explained in June 2014 to the community that we have to wait for ABI to reach the required level of stability, and because subject to change, the Swift libraries must be embedded in each app. Since a a Command Line Tool is not a bundle, we can't embed binaries.Fast forward today June 2015 we have OS X El Capitan beta, Xcode 7 beta and Swift 2.0.Under Yosemite, using Xcode 7 I recompiled my stuff to Swift 2.0 but I still can't link my Command Line Tool to the Swift Framework.Is someone have do similar build with success ? Do I need to build and run my Coammand Line Tool under El Capitan ?If its still not possible, I would like to know when the Swift ABI is planned for enough satbility and sytem level availabilty ?Thanks,Datagram
5
0
2.4k
Jun ’15
Safely "unwrapping" Objective-C pointers with nullability specifiers
If I have a non-null pointer in Objective-C and am using it from Swift, it's helpfully bridged as an optional. I can then safely unwrap it using `if let`.But what if I need to unwrap this point in Objective-C? Take this code:if (result.beacon) { [self startShiftWithBeacon:result.beacon]; // Incompatible pointer types sending 'CLBeacon * __nullable' to parameter of type 'CABBeacon * __nonnull' }I'd prefer not to cast everywhere, as that's ultimately unsafe, especially over time. Is there already a way to achieve this?
3
0
2.7k
Jun ’15
Questions about NSCalendar
Here's a code snippet that compiles and works as expected, but I get a warning for depricated use of the unit .NSYearCalendarUnit. This is within XCode 7 (Swift 2.0)Playground execution failed: /var/folders/37/2hl0kpw50lv18q1d48gbbb5r0000gn/T/./lldb/16158/playground8.swift:52:20: warning: 'NSYearCalendarUnit' was deprecated in iOS 8.0: Use NSCalendarUnitYear insteadvar TermEndDate = NSDate() if (TermYears>0) { TermEndDate = userCalendar.dateByAddingUnit( NSCalendarUnit.NSYearCalendarUnit, value: TermYears, toDate: TermStartDate, options: .WrapComponents )! } if (leaseMonths>0) { TermEndDate = userCalendar.dateByAddingUnit( NSCalendarUnit.NSMonthCalendarUnit, value: TermMonths, toDate: TermEndDate, options: .WrapComponents )! } If I switch to the recommended syntax, it errors out. /var/folders/37/2hl0kpw50lv18q1d48gbbb5r0000gn/T/./lldb/16158/playground8.swift:60:5: error: 'NSCalendarUnit.Type' does not have a member named 'NSCalendarUnitMonth'NSCalendarUnit.NSCalendarUnitMonth,
7
0
3.3k
Jun ’15
Reply to Questions about NSCalendar
Also.... I found a very informative website that has a ton of examples specifically on how to work with dates within Swift.Here's a code snippet that he uses as an example, but does not compile for me, and I have no idea why I get the error: could not find member 'CalendarUnitDay'. Was this syntax changed with Swift 2.0?Every example I could find uses this syntax, but for me... no luck.// Playground - noun: a place where people can play import UIKit let userCalendar = NSCalendar.currentCalendar() // Let's create some dates to work with // ==================================== // It's 3:45:30 a.m., New Year's Day. Time to go home. let goHomeYoureDrunkTimeComponents = NSDateComponents() goHomeYoureDrunkTimeComponents.year = 2015 goHomeYoureDrunkTimeComponents.month = 1 goHomeYoureDrunkTimeComponents.day = 1 goHomeYoureDrunkTimeComponents.hour = 3 goHomeYoureDrunkTimeComponents.minute = 45 goHomeYoureDrunkTimeComponents.second = 30 let goHomeYoureDrunkTime = userCalendar.dateFromComponents(goHomeYoureDru
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Reply to Questions about NSCalendar
They renamed some enums / options to be more consistent.In Swift, it would now be NSCalendarUnit.Year (type NSCalendarUnit, case .Year). If you double command-click on NSCalendarUnit (or NSYearCalendarUnit) in Xcode in your playground, it will pull up the Swift version of the header.And as far as the example code goes, OptionSets are handled differently now in Swift 2.0 and use set syntax instead of bitwise operators to join and test them.See the Xcode 7 beta release notes or https://forums.developer.apple.com/thread/3623 for more info on that.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15