Tag: swift

Memory Increase in SpriteKit even though removeAllChildren called

I’ve been trying to fix a huge memory increase in SpriteKit for many weeks now but have found no solution. I have tried just about every method that I’ve come across online for managing memory in SK but am still having troubles. Here’s my situation: I first present the SKScene “HomeScreen” and from there I […]

observing contentSize (CGSize) with KVO in swift

I’m trying to observering collectionView.contentSize like this : func startObserveCollectionView() { collectionView.addObserver(self, forKeyPath: “contentSize”, options: NSKeyValueObservingOptions.Old.union(NSKeyValueObservingOptions.New), context: &SearchDasboardLabelContext) } override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) { if context == &SearchDasboardLabelContext { if object === collectionView && keyPath! == “contentSize” { print(change) } } } and in xcode terminal […]

Cocoapods Test Issue – Duplicate “one of the two will be used. which one is undefined.”

I’ve been trying to solve this issue for a couple days and haven’t found a solution. Whenever I try to run a test I receive the error shown below that there are duplicate classes. I tried these answers but I’m still receiving the duplicate error and my tests won’t run Cocoapods Warning – CocoaPods did […]

How to suppress warnings in Swift 3?

Using clang* I could do #pragma clang diagnostic push #pragma clang diagnostic ignored “-Wdeprecated-declarations” // … #pragma clang diagnostic pop However this does not work in swift. So how to do suppress warnings in Swift?

Swift: PrepareForSegue, Swift Cast failure

I would like to select one cell in my TableViewController. The text of the cell should be transferred via segue to FirstViewController’s label. I always get the error shown below. The identifier is correct. My code: override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { if (segue.identifier == “BackToCalculator”) { //let myRow = tableView.indexPathForSelectedRow().row+1 let vc = […]

How to loop through Array<Dictionary<String,String>> using Swift

Give me one Example and explanation for “loop through array<Dictionary<String,String>>using swift…

How to create selecting option UITableView similar in iOS Settings in Swift?

I’m developing an app that requires users to select one option from the list of the table view. It’s kind of similar to ringtone option in settings of the iPhone. I have attached a screen illustration of what exactly I’m trying to accomplish. Now I want that option that is selected to be able to […]

Swift Remove Object from Realm

I have Realm Object that save list from the JSON Response. But now i need to remove the object if the object is not on the list again from JSON. How i do that? This is my init for realm func listItems (dic : Array<[String:AnyObject]>) -> Array<Items> { let items : NSMutableArray = NSMutableArray() let […]

Use of unresolved identifier 'FlurryAdInterstitial'

I am trying to integrate Flurry Interstitial Ads using cocoapods in Swift and Xcode 7.1.1. I am following this documentation from developer yahoo site https://developer.yahoo.com/flurry/docs/publisher/code/ios/#tab=0 The instructions don’t seem to be working for me. First, I get this error in my AppDelegate.swift: Use of unresolved identifier ‘Flurry’ Then I found a closed issue in the […]

Cannot find module FBSDKCoreKit Cocoapods

I’m trying to integrate facebook into my app using CocoaPods, using the use_frameworks! tag, and according to facebook’s instructions here, also included the pod bolts. When I try use import FBSDKCoreKit in my appdelegate, I get a no such module ‘FBSDKCoreKit error. I’ve included my podfile below: source ‘https://github.com/CocoaPods/Specs.git’ platform :ios, ‘9.2’ use_frameworks! pod ‘Bolts’ […]