Tag: swift

Simplify dictionary (xcode keeps indexing forever)

So I’ve encountered a bug, where xcode starts indexing my files forever, using all the processor time. I googled this problem and managed to understand that the following code is causing this bug: private struct Database { let db = [ “oasis” : [ “id” : “oasis”, “sector_id” : “oasis”, “name” : “Oasis”, “type” : […]

UIPickerView won't display the data loaded from NSUserDefaults – App is crashing while loading data

I made a first try to use NSUserDefaults in an App with UIPickerViews. But the App is crashing while testing / the data isn’t displayed in the PickerView. I still try to fix it myself but some help would be great. ViewController3: Where the user should save data to the NSUserDefault. Therefore there is an […]

Node movement lag in Spritekit, Xcode

In my game I have a node that the player controls with the PanGesture. When the PanGesture function is called, it adds its velocity to that of the Node in question, making it move. However, I have encountered a problem where the Node (under specific yet inconsistent circumstances) moves slower and not as smoothly as […]

Can an Obj-C AXObserverCallback be converted to Swift?

Can an AXObserverCallback be converted to Swift? The problem I am having seems to be with the void* which I know is not a valid type in Swift. I am attempting to convert Obj-C code to Swift and I am unable to get the code to compile. I am uncertain if the AXObserverCallback can be […]

Whats the easiest way to empty and save a Core Data Table in Swift?

So I have a entity, which I am treating as a simple Database Table in iOS8 XCODE and SWIFT. I want to delete every entry in the table. Permanently. So when I start up the app again they do not reload.This is my code. func deleteAllItems(){ println(“All Items are being DELETED”) var count:Int = 0 […]

Swift NSLocale Simulator iOS 8

I’m having an issue with Swift and the iOS 8 Emulator in XCode 6.1. Indeed when I try to use NSLocale, almost every functions of it return nil. Here is how I use it: let cc = “fr” // Example let locale = NSLocale.currentLocale() let countryName = locale.displayNameForKey(NSLocaleCountryCode, value : cc) println(countryName) // Shows : […]

XCode says 'Use of undeclared type' when trying to use a protocol defined inside a private Pod (Swift)

I and my team are stuck in a strange situation involving a base project + private pods with some protocols inside. Our problem is we can’t access some of the (protocol) identifiers (defined in a private pod) from our base app code. Apparently our problem seems to be exactly the same as the one described […]

Firebase Query not Executing Properly

I am trying to execute a Firebase query and it doesn’t seem to be working properly. I am trying to access the name of a School I have in the Firebase Database. The database looks like this: Schools { Random School Name { schoolLocation: Random Location uid: random UUID } } If I use the […]

How do you debug on breakpoints in swift on xcode?

I face trouble using po/p command in xcode using swift. It doesn’t work always and gives error most of the time. Also its response is not useful most of the time. For example, when i type “po user” it gives instead of its details and items which i could expand while using objective-c How do […]

Swift – App getting crashed in IOS 8.4 on launch with error _NSURLSessionTaskPriorityDefault

App is getting crashed on launch, with error log dyld: Symbol not found: _NSURLSessionTaskPriorityDefault Referenced from: /private/var/mobile/Containers/Bundle/Application/E302B99F-08D3-45C0-A8ED-F500052FF375/AppName.app/AppName Expected in: /System/Library/Frameworks/Foundation.framework/Foundation in /private/var/mobile/Containers/Bundle/Application/E302B99F-08D3-45C0-A8ED-F500052FF375/AppName.app/AppName IOS Target Version : 8.0 Swift : version 2.2 Device: Iphone 6 Device Version 8.4