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

Obtaining a server IP address from hostname

When performing an NSURLRequest to a hostname, is it possible to obtain the IP address of the server that the response came from? The NSURL method: – (NSString *)host; simply returns the hostname, and I see no way of obtaining the IP address from any of the other NSURL methods. Perhaps there is a way […]

Twilio call is not working in iOS and Android in react-native

i am trying to use twilio client in react native app. here is the link Twilio repo after done all setup with react native twilio .when i am calling a number getting issue . i used all steps give in this link . [tid:com.facebook.react.JavaScript] handler is not a function. (In ‘handler(rtn)’, ‘handler’ is undefined) 2016-09-27 […]

How to loop through an array of objects in swift

I’m trying to access the url of an object stored in an array, but I’m getting errors no matters what methods I’m using. let userPhotos = currentUser?.photos for var i = 0; i < userPhotos!.count ; ++i { let url = userPhotos[i].url } Here I get Could not find member ‘url’ and with a foreach: […]

iOS UICollectionView: Cells with circular view in alternating grid alignment

I’m trying to implement the UICollectionView for custom cells in the shape of circle. Now by default the circles are aligned in the same way as the normal square cell: top circle and bottom circle are on the same vertical line. How can I change the alignment to this: the top circle and two circles […]

Swift Custom Back Button and Destination

I am currently using SWRevealViewController for a sidebar menu in my app. When I click one of the options, the destination view controller doesn’t have a ‘back’ button because it hasn’t come from a proper view controller (i.e. page to go back to). Therefore I am wanting to manually create a back button on the […]

Audio interruption when iOS application is recording in background

My iPad sound application (iOS 7.1) is able to record while in background. Everything is ok as far as recording is not interrupted while in background. For example if one’s has the (stupid?) idea to start listening music while recording something. I tried to manage this interruption in different ways, with no success. The problem […]

iOS equivalent to Android Service?

So with iOS 7 supporting a broader background mode, is it possible to finally have an equivalent to Android Service on iOS? What I am after is essentially running app A in the background and have one or more apps B and C talk to that app (without showing the GUI of app A). Please […]

iOS Background Fetch Not Working Even Though Correct Background Mode Configured

My app has background modes enabled with Background Fetch checked and I validated the plist includes the appropriate fetch mode. I have also configured the interval as follows: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { application.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum); return true; } And I have added the handler as follows: func application(application: UIApplication, performFetchWithCompletionHandler completionHandler: […]

How to add cocoapods to existing workspace not project

I am working on a project which is composed of three other projects in a workspace. I want to use CocoaPods to manage my dependecies in the workspace, but CocoaPods always creates its own workspace with only one addtional project. What I want to do is to add CocoaPods project to the workspace that already […]

Get class from instance hex in Objective-C

When seeing an instance variable’s address in the debugger, how can one get the class by entering in the given memory address? I know that the opposite (getting the address from an instance) is possible with p someObjectInstance in the debugger or NSLog(@”%p”, someObjectInstance); from within the code. Is there a similar way to do […]