Kellen Styler Logo
  • Kellen Styler Flickr
  • Kellen Styler Linked In
  • Kellen Styler Facebook
  • Kellen Styler Twitter
  • Kellen Styler RSS
  • Home
  • iOS
    • iPhone
    • iPad
    • Objective-C
    • iOS Tips and Tricks
    • iOpenSource
  • iOS Applications
    •   Mic Recorder for iPhone  
  • About Me
  • Get in Touch
  • KS History
    • KS V.15
    • KS V.14
    • KS V.13
    • KS V.12
    • KS V.11
    • KS V.10
    • KS V.9
    • KS V.8
    • KS V.7
    • KS V.6
    • KS V.5
    • KS V.3
    • KS V.2
    • KS V.1
  • iOS Application
Sitemap Archives
Home » iOS Tips and Tricks

iOS Tips and Tricks

I will be adding content to this page over time. Hopefully this will start to become a good resource to others starting out in iOS.

Enjoy!

^Organize with Pragma Marks

Pragma Marks are simple directives that you can add to your source code to help with organization. They can be added to both xcode header and implementation files and provide easier navigation to your function drop-downs.


Learn more about Pragma Marks

^Use Macros

Using Macros in your application brings several benefits. They make your code less verbose in addition to providing a central location for code shortcuts.

Take a look at how to add this useful tool to your projects…

Learn More about Macros

^Reverse ordered collections quickly

You can easily and quickly reverse a ordered collection with the code below.

orderedCollection = [[orderedCollection reverseObjectEnumerator ] allObjects ];

Learn More about reversing collections

^Use Fast Enumeration

Fast Enumeration provides better performance when running through collections and is less verbose.

for/in loop

for( id obj in collection )
	// your code for each object

Block Enumeration

[NSArray enumerateObjectsAtIndexes:(NSIndexSet *)
         options:(NSEnumerationOptions)
         usingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
         // Your code here...
} ];

Learn More about Fast Enumeration

^Use shadowPaths for CALayer shadows

This will improve performance when you add CALayer Shadows to elements in your application.

[UIElement.layer setShadowPath:[[UIBezierPath bezierPathWithRect:shadowBorder.bounds ] CGPath ] ];

Learn More about CALayer shadows

^Use Should Rasterize

Use the CALayer shouldRasterize property on objects that are static. Setting this to YES on an elements layer will tell it to render as a bitmap before compositing.

[UIElement.layer setShouldRasterize:YES ];

Learn More about Rasterizing layers

About Me



31
New York, NY

profile for Designerd at Stack Overflow, Q&A for professional and enthusiast programmers

Recent Posts

  • I am now at D3signerd.com
  • Turn FIXME, TODO, and !!! comments into compiler warnings within xcode
  • Customizing the Jump bar function menu in xcode with TODO, FIXME, and more
  • Add custom Warning messages to your code in Objective-C
  • Pragma Mark to organize your source code

Whats popular

Actionscript After Effects CALayer CSS Directive Fast Enumeration Fireworks FIXME Flash Flashbuilder Flex Flexbuilder Flickr Fonts Google Maps HTML Illustrator iOS iPad iPhone Macros NSArray NSDictionary NSMutableArray NSMutableDictionary NSMutableSet NSSet Objective-C OpenSource Photoshop PHP Pragma Mark Spark Spark Skin Swift 3D Swiz TODO UIImage UIView Warning Xcode


QR

Disclaimer

This blog contains my personal thoughts and experiments and not those of my employer.
Creative Commons
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Site Links
  • Sitemap
  • Archives
  • KS History

@pixelRanger *twitter

  • RT @bengfarrell: I'm learning Dojo now! Why not ExtJS? Why not just use jQuery? Here's why: http://t.co/EmChsT0d. 2012/02/21
  • My services for a glass of McAllen 12 year 2012/02/21
  • RT @mindmillmedia: Introducing the ST2 Power Tools project for Sencha Touch 2 Development productivity - http://t.co/E2dNu9C4 2012/02/14
  • Looking forward to what's next! @mindmillmedia: Getting Setup for Sencha Touch 2 Development on Your Mac - http://t.co/hAUV2cjO 2012/02/14
  • Need a loading gif? http://t.co/eNU6rUi3 2012/02/10

Mentors & Friends

  • Ben Clinkinbeard
  • David Tucker
  • Finch
  • Flex Cubed
  • Flex Food
  • Histos
  • Joao Pedro Canhenha
  • Merhl
  • Mike Nimer
  • Nate de Jager
  • The Keunster
  • Tj Downes
  • Trice Designs
  • Truth and Lies
  • Under the Influence of Design

Resources

  • Stack Overflow
  • Swiz Framework

Thank you for stopping by.      - Kellen Styler :: Designerd

WWW.KELLENSTYLER.COM | © 2006-2011 ALL RIGHTS RESERVED