So, to be perfectly honest, I was not expecting anything groundbreaking at this years WWDC. I thought there would be iOS 8, which would have a few new features, but not TOO much. I mean, after iOS 7, there should definitely be some cool-down time before anymore big changes to the OS. I also thought they would probably talk about OSX 10.10, and there would be a few new features too. Not that I was expecting Apple to be lazy this year, but you can’t make something groundbreaking and amazing every single year.
Getting Started With NSNumberFormatter
So, you want to print out a floating point number. Do you want it to as high of accuracy as your computer can muster? In general, you probably don’t. If I was splitting a $43.89 check 4 ways, would you really want to know that the answer is $10.9725? Of course you could round the number yourself, but why, when you can simply use NSNumberFormatter!
Add sharing to your app via UIActivityViewController
Ever wonder what various apps like Photos or Safari use when you click on the share button? So did I until a few days ago. It is apparently UIActivityViewController. I just learned a bit about how to use it, so I thought I would pass it along.
Update November 10, 2014: Want to see how to use UIActivityViewController in Swift? Check out the my newer post Add sharing to your Swift app via UIActivityViewController [Read more…]
Using UILocalNotification
Have you ever wanted to have your app give a notification when it is not open, but don’t have a web backend? That’s where UILocalNotification comes in.
One caveat, UILocalNotification cannot open your app (at least as far as I know), so it can only run at pre-programmed times, but that is still useful in many situations.
An example use of UILocalNotification
UILocalNotification is pretty simple to setup in the simplest cases. Below is an example of one I used:
[Read more…]
Introduction to UIColor
For an app I am working on, I wanted to use some specific colors outside of the standard system ones. Using UIColor is pretty easy, but I thought I would share with you how to use it in its simplest form, and a help category I made to make working with the built in functions a bit easier, and a tool I JUST found while working on this post that would have been very nice last week. If you want to learn how to make a category, see my previous post Objective-C Categories.
Creating a UIColor Object
UIColor has several methods to generate a color based off of components. The available ones are:
- colorWithWhite:alpha:
- colorWithHue:Saturation:brightness:alpha:
- colorWithRed:green:blue:alpha:
- colorWithCGColor:
- colorWithPatternImage:
- colorWithCIColor:
But we are going to work with colorWithRed:green:blue:alpha: in this post.
Also, each of those has an init form (so colorWithRed:green:blue:alpha: is initWithRed:green:blue:alpha: ). This makes less difference in a post ARC world, but for reference, the initWith forms give your class ownership of the object, and so it must be released when you are done with it to avoid memory leaks. The colorWith form (also called a “Factory Method”), does not give your class ownership, so it does not need to be released by your class, that is handled by the system. Since ARC automatically counts your references, they are effectively the same for the programmer nowadays.
[Read more…]
- « Previous Page
- 1
- …
- 11
- 12
- 13
- 14
- 15
- 16
- Next Page »