Tag: swift

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’ […]

NSTextAttachment image not shown in NSTextView (but in UITextView)?

I am having issues getting a NSTextAttachment image to work in a NSTextView for an OS X application. The image of the NSTextAttachment is just not displayed at all. However, it still seems to be set correctly. Because when copying the contents of the NSTextView and pasting it back into e.g. TextEdit.app, the pasted text […]

How to modify SWIFT_MODULE_NAME?

The title says it all. I’ve searched in the build settings for SWIFT_MODULE_NAME, and nothing came up. I’ve also searched online, and there are references to this name, but there is no information on how it is defined. Furthermore, I couldn’t find any mention of SWIFT_MODULE_NAME in the Apple Docs. I do know this: it […]