Open iMessage in the App (iOS8)

To open an iMessage window, you only need to create MFMessageComposeViewController instance.  It is very easy to use and present it like other UIViewController.


Your viewcontroller should conform to protocol MFMEssageComposeViewControllerDelegate to handle actions within the MFMMessageComposeViewController.




Read More

IOS8 Modal View Controller like pop up

I thought this was a simple task, but the transparent background took me awhile to figure it out, so I am going to write it down here.

First must set the current view controller definesPresntationContext to YES, and popup view controller’s modalPresentationStyle to UIModalPresentationOverCurrentContext  

This setting allows the current context to be displayed as background when popup the new view controller.


Read More

LayerKit Atlas sending and receiving Image

Layer is a service that allow easy integration a chat function to the App.  I have been reading their document, and Atlas is a lightweight, flexible set of user interface components designed to enable developers to quickly and easily integrate native communications experiences into their applications. It was designed and built from the ground up to integrate with LayerKit the native iOS SDK for accessing the LayerKit communications platform.

Sending Image is basically automatically handle by Altas, but in order to view the image after receiving, you must set up autodownloadMIMETypes property for Layer Client.  



Read More

NSPOSIXErrorDomain Error Code 57

I was writing an iOS app to connect to a socket server.  When I ran on the simulator, I kept getting error and disconnected immediately.  The Error Code was 57, and Error Domain is NSPOSIXErrorDomain.  I was scratching my head for awhile because I knew that I tested it and it was working when I first time running it.

After an hour of research, I found out the reason.  When changing the network, I have to restart the iOS simulator.  After I restarted the simulator, the socket connection was working again.  FML!  LOL!

Read More