Tallisoft.dk

Objective-C, iOS and Web.

UIView With Shadow and Rounded Corners

If you want to create a UIView in your iOS app, that both have a drop shadow, and rounded corners, you have to do some magic with the view layers. In order to make rounded corners, the view and/or layer will have to set maskToBounds = YES, which will cause a shadow in the same layer to disappear, as the shadow needs to go beyond than the view bounds.

Using iOS 6.1 SDK With XCode 5

When you upgrade Xcode to new newest version, it removes all other SDK’s than 7.0.

If you are in a situation where your iPhone or iPad app still have to support an iOS version below 7.0, or have a difficulty changing the app to adapt to iOS 7.0 new status bar handling, you don’t have to miss out on the new features and goodness in Xcode 5.

Browser Pixel Rounding

When developing web applications, rich or not rich, it is worth noticing that not all browsers handle pixel roundings equally. This is not based on which engine (webkit, mozilla etc) is used. So even though ie. Safari and Chrome both use webkit, they do not round pixels the same way.

Create Custom UIActivity

In iOS 6.0, Apple introduced at new way of sharing information from an iOS app. Using the UIActivityController will bring up an overlay, like the UIActionSheet, but with some default sharing options. These include SMS, Mail, Twitter, Facebook etc.

But what if you want a custom UIActivity that’ll perform a custom action in your application?

iOS Simulator vs. Real Device

As a hobby iOS developer, my primary iPhone is also my test device. Right now my phone is a iPhone 5, so I make sure to do alot of testing in Xcode/iOS simulator to check layout, functions, etc. of the app on iPhone4(S). But alas! Last week I submitted an update for an app that were to enter a competition. The update got approved for the App Store, the night before deadline. Phew! Just in time – I thought.

It turned out that one of my views that looked just fine on the iPhone 4 (In the simulator mind you), wasn’t looking the same on a actual iPhone 4!

This just goes to proves that the iOS Simualtor in fact is a SIMULATOR. So an advice, developer-to-developer, is to not solely rely on the Simulator when building iOS apps. Now I must return to coding, so my apps can make me a fortune, so that I’ll be able to buy a handful of phones for development!

Updated for iOS 7! Changing the Cancel-button Title in UISearchBar

Updated with iOS7 compatible code!

If you are writing a iOS app that contains of UITableView along with a UISearchBar, you might want to change the title of the cancel button, i.e. if you’re localizing your app.

But the cancel button isn’t that trivial to get a hold of. Here is some code that allows you to change the title:

New Blog Powered by Octopress

This is my first post on the blog on tallisoft.dk. So far I’m running it on Octopress and hosting it on Heroku. The blog will contain post on iOS and Web development. Stay tuned!