Thursday, February 27, 2014

Google denies bidding on WhatsApp

Android and Chrome chief Sundar Pichai refutes reports that Google competed with Facebook to buy WhatsApp.



Sundar Pichai, Google's VP in charge of Android and Chrome.
(Credit: James Martin/CNET)
Google's Sundar Pichai has denied at Mobile World Congress that his company bid on WhatsApp, the popular mobile instant messaging and SMS app.
Pichai, senior vice president in charge of Chrome, Android, and apps, said in Barcelona this week that it was "simply untrue" that Google had offered to buy WhatsApp, reported the Telegraph.
An earlier report indicated that Google was outbid by Facebook for WhatsApp, which Mark Zuckerberg permanently friended for $19 billion. Google had reportedly offered $10 billion, according to Fortune.
Though there may not have been a formal bid from Google for WhatsApp to compete with the Facebook offer, that doesn't mean Google wasn't interested in WhatsApp. AppleInsider reported in 2013 that WhatsApp was asking Google for $1 billion, although WhatsAppdenied this. If those negotiations in fact did take place, they obviously fell through.
Another report indicated that Google CEO Larry Page met with WhatsApp co-founder and CEO Jan Koum in an attempt to convince him not to hook up with Zuckerberg.
Google declined to comment on the situation.

Friday, February 14, 2014

UIAppearance for Fun and Profit

Building custom user interfaces is something our iOS development team encounters on a daily basis. Anything you can do to make it faster to develop or make your reusable controls easily customizable is an easy victory. UIAppearance gives you this easy victory.
While UIAppearance isn’t a brand new topic, it seems to get less love than it should. UIAppearance is a protocol available since iOS 5 that allows a developer to quickly configure the appearance of user interface controls provided by Apple. The fact that that your custom controls can take part in UIAppearance is talked about even less. This post will cover the basics of using UIAppearance and will explore adding support to your custom interface components.

UIAppearance Basics

You’ll be glad to know that UIAppearance is a straightforward API with almost no learning curve. To use it you need only know three things.
  • Properties and methods exposed to UIAppearance are decorated with the UI_APPEARANCE_SELECTOR attribute.
  • The class method +[UIControl appearance] will set the UIAppearance system to apply the specified properties when the control is created.
  • The class method +[UIControl appearanceWhenContainedIn:] will set the UIAppearance system to apply the specified properties when the control is created, but only when it is created in the specified containers.
That is all there is to it. UI_APPEARANCE_SELECTOR+ appearance+ appearanceWhenContainedIn:

Adding some style to UINavigationBar

Let’s see how this works. Say you want to style your UINavigationBar to be something a little different than the standard iOS style. First, look at the header file for UINavigationBar (you can find this by right-clicking on the symbol and choosing ‘Jump to Definition’ on it in Xcode).
Search for UI_APPEARANCE_SELECTOR. You’ll see it attached to many of the properties and methods, but not all. This is your guide to what is available byUIAppearance. In our case, the first time we see the attribute is with:
1
@property(nonatomic,retain) UIColor *tintColor UI_APPEARANCE_SELECTOR;
This means that the tintColor property is available for UIAppearance. This means I can now apply a global style affecting the tint to all UINavigationBar objects by telling the appearance proxy:
1
[[UINavigationBar appearance] setTintColor:[UIColor redColor]];
Now, no matter where a UINavigationBar is displayed within my app, it will be tinted red. Classy.
You can make this even more specific by telling the style to only apply when it is inside your own YOURCustomViewController. Consider the code:
1
2
[[UINavigationBar appearanceWhenContainedIn:[YOURCustomViewController class], nil]
                               setTintColor:[UIColor redColor]];
You’ve now told it to only apply the red tint color when a UINavigationBar is displayed inside a YOURCustomViewController. However, if I add a UINavigationBarto another view controller, it will not be tinted red. Only in the case that an instance of a UINavigationBar is in the hierarchy below an instance of aYOURCustomViewController will it be tinted red. Still classy.
All of these appearance styles can be applied as early as you like in your application. For example, you can set all your styles in -[UIApplicationDelegate application:didFinishLaunchingWithOptions:].

