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

Change a UIViewController to a UITableViewController inside a storyboard?

I’ve made a view in my storyboard which I’ve now decided I’d rather display its data via static table cells. I can’t use static table views in a UIViewController (Static table views are only valid when embedded in UITableViewController instances). So, I need to convert my existing UIViewController to a UITableViewController somehow. I’ve changed the […]

How do I debug an iPhone app that's supposed to be launched by location services, into the background, from a terminated state?

We’re told, via Apple’s docs on startMonitoringSignificantLocationChanges that the following behavior can be expected by an application using the signification change API: If you start this service and your application is subsequently terminated, the system automatically relaunches the application into the background if a new event arrives. In such a case, the options dictionary passed […]

Exhaustive condition of switch case in Swift

The Apple documentation says Every switch statement must be exhaustive. That is, every possible value of the type being considered must be matched by one of the switch cases. So in new Xcode I have placed a code like this println(UInt16.min); // Output : ‘0’ println(UInt16.max); // Output : ‘65535’ var quantity : UInt16 = […]

Share link using whatsapp

I used these code for share app link in what’s app but nothing is come in the textfield of whatsapp. If using simple text then its work. Can anyone suggest the final outcome. NSString *theTempMessage = @”whatsapp://send?text=https://itunes.apple.com/in/app/myapp/id1054375332?ls=1&mt=8″; NSString *theFinalMessage; theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@”:” withString:@”%3A”]; theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@”/” withString:@”%2F”]; theTempMessage = [theTempMessage stringByReplacingOccurrencesOfString:@”?” withString:@”%3F”]; theTempMessage […]

How to implement a physical effect in SimCity 5, that a building swings when it is being moved?

It is hard to describe in plain text, so I recorded a GIF to demonstrate. https://public.lightpic.info/image/2B1F_582465841.gif I am currently working on a project that requires such effect. Up to now I have finished a similar effect on iOS with SpriteKit, however unfortunately it turns out the result is not pretty satisfying. This is my work: […]

UITextView data change swift

How can you detect a change of data in a UITextView with Swift? The following code does not do any detection. I am declaring the UITextView : @IBOutlet weak var bodyText: UITextView! optional func textViewDidChange(_ textView: UITextView!) { println(bodyText.text) } Thanks Scott

Attributed Text Center Alignment

I have tried everything but cannot seem to center this text. Can someone please tell me where the error is: NSMutableParagraphStyle *paragraphStyle = NSMutableParagraphStyle.new; paragraphStyle.alignment= NSTextAlignmentCenter; label.attributedText=[[NSAttributedString alloc] initWithString:cell.EventTitle.text attributes:@{NSForegroundColorAttributeName : [UIColor whiteColor],NSParagraphStyleAttributeName:paragraphStyle,NSBaselineOffsetAttributeName : @0,NSFontAttributeName : [UIFont fontWithName:@”BrandonGrotesque-Black” size:34],NSParagraphStyleAttributeName:paragraphStyle}];

Programmatically select text in UIWebView

I’m asking this question after 2 days of research. I’ve read all the related questions and answers in stackoverflow and google (including this question, which is very similar but without an answer) and still couldn’t find a solution. Hopefully someone here will be able to help. I have a UIWebView with some text loaded into […]

Location services don't stop when application is terminated

I’m currently developing an iPhone application which needs location services for various use including AR. I test everything on simulator and on my iPhone 3GS and everything went well. I recently tested on iPhone4 and on iPad2 and the location service (the little icon in status bar) keeps displaying even when I manually kill the […]

Application Specific Information: Application failed to launch in time (iOS)?

This is on the top of one of my crash reports. Is there any App Launch timeout limit determined by Apple? Any common workaround if so? Elapsed total CPU time (seconds): 13.700 (user 8.580, system 5.120), 67% CPU Elapsed application CPU time (seconds): 6.180, 30% CPU On an iPhone 3G. I have to split/delay my […]