Still in the works on UITableView, I stumbled upon this:
[quote]Default Dimension
The default value for a given dimension.
Declaration
SWIFT
let UITableViewAutomaticDimension: CGFloat
OBJECTIVE-C
UIKIT_EXTERN const CGFloat UITableViewAutomaticDimension;
Constants
UITableViewAutomaticDimension
Requests that UITableView use the default value for a given dimension.
Available in iOS 5.0 and later.
Discussion
You return this value from UITableViewDelegate methods that request dimension metrics when you want UITableView to choose a default value. For example, if you return this constant in tableView:heightForHeaderInSection: or tableView:heightForFooterInSection:, UITableView uses a height that fits the value returned from tableView:titleForHeaderInSection: or tableView:titleForFooterInSection: (if the title is not nil).[/quote]
How would I declare it? I tried a variety of things, but none without a crash.
[code]Declare Function CFBundleGetBundleWithIdentifier Lib “CoreFoundation” (bundleID As CFStringRef) As Ptr
Declare Function CFBundleGetDataPointerForName Lib “CoreFoundation” (bundle As Ptr,
symbolName As CFStringRef) As Ptr
Static UIKitBundle As Ptr = CFBundleGetBundleWithIdentifier(“com.apple.UIKit”)
Static UITableViewAutomaticDimension As Single = CFBundleGetDataPointerForName(UIKitBundle,
“UITableViewAutomaticDimension”).Single[/code]
Don’t do this. There’s generally no API contract for OS X and iOS frameworks that say that the contents of a constant will be compared and there are places where the pointers are compared directly.