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

How to make a clickable link in an NSAttributedString for a

It’s trivial to make hyperlinks clickable in a UITextView. You just set the “detect links” checkbox on the view in IB, and it detects http links and turns them into hyperlinks. However, that still means that what the user sees is the “raw” link. RTF files and HTML both allow you to set up a […]

Create singleton using GCD's dispatch_once in Objective C

If you can target iOS 4.0 or above Using GCD, is it the best way to create singleton in Objective C (thread safe)? + (instancetype)sharedInstance { static dispatch_once_t once; static id sharedInstance; dispatch_once(&once, ^{ sharedInstance = [[self alloc] init]; }); return sharedInstance; }

Set the maximum character length of a UITextField

How can I set the maximum amount of characters in a UITextField on the iPhone SDK when I load up a UIView?

Scroll View in my app doesn't work on iOS 11

My scrollview in app doesn’t scroll. Because it’s UIView and sets as a custom class, and reference UIViewScroll. It’s work iOS 10 and lower versions but doesn’t work on iOS 11. So how can I fix without recreate scroll view. Project created with Xcode 7 and swift 2.2, and updated swift 3 with Xcode 8.

UIButton can't be touched while animated with UIView animateWithDuration

I have the following code: [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationCurveEaseOut | UIViewAnimationOptionAllowUserInteraction animations:^{ CGRect r = [btn frame]; r.origin.y -= 40; [btn setFrame: r]; } completion:^(BOOL done){ if(done){ [UIView animateWithDuration:0.3 delay:1 options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{ CGRect r = [btn frame]; r.origin.y += 40; [btn setFrame: r]; } completion:^(BOOL done){if(done) zombiePopping = 0; }]; } }]; The […]

How disable Copy, Cut, Select, Select All in UITextView

The UITextView‘s Copy, Cut, Select, Select All functionality is shown by default when I press down on the screen. But, in my project the UITextField is only read only. I do not require this functionality. Please tell me how to disable this feature.

how to create iphone's wobbling icon effect?

I want to wobble an image back and forth in my application similar to how the iPhone icons wobble when you press down on it. What’s the best way to do that? This is my first foray into animations that’s not using an animated GIF. I think the idea is to slightly rotate the image […]

Is there a good charting library for iPhone?

I have a need to render and display charts (bar charts for now, but more types may be needed later) in an iPhone app I’m working on. I’ve done some looking around and it doesn’t look like there are any really good, mature charting libraries for iPhone yet. I’ve also looked for something written for […]

How to get device make and model on iOS?

I was wondering if it’s possible to determine what kind of iPhone (for example) the currentdevice is? I know it’s possible to get the model through NSString *deviceType = [[UIDevice currentDevice] model]; which will just return whether I have an “iPhone” or an “iPod”, BUT I was wondering if it’s possible to detect/know if I […]

Returning method object from inside block

I am wondering how to do the following correctly: I have a method that is to return an NSData object. It gets the NSData object from a UIDocument. The NSData object can get large, so I want to make sure it is fully loaded before the response starts. I would therefore like to return the […]