Supporting different iOS versions

As can often occur when working with any API, certain versions of can provide different functionality. How can we build an application level style when the available methods and properties on Apple’s controls are changing?
Thankfully, Objective-C is a dynamic language that allows runtime introspection on your objects. In a similar style to how you would ask your object if it -respondsToSelector:, you can ask a class if it’s instances respond to a method as well.
Consider this sample:
1
2
3
if ([UINavigationBar instancesRespondToSelector:@selector(setShadowImage:)]) {
    [[UINavigationBar appearance] setShadowImage:awesomeShadow];
}
The shadowImage property is new to iOS 6. Using +[NSObject instancesRespondToSelector:, we can inspect whether any instance of an object of this type will respond to this selector. Since you’ll be using the class type to apply an appearance, not an instance, this class method will tell you if this property can be used.

Using UIAppearance in your custom UI views

As stated earlier, you too can take advantage of UIAppearance in your custom views. Following the same pattern as seen above, let’s create a UIButton subclass that provides a property through UIAppearance.
I want to expose the font of the label on a UIButton. After subclassing, I’ll create a property that is decorated with `UI_APPEARANCE_SELECTOR calledtitleFont.
1
2
3
4
5
@interface TWTButton : UIButton

@property (nonatomic, strong) UIFont *titleFont UI_APPEARANCE_SELECTOR;

@end
Next, I create the setter implementation and set the title label’s font property.
1
2
3
4
5
6
7
8
9
10
11
12
13
#import "TWTButton.h"

@implementation TWTButton

- (void)setTitleFont:(UIFont *)titleFont
{
    if (_titleFont != titleFont) {
        _titleFont = titleFont;
        [self.titleLabel setFont:_titleFont];
    }
}

@end
Now, you can set its appearance as if it was always available via UIAppearance:
1
[[TWTButton appearance] setTitleFont:myFont];
For a more detailed example of this, check out TWTButton.

Tuesday, February 4, 2014

Agile Development 101

What is Agile Development?

"Agile Development" is an umbrella term for several iterative and incremental software development methodologies. The most popular agile methodologies include Extreme Programming (XP), Scrum, Crystal, Dynamic Systems Development Method (DSDM), Lean Development, and Feature-Driven Development (FDD).
While each of the agile methods is unique in its specific approach, they all share a common vision and core values (see the Agile Manifesto). They all fundamentally incorporate iteration and the continuous feedback that it provides to successively refine and deliver a software system. They all involve continuous planning, continuous testing, continuous integration, and other forms of continuous evolution of both the project and the software. They are all lightweight, especially compared to traditional waterfall-style processes, and inherently adaptable. What is more important about agile methods is that they all focus on empowering people to collaborate and make decisions together quickly and effectively.

The Evolution of Agile Development

Many of the individual principles and practices that are promoted by agile development have been around for years, even decades. As opposed to implementing these best practices piecemeal, agile methodologies have "packaged" various customer, management, and in some cases, engineering practices and principles together in a way that helps guide teams through the process of rapidly planning and delivering working, tested software. Each of the agile methodologies combines both old and new ideas into refinements that are certainly greater than the sums of their parts.
While it is true that many of the practices associated with agile development have been around for quite some time, the average software development team has yet to embrace many of the principles and practices. Even today, the average software team does not iterate, does not deliver software incrementally, and does not practice continuous planning nor automate testing. Now that these practices have been combined in a manner that can more easily be understood and adopted, the trend appears to be rapidly changing for the better, especially during the last several years.
As with any new way of doing business though, Agile methods have generated quite a bit of controversy within the software community. Yet since their emergence, in project after project, they have continued to deliver higher quality software systems in less time than traditional processes. If you are a software development professional, you definitely owe it to yourself to become familiar with the theory and practice of agile development. Hopefully the information presented on this site can assist you in learning what agile is all about.