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

How to simplify a single complex UIBezierPath polygon in iOS

Problem: I have a user generated polygon (via registering user’s touches on screen) which can be simple or complex (complex means having unknown number of intersections) and I want to have a simple polygon resulting from the same points on the original polygon, something like an outline or a contour if you will. Possible solutions: […]

How to use armv6 third party libraries in an armv7 app?

I have two 3rd party libraries. One just has a build for armv6 and the other just has a build for armv7. I need to use both of them in my iOS enterprise application. I’ve asked the armv6 library vendors to supply a armv7 version, but they haven’t been able to do so. (Note: I’ve […]

Close app when internet is not available

I want to close my app when an Internet connection is not available. I check that, but how can I create an alert, and then close my app?

Passing parameter in url for GET method using afnetworking

i have url in which query is executed. https://<BASE_URL>/<TENANT_URL>/?query=where UserName=’abc’&companyId=&page=1&pageSize=25&filterResultByColumns=true i am escaping the remaining part after tenant url like this, NSString *requestUrl = [[NSString stringWithFormat:@”%@/?query=where UserName=’%@’&companyId=&page=1&pageSize=25&filterResultByColumns=true”,<TENANT_URL>,userCredential.userName]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; requestUrl = [NSString stringWithFormat:@”%@/%@”,baseurl,requestUrl]; Here is my GET request. AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; AFHTTPResponseSerializer *serializer = [AFHTTPResponseSerializer serializer]; serializer.acceptableContentTypes = [NSSet setWithObject:@”application/json”]; manager.responseSerializer = serializer; manager.requestSerializer = […]

UITableViewRowAnimation is ignored

I’m using NSFetchedResultsController to populate my table. The data in my table is sorted according to the timestamp in the ascending order (latest message at the bottom). More data is loaded via “infinite scroll” to the top: e.g. when user scrolls past the top, more messages are loaded. My NSFetchedResultsControllerDelegate is defined as usual, as […]

Disable/Enable back button from detail view

How can I disable the back button from the detail view controller?

how to check if rtmp or hls urls are exist or they'll give 404 error in swift

I need to parse some data from rss and open related links from parsed rss in swift 2, for example i want to check this link is valid or not: rtmp://185.23.131.187:1935/live/jomhori1 or this one : http://185.23.131.25/hls-live/livepkgr/_defint_/liveevent/livestream.m3u8 My code to check the validation of the url : let urlPath: String = “http://185.23.131.25/hls-live/livepkgr/_defint_/liveevent/livestream.m3u8” let url: NSURL = […]

How to exit NSThread

I am using a thread like this, [NSThread detachNewThreadSelector:@selector(myfunction) toTarget:self withObject the thread is running correctly, I want to quit the thread in the middle,how can I do this.If I use [NSThread exit] the application is hanging.

Objective-C / iOS: Converting an array of objects to JSON string

I am currently experimenting with the use of JSON for internet data transfer. I have been successful in receiving a JSON string and converting it into an NSDictionary, but have not been able to work out how to convert an array or dictionary of objects into a JSON representation. I have read a number of […]

Determine which share extension was used

Since the completionHandler on UIActivityViewController was deprecated in iOS 8, is there any way to determine which share extension/activity was used by the user?