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

Can AFNetworking return data synchronously (inside a block)?

I have a function using AFJSONRequestOperation, and I wish to return the result only after success. Could you point me in the right direction? I’m still a bit clueless with blocks and AFNetworking specifically. -(id)someFunction{ __block id data; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id json){ data = json; return data; // […]

Draw segments from a circle or donut

I’ve been trying to figure out a way to draw segments as illustrated in the following image: I’d like to: draw the segment include gradients include shadows animate the drawing from 0 to n angle I’ve been attempting to do this with CGContextAddArc and similar calls but not getting very far. Can anyone help ?

How can I do Key Value Observing and get a KVO callback on a UIView's frame?

I want to watch for changes in a UIView‘s frame, bounds or center property. How can I use Key-Value Observing to achieve this?

Adjust UILabel height to text

I have some labels which I want to adjust their height to the text, this is the code I wrote for this now func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{ let label:UILabel = UILabel(frame: CGRectMake(0, 0, width, CGFloat.max)) label.numberOfLines = 0 label.lineBreakMode = NSLineBreakMode.ByWordWrapping label.font = font label.text = text label.sizeToFit() return label.frame.height } EDIT: The […]

Are there APIs for custom vibrations in iOS?

Starting in iOS 5, users are able to create custom vibration patterns for alerts and rings. The following screenshot shows the UI for creating one (Contacts app in iOS 6): I’ve been searching around, including the documentation, and I cannot find any public APIs that expose the creation or playback of custom vibrations. The closest […]

How to get UITableView from UITableViewCell?

I have a UITableViewCell which is linked to an object and I need to tell if the cell is visible. From the research I’ve done, this means I need to somehow access the UITableView that contains it (from there, there are several ways to check if it’s visible). So I’m wondering if UITableViewCell has a […]

/usr/bin/codesign failed with exit code 1

I am attempting to deploy my first development iPhone app, and am running into some problems. I have successfully went though the online Provisioning Assistant, but now I am stuck. No matter what I do, I always get the following error. /usr/bin/codesign failed with exit code 1 Anyone have any ideas why this is happening?

Creating layout constraints programmatically

I know that a lot people already asked tons of questions about this, but even with the answers I can’t make it work. When I’m dealing with constraints on storyboard, it’s easy but in code I have a hard time. I try, for example, to have a view that stays on the right side and […]

Swift Bridging Header import issue

Following instructions, I’ve created a bridging header and added to my project. Unfortunately, the following error occurred: :0: error: could not import Objective-C header ‘—path–to—header/….h’ In build settings I added header search path string to the location of bridging header, but nothing helped. Has anyone experienced this problem?

Unexpected CFBundleExecutable key

After spending some time googling, something tells me that the issue is new. We had a fully functional project supporting iOS7-8. Of course it was multiple times successfully submitted to AppStore. We use pods, lots of tracking and monitoring, like GA and Instabug. Now we decided to submit a version of the app built on […]