What I Learnt Building 6 Real Estate iPhone Apps

I’ve built the following real estate related apps over the last few months. All of them are Singapore centric except for the rental yield calculator and the mortgage calculator.

  1. Progressive Payment Calculator 
  2. SG Stamp Duty Calculator
  3. Loan Affordability Calculator
  4. Property Tax Calculator
  5. Rental Yield Calculator
  6. Mortgage Calculator


  • When dealing with currency operations, just bite the bullet and use NSDecimalNumber. You’ll save yourself a lot of grief further down the road
  • Always try to use NSNumberFormatter for converting from NSNumber to NSString or the other way round. Don’t do things like self.label.text = @”$0.00″. Instead, do self.label.text = [self.formatter stringFromNumber:self.number] where self.formatter is a NSNumberFormatter property. Here’s how I instantiate my property.
    - (NSNumberFormatter *)formatter {
        if (!_formatter) {
            _formatter = [[NSNumberFormatter alloc] init];
            _formatter.numberStyle = NSNumberFormatterCurrencyStyle;
            _formatter.locale = [NSLocale currentLocale];
            _formatter.generatesDecimalNumbers = YES;
            [_formatter setLenient:YES];
        return _formatter;
  • If you’re dealing with percentages and you find yourself having to multiply/divide 100 at certain parts of your code, there’s a good chance you’re doing it wrong. Use NSNumberFormatterPercentStyle for NSNumberFormatter. Always work with the decimal form of your percent before formatting it for display at the final step.
  • Always test your app by changing the default region to another country which doesn’t have $ as it’s currency symbol. You can do so by going to Settings > General > International > Region Format. If you’re using NSNumberFormatter correctly, you should be safe.
  • Currency input sanitization can be annoying. Your sanitizer needs to handle the situations where
    • User input with currency symbol
    • User input without currency symbol

    as it was in my case. The initial input from the user doesn’t contain currency symbols. Once the formatter is applied and displayed, subsequent changes to the textfield will involve a currency symbol. It is probably worth noting that [self.formatter numberFromString:self.label.text] requires self.label.text to be in a format that contains the currency symbol otherwise it will return nil. This makes it annoying for the initial input where there isn’t a currency symbol and subsequent inputs where there is.
    My workaround for that is to enforce the currency symbol all the time. I use this little snippet to do so

Comment Scene Like Instagram

In my short stint with iOS programming thus far, I found that one of the most difficult and crucial part of the process is deciding which controller to use. Conceivably, you could use a plain UIViewController to design everything but that’s a poor man’s way of going about it. Here’s how I did the comment page for Instagram.

There are a few requirements:

  • Comment box should stick to the bottom
  • Autolayout should be used
  • UITableViewCell should resize accordingly to the amount of text required to fit the cell nicely
  • Bonus: works in landscape and portrait modes. Instagram doesn’t support landscape.

2014-04-24 12.26.36

2014-04-24 12.23.33







General process:

  • Insert a TableView into a UIViewController
  • Add a subview programmatically or via storyboard
  • Set the constraints up correctly
  • Animate the bottom constraint from the comment box to it’s superview as and when the keyboard appears

Some gotchas:

  • You can’t do this using a UITableViewController and then laying a subview into it.
    • The view will move along with the tableview as you scroll which is not the behaviour you want
  • You can’t do this using a UITableViewController and then adding the comment box in the footer
    • The footer will always be below the last cell in the tableview which is not what you want

Code: https://github.com/nychng/AutoSizeTableCell

UICollectionView Doesn’t Fill The Screen. Leaves a Top and Bottom Thin Black Margin

If you have a UICollectionView in a UIViewController, you might see something like the image shown here. There are two horizontal black space running across the top and bottom of the Cell. The reason for this is because you might have

- (BOOL)prefersStatusBarHidden {
    return YES;

The spacing seems to be space set aside for the status bar.

Screen Shot 2014-03-28 at 11.45.44 am

Next Set of iOS Queries to Answer

  1. In the storyboard, which layout to work in? 3.5 or 4 inch?
  2. Do you drag the size of your view all the way to the edge of the 4 inch? How does this affect the 3.5 inch view?
  3. In a navigation controller, the Top Bar pushes down content when there’s a scroll view. It doesn’t push it down in a normal view. Why?
  4. How to manage autolayout and scroll view?
  5. Should you lazy instantiate all of your properties all the time? Including all the UILabels and UITextFields?
  6. Assuming I want the height of a view to occupy the few screen, what should the height of the UIView be in a navigation controller (with and without the status bar)
  7. In View Controller, what does Extend Edges — Under Top Bars/Under Bottom Bars/Under Opague Bars

SEO Growth Hack on PropertyGuru

PropertyGuru is the biggest property search engine in Singapore. With Singapore taking the crown for Most Expensive City in the World recently, this is a pretty damn good time to be a property search engine. 

One of the features of a paid account with PropertyGuru is that Agents get a website for free. Here are a few examples:

They all have the same boiler plate layout with data extracted from their PropertyGuru account.

That’s a pretty cool feature, double dipping the data twice and charging the agents for it. But that’s not the growth hack. Each deployment of this custom website comes with a bunch of static pages which are actually removable by the agent.

Screen Shot 2014-03-04 at 2.34.59 pm

Each of the static pages are targeting a set of keywords. For example, in buying guide, the keywords targeted are: residential property, HDB, private residential property and executive condominium. Links with those anchor text leads back to their website whereas links leading to other websites have anchor text labelled as ‘here’.

Screen Shot 2014-03-04 at 2.35.33 pm

While this is great for PropertyGuru, it’s not so great for the individual agent and the reason for this is duplicate content. When Googlebot sees 10,000 different pages all with the same content, it’s going to place lesser value on each of these pages. To a certain extent, it will also affect the link juice following back to PropertyGuru. However, the benefits seem to outweigh the negatives for now as PropertyGuru is absolutely killing it at the moment.

If I were PropertyGuru, I would start randomizing the content generated by these static pages and inject ‘unseen’ HTML to make each page seem more authentic. Another thing that puzzles me is that PropertyGuru seems to be leaving link juice on the table. Given that they have full control over the content, a listing page like this: http://www.81238888.com/13971572 ought to have a link back to the original listing on PropertyGuru as well. Perhaps they are just being cautious.

If I were a Property Agent, I would definitely host my site on my own domain and set up a Real Estate Themed WordPress implementation. Over reliance on one marketing channel is a very risky long term strategy. Content marketing and promoting your own brand is definitely the only sustainable long term online marketing strategy.

If you’re wondering what Growth Hacking is, check out my previous blog post: Growth Hacking. What is it?.