iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

PJSIP TLS connect() error: End of file (PJ_EEOF)

I’m getting this EOF error when attempting to register my iOS project with my Asterisk server. Without TLS everything is working. So I’m now going through the process of enabling TLS. I’ve recompiled the PJSIP libraries and configured the Asterisk server. I believe that is all correct. I can see the traffic occurring in an […]

Detect the specific iPhone/iPod touch model

Possible Duplicate: Determine device (iPhone, iPod Touch) with iPhone SDK I am making a game that utilizes the peer-to-peer bluetooth capabilities of the iPhone (and probably the iPod touch 2nd generation). However, to stop the users from trying to play a multiplayer on an iPod 1st gen and iPhone 2G I need to check for […]

iPad keyboard will not dismiss if modal ViewController presentation style is UIModalPresentationFormSheet

Note: See accepted answer (not top voted one) for solution as of iOS 4.3. This question is about a behavior discovered in the iPad keyboard, where it refuses to be dismissed if shown in a modal dialog with a navigation controller. Basically, if I present the navigation controller with the following line as below: navigationController.modalPresentationStyle […]

Can't decode custom class with NSCoder

I have a User Class that conforms to NSCoder and has properties that are also custom Classes that to conform to NSCoder. It successfully (to my knowledge) encodes when the app closes as seen below. AppDelegate Class: func applicationWillTerminate(_ application: UIApplication) { saveuser() } saveuser(): func saveuser() { let isSuccessfulSave = NSKeyedArchiver.archiveRootObject(globUs, toFile: User.archiveURL.path) if […]

Why when this URL for calling runs, it shows nil instead of the number in my UITextField?

Currently I am working on an app and when a phone number is typed into my UITextField it is called after pressing a notification action by running a URL. But the problem is that it is calling a phone number that says 645 instead of any phone number that I type in, I figured out […]

How to show “Done” button on iPhone number pad

There is no “Done” button on the number pad. When a user finishes entering numeric information in a text field, how can I make the number pad disappear? I could get a “Done” button by using the default keyboard, but then users would have to switch to the numeric keys in order to input numbers. […]

how to use sks animation file as texture

here’s the code. func createbrick(){ let brick = SCNBox(width: 4, height: 2, length: 2, chamferRadius: 0.2) let bricknode = SCNNode(geometry: brick) bricknode.position = SCNVector3(x: 0, y: 1, z: Float(increZ(z: -5))) bricknode.physicsBody = SCNPhysicsBody.static() scene.rootNode.addChildNode(brick node) } can i do //fire is the name of my sks file brick.firstMaterial?.diffuse.contents = SKEmitterNode(fileNamed: “fire”) if not how do […]

Using Auto Layout in UITableView for dynamic cell layouts & variable row heights

How do you use Auto Layout within UITableViewCells in a table view to let each cell’s content and subviews determine the row height, while maintaining smooth scrolling performance?

How do I export UIImage array as a movie?

I have a serious problem: I have an NSArray with several UIImage objects. What I now want to do, is create movie from those UIImages. But I don’t have any idea how to do so. I hope someone can help me or send me a code snippet which does something like I want. Edit: For […]

Convert between UIImage and Base64 string

Does anyone know how to convert a UIImage to a Base64 string, and then reverse it? I have the below code; the original image before encoding is good, but I only get a blank image after I encode and decode it. NSData *imageData = UIImagePNGRepresentation(viewImage); NSString *b64EncStr = [self encode: imageData]; NSString *base64String = [self […]