Tag: swift

Unable to add WKWebView to Xcode Project

I have a ViewController that looks something like: import UIKit import WebKit class ViewController: UIViewController { @IBOutlet var webView: WKWebView! } In my storyboard I have a WKWebView as a subview of my main view. I’ve linked up the IBOutlet but when I run the application I receive: EXC_BAD_ACCESS (code=1, address=0x431) What am I doing […]

Begin UIPanGesture Event From A Pressed State At Time Of Instantiation

Is there a way to begin a UIPanGestureEvent if the finger is already pressed at the time the object is instantiated? I have a situation where when a user holds their find on a screen I create a UIView under their finger. I want them to be able to drag that around and as such […]

Receive Custom Notification iOS swift 2.0

I tried to receive my custom notification from my web through parse website. Code didReceiveRemoteNotification : func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { PFPush.handlePush(userInfo) if application.applicationState == UIApplicationState.Inactive { PFAnalytics.trackAppOpenedWithRemoteNotificationPayload(userInfo)} Here is the JSON i received from parse website : [aps: { alert = “test adirax”; sound = default; }] It works well […]

how to change statusbar color in one view controller using swift?

UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true) I use this one to change status bar to light in all app. But now I need to change it in just one View Controller back to black. How can I do that?

Swift Package Manager and Xcode: Retaining Xcode Settings?

I am developing a server in Swift and using the Swift Package Manager. And find it convenient when doing my development on my Mac OS system to generate a Xcode project to use Xcode as my IDE (i.e., From time to time, my package dependencies have to be updated. I’ve been using swift package generate-xcodeproj […]

Firebase causing “Thread 1: signal SIGABRT”

I started a blank Xcode project and all I did was add the Firebase framework via Cocoapods and import in the Appdelegate and viewcontroller. When I add FIRApp.configure() to didFinishLoadingWithOptions I get that error. If I remove that line but still have the framework imported it runs with no errors. This happens on a blank […]

How do you create an iOS liveView in Xcode 8/Swift 3

This question already has an answer here: iOS Playground doesn't show UI preview 7 answers

Call to swift method from JavaScript hangs xcode and application

I am writing an iOS App (using xcode 7.3 and swift 2.2) using JavascriptCode framework. Calling javascript methods from swift works perfect, but when I call the swift method from javascript, xcode simply shows a “loading” type of symbol and nothing happens. I need to “force quit” xcode to get out of this state. I […]

Type 'CFStringRef' does not conform to protocol 'Hashable' in Xcode 6.1

In my app i have a Keychain access class that was working in Xcode 6 but now in Xcode 6.1 i get some errors this is the first one: the Type ‘CFStringRef’ does not conform to protocol ‘Hashable’: private class func updateData(value: NSData, forKey keyName: String) -> Bool { let keychainQueryDictionary: NSMutableDictionary = self.setupKeychainQueryDictionaryForKey(keyName) let […]

Caught NSInternalInconsistencyException request for rect at invalid indexPath

The following line crashes the program: let cell = tableView.dequeueReusableCellWithIdentifier(“ItemCell”, forIndexPath: NSIndexPath(forRow: 0, inSection: 0)) as! ItemCell The console log shows the following error: “caught “NSInternalInconsistencyException”, “request for rect at invalid index path (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 – 0})” Here is a bullet point list of things I’ve checked: Correct Storyboard […]