The document provides an overview and instructions for using SkinKit, an iOS framework for customizing the appearance of apps. It discusses installation, usage, and different approaches for skin creation including implementing a data source protocol, subclassing SKSkin or SKDefaultSkin, and creating a skin bundle. Subclassing SKDefaultSkin allows customizing colors and images with default assumptions for simplified skin creation.
4. Overview
Description
“SkinKit is an iOS framework that allows to easily
customize the appearance of your app.”
Tuesday, December 11, 12
5. Overview
Features
• Simple API for loading skins.
• Loading skins from bundles.
• Customization of regular views.
• Simple skin creation.
• Switch skin at runtime.
Tuesday, December 11, 12
6. Overview
Features
• Simple API for loading skins.
• Loading skins from bundles.
• Customization of regular views.
• Simple skin creation.
• Switch skin at runtime.
Demo App can!
Tuesday, December 11, 12
8. Installation
Requirements
• iOS 6.0 or newer.
• Xcode 4.5 or newer.
Tuesday, December 11, 12
9. Installation
Workspace
1. Get a copy from github.com/nubbel/SkinKit
2. Create a workspace in Xcode.
3. Copy your main project to the workspace or create a new
one.
4. Add the SkinKit project (not the demo!) as a sibling to the
workspace
5. Drag the libSkinKit.a to your project's "Link Binary with
Library" build phase.
6. Set header search path to: "$(BUILT_PRODUCTS_DIR)",
check “recursive”.
7. Add to "Other linker flags": "-ObjC".
Tuesday, December 11, 12
10. Installation
CocoaPods
1. Add dependency to your Podfile
platform :ios
pod 'SkinKit'
2. Run
$ pod install
3. Done!
Tuesday, December 11, 12
13. Usage
Customize regular views
// in your UIViewController subclass
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[SKSkinManager sharedSkinManager] applySkinToView:self.view];
[[SKSkinManager sharedSkinManager] applySkinToScrollView:self.scrollView];
[[SKSkinManager sharedSkinManager] applySkinToTableView:self.tableView];
[[SKSkinManager sharedSkinManager] applySkinToCollectionView:self.collectionView];
// if you don't know
[[SKSkinManager sharedSkinManager] applySkinToGenericView:self.view];
}
Tuesday, December 11, 12
14. Usage
Automatically skin views
[SKSkinManager sharedSkinManager].automaticallyApplySkinForViews = YES;
A category on UIViewController takes
care of the rest!
Tuesday, December 11, 12
30. Skin creation
SKDefaultSkin - a magic SKSkin subclass
@interface SKDefaultSkin : SKSkin
// ...
@end
@implementation SKDefaultSkin
// magic’s going on here!
@end
Makes useful assumptions that make skin
creation a lot more intuitive and faster!
Tuesday, December 11, 12
49. Skin creation
Bundle
• A Bundle is a special kind of folder that has
the extension “.bundle”.
• Required when using custom images.
• Info.plist can contain style information.
• Can be used in addition or as alternative to
creating a skin class.
Tuesday, December 11, 12
51. Skin creation
Bundle name
• When used in addtition to a skin class the
bundle name must match the class name.
• Otherwise the bundle name must be
specified when creating the skin instance:
[[SKSkin alloc] initWithBundleName:@"BundledSkin"];
[[SKDefaultSkin alloc] initWithBundleName:@"BundledSkin"];
Tuesday, December 11, 12
56. Outlook
Planned features and improvements
• Shared skins.
• Custom layout.
• UICollectionView customization.
• Skin generator app (OS X or iOS).
• CSS files.
Tuesday, December 11, 12