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

iOS PNG Image rotated 90 degrees

In my iOS application I’m writing, I deal with PNGs because I deal with the alpha channel. For some reason, I can load a PNG into my imageView just fine, but when it comes time to either copy the image out of my application (onto the PasteBoard) or save the image to my camera roll, […]

Update badge with push notification while app in background

I have got push notification working and managed to update icon badge count when app is brought to foreground. I am a bit confused about this though…the iPhone receives the notification and the pop up message appears to activate my app, and the badge only updates after me starting the app. This does not sound […]

Strange generic function appear in view controller after converting to swift 3

In my project, after converting to swift 3, a new function appeared before my ViewController class: fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool { switch (lhs, rhs) { case let (l?, r?): return l < r case (nil, _?): return true default: return false } } What does this function do? […]

How to Insert the UITextView into UIAlertview in iOS

Also, I would like this UITextView with the text file in XXX.txt.It works fine in iOS6, but content does not appear on the UIAlertview in iOS7. my code is given as below:- UITextView *tosTextView = [[UITextView alloc]initWithFrame:CGRectMake(12, 48, 260, 140)]; NSString *path = [[NSBundle mainBundle] pathForResource:@”TJTermsof Service” ofType:@”txt”]; NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL]; […]

Changing specific text's color using NSMutableAttributedString in Swift

The issue I am having is that I want to be able to change the textColor of certain text in a TextView. I am using a concatenated string, and just want the strings I am appending into the TextView’s text. It appears that what I want to use is NSMutableAttributedString, but I am not finding […]

in iPhone App How to detect the screen resolution of the device

In iPhone App, while running the App on device How to detect the screen resolution of the device on which App is running?

How do I use AVFoundation to crop a video

I’m trying to use AVFoundation to crop videos I’m recording. So lets say i create a AVCaptureVideoPreviewLayer and set the frame to be 300×300. AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session]; captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; captureVideoPreviewLayer.delegate = self; captureVideoPreviewLayer.frame = CGRectMake(0,0, 300, 300); [previewView.layer addSublayer:captureVideoPreviewLayer]; The user sees the video cropped. I’d like to save the video exactly […]

how to ENABLE_BITCODE in xcode 7?

I’m developing with and i get this problem upgrading to xCode 7. Some Parse Frameworks are not fully working. I’ve got this Warning : URGENT: all bitcode will be dropped because ‘/Users/[MY_USER]/Downloads/parse-starter-project-1/ParseStarterProject/Parse.framework/Parse(PFMutableFileState.o)’ was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or […]

How to add a border just on the top side of a UIView

My question is on the title. I don’t know how to add a border in a specific side, top or bottom, any side… layer.border draws the border for the whole view…

Create a custom animatable property

On UIView you can change the backgroundColour animated. And on a UISlideView you can change the value animated. Can you add a custom property to your own UIView subclass so that it can be animated? If I have a CGPath within my UIView then I can animate the drawing of it by changing the percentage […]