Tag: swift

iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta

This crash has been a blocking issue, basically I used following steps to reproduce the issue: Create a Cocoa Touch Framework project Add a swift file and a class Dog Build framework for device Create a Single View application in Swift Import framework into app project Instantiate swift class from the framework in ViewController Build […]

Save images in NSUserDefaults?

Is it possible to save images into NSUserDefaults as an object and then retrieve for further use?

How to take photo and save it at the same time (swift3)

Right now my code has 1 view, 1 button, and 1 image view. Currently the code takes the photo and places on the uniimageview. How can I write the code so that every time the photo is snap it will be saved to the photo gallery. I have already updated the plist settings. import UIKit […]

How to debug memory leaks when Leaks instrument does not show them?

I have an iOS app written in Swift that is leaking memory – in certain situation some objects should be released but they are not. I have learnt about the issue by simply adding deinit debug messages like this: deinit { println(“DEINIT: KeysProvider released”) } So, the deinit message should be present in console after […]

Is there a way to use my Rust library from Swift?

I am aware that this question has been asked before (nearly 2 years ago though), still, I’d like to encounter if there are any new methods or articles on this. I couldn’t find anything and am kind of a newbie to C-bridges, so that didn’t help me either.

How to implement real-time communication between iOS app and server in Swift?

I want to create the application which can add, edit the user. If the user already exists and the user enters in the office then camera device detects the user and match the user picture with the picture already stored in the server. If the user’s match is found on the server then it will […]

UIWebview not openning the Installed Application but opens in safari

I’m using a UIWebview and I had loaded an URL which shows an alert to open the native Application that has been installed on my iPhone. On clicking the alert the application doesn’t open in UIWebview but when I test the same URL in safari it works perfectly. Please let me know whether I have […]

Any Way to Run a project with Pod files Where Cocoa-pods is not Installed?

I have Mini mac With standard user rights. It don’t have any cocoa pods installed on it. I want to run a project that contains pod files in it. When i Try to run it says /Users/XXXXXXX-XXXX/Library/Developer/Xcode/DerivedData/XXXX-hkrwfroyuxqvcrecstbfqzyxetsv/Build/Intermediates/XXXX.build/Debug-iphonesimulator/XXXX.build/Script-5A7AA4516827BE2CA0B5E393.sh: line 2: /Users/XXXXXXX-XXXX/Downloads/IOS_APP_R3.2/XXXX/Pods/Target Support Files/Pods-XXXX/Pods-XXXX-frameworks.sh: Permission denied Note I can’t install cocoa pods on mac as i don’t […]

When should I compare an optional value to nil?

Quite often, you need to write code such as the following: if someOptional != nil { // do something with the unwrapped someOptional e.g. someFunction(someOptional!) } This seems a bit verbose, and also I hear that using the ! force unwrap operator can be unsafe and best avoided. Is there a better way to handle […]

Finding angle b/w two points

Here is my problem, whenever I tap on any button it should come to center, I am using CGAffineTransform and CABasicAnimation, but I am not able to get the angle I should rotate with, each of them is a button in circle, any help will be appreciated code for rotation func rotateBarrel(with duration:CGFloat,angle:Double) { let […]