Tag: swift

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

Firebase erroneously shows deleted data / Swift 3 / Xcode 8.2

I am new to coding and just started using Firebase, and I am running the below function which is basically trying to create 2 nodes, “Tournaments” and “Daily Games” (if they don’t exist already). The database tree should look like this: -London -City Game -Date(stringDate) // getting this from another function, returns 2016-16-12 -Tournaments -Daily […]

IBDesignable view not rendering

I have a simple @IBDesignable view that I have specified as the base class for a scene in my macOS storyboard. E.g., in Xcode 8, Swift 3: @IBDesignable class OvalView: NSView { @IBInspectable var strokeColor: NSColor = .black { didSet { needsDisplay = true } } @IBInspectable var brushSize: CGFloat = 5.0 { didSet { […]