SlideShare uma empresa Scribd logo
1 de 56
Baixar para ler offline
SkinKit
                           Dominique d’Argent




Tuesday, December 11, 12
Agenda

                   • Overview
                   • Installation
                   • Usage
                   • Skin creation
                   • Outlook

Tuesday, December 11, 12
Overview



Tuesday, December 11, 12
Overview
                Description




             “SkinKit is an iOS framework that allows to easily
                  customize the appearance of your app.”




Tuesday, December 11, 12
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
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
Installation



Tuesday, December 11, 12
Installation
                Requirements




                   • iOS 6.0 or newer.
                   • Xcode 4.5 or newer.


Tuesday, December 11, 12
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
Installation
                CocoaPods

               1. Add dependency to your Podfile
                           platform :ios

                           pod 'SkinKit'


                2. Run
                           $ pod install



               3. Done!


Tuesday, December 11, 12
Usage



Tuesday, December 11, 12
Usage
                AppDelegate




                // import framework headers
                #import <SkinKit/SkinKit.h>

                // in application:didFinishLaunchingWithOptions:
                SKSkinManager *manager = [SKSkinManager sharedSkinManager];
                manager.skin = [[MyFancySkin alloc] init];
                [manager applySkin];




Tuesday, December 11, 12
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
Usage
                Automatically skin views




               [SKSkinManager sharedSkinManager].automaticallyApplySkinForViews = YES;



               A category on UIViewController takes
               care of the rest!




Tuesday, December 11, 12
Skin creation



Tuesday, December 11, 12
Skin creation
                3 approaches




                   1. Implement SKSkinDataSource protocol
                   2. Subclass SKSkin
                   3. Create Bundle




Tuesday, December 11, 12
Skin creation
                3 approaches




                   1. Implement SKSkinDataSource protocol
                   2. Subclass SKSkin
                   3. Create Bundle




Tuesday, December 11, 12
Skin creation
                SKSkinDataSource
               @protocol SKSkinDataSource <NSObject>

               @required

               #pragma mark - Base colors
               - (UIColor *)backgroundColor;

               #pragma mark - Tint colors
               - (UIColor *)baseTintColor;
               - (UIColor *)accentTintColor;

               #pragma mark - Navigation bar
               - (UIColor *)navigationBarTintColor;
               - (UIImage *)navigationBarBackgroundImage
                            ForBarMetrics:(UIBarMetrics)barMetrics;

               #pragma mark - Controls
               - (UIColor *)controlBaseTintColor;
               - (UIColor *)controlAccentTintColor;
               - (UIColor *)controlThumbTintColor;

               // ...

               @end


Tuesday, December 11, 12
Skin creation
                SKSkinDataSource
               @protocol SKSkinDataSource <NSObject>

               @required

               #pragma mark - Base colors
               - (UIColor *)backgroundColor;

               #pragma mark - Tint colors
               - (UIColor *)baseTintColor;
               - (UIColor *)accentTintColor;

               #pragma mark - Navigation bar
               - (UIColor *)navigationBarTintColor;
               - (UIImage *)navigationBarBackgroundImage
                            ForBarMetrics:(UIBarMetrics)barMetrics;

               #pragma mark - Controls
               - (UIColor *)controlBaseTintColor;
               - (UIColor *)controlAccentTintColor;
               - (UIColor *)controlThumbTintColor;

               // ...

               @end


Tuesday, December 11, 12
Skin creation
                Implement SKSkinDataSource

               @interface MySkin : NSObject <SKSkinDataSource>
               @end

               @implementation MySkin

               - (UIColor *)backgroundColor { return [UIColor lightGrayColor]; }

               - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; }

               - (UIColor *)accentTintColor { return [UIColor purpleColor]; }

               - (UIColor *)navigationBarTintColor { return [self baseTintColor]; }

               - (UIColor *)controlBaseTintColor { return [self baseTintColor]; }

               - (UIColor *)controlAccentTintColor { return [self accentTintColor]; }

               - (UIColor *)controlThumbTintColor { return [UIColor yellowColor]; }

               // ...

               @end




Tuesday, December 11, 12
Skin creation
                Implement SKSkinDataSource

    @interface MySkin : NSObject <SKSkinDataSource>
    @end

    @implementation MySkin

    - (UIColor *)backgroundColor { return [UIColor lightGrayColor]; }

    - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; }

    - (UIColor *)accentTintColor { return [UIColor purpleColor]; }

    - (UIColor *)navigationBarTintColor { return [self baseTintColor]; }

    - (UIColor *)controlBaseTintColor { return [self baseTintColor]; }

    - (UIColor *)controlAccentTintColor { return [self accentTintColor]; }

    - (UIColor *)controlThumbTintColor { return [UIColor yellowColor]; }

    // ...

    @end




Tuesday, December 11, 12
Skin creation
                Implement SKSkinDataSource

    @interface MySkin : NSObject <SKSkinDataSource>
    @end

    @implementation MySkin

    - (UIColor *)backgroundColor { return [UIColor lightGrayColor]; }

    - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; }

    - (UIColor *)accentTintColor { return [UIColor purpleColor]; }

    - (UIColor *)navigationBarTintColor { return [self baseTintColor]; }

    - (UIColor *)controlBaseTintColor { return [self baseTintColor]; }

    - (UIColor *)controlAccentTintColor { return [self accentTintColor]; }

    - (UIColor *)controlThumbTintColor { return [UIColor yellowColor]; }

    // ...

    @end




Tuesday, December 11, 12
Skin creation
                3 approaches




                   1. Implement SKSkinDataSource protocol
                   2. Subclass SKSkin
                   3. Create Bundle




Tuesday, December 11, 12
Skin creation
                SKSkin
                @interface SKSkin : NSObject <SKSkinDataSource>
                // ...
                @end

                @implementation SKSkin

                - (UIColor *)backgroundColor { return nil; }

                - (UIColor *)baseTintColor { return nil; }

                - (UIColor *)accentTintColor { return nil; }

                - (UIColor *)navigationBarTintColor { return nil; }

                // ...

                @end


               Returns nil for all methods defined in
               SKSkinDataSource!

Tuesday, December 11, 12
Skin creation
                Subclass SKSkin


               @interface MySkin : SKSkin
               @end

               @implementation MySkin

               - (UIColor *)navigationBarTintColor {
                   return [UIColor redColor];
               }

               - (UIColor *)backgroundColor {
                   return [[self navigationBarTintColor]
                           lighterColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKSkin


               @interface MySkin : SKSkin
               @end

               @implementation MySkin

               - (UIColor *)navigationBarTintColor {
                   return [UIColor redColor];
               }

               - (UIColor *)backgroundColor {
                   return [[self navigationBarTintColor]
                           lighterColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKSkin


               @interface MySkin : SKSkin
               @end

               @implementation MySkin

               - (UIColor *)navigationBarTintColor {
                   return [UIColor greenColor ];
               }

               - (UIColor *)backgroundColor {
                   return [[self navigationBarTintColor]
                           lighterColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKSkin


               @interface MySkin : SKSkin
               @end

               @implementation MySkin

               - (UIColor *)navigationBarTintColor {
                   return [UIColor greenColor ];
               }

               - (UIColor *)backgroundColor {
                   return [[self navigationBarTintColor]
                           lighterColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKSkin


               @interface MySkin : SKSkin
               @end

               @implementation MySkin

               - (UIColor *)navigationBarTintColor {
                   return [UIColor greenColor ];
               }

               - (UIColor *)backgroundColor {
                   return [[self navigationBarTintColor]
                           lighterColor];
               }

               @end




Tuesday, December 11, 12
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
Skin creation
                Subclass SKDefaultSkin


               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor magentaColor];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor magentaColor];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor darkGrayColor ];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor darkGrayColor ];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor darkGrayColor ];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin

               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor darkGrayColor];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               - (UIColor *)backgroundColor {
                   return [UIColor underPageBackgroundColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin

               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor darkGrayColor];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               - (UIColor *)backgroundColor {
                   return [UIColor underPageBackgroundColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin

               @interface MyMagicSkin : SKDefaultSkin
               @end

               @implementation MyMagicSkin

               - (UIColor *)baseTintColor {
                   return [UIColor darkGrayColor];
               }

               - (UIColor *)accentTintColor {
                   return [UIColor yellowColor];
               }

               - (UIColor *)backgroundColor {
                   return [UIColor underPageBackgroundColor];
               }

               @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }

        - (UIImage *)navigationBarBackgroundImage
                     ForBarMetrics:(UIBarMetrics)metrics {
            return [self imageNamed:@"navigationBarBackground"];
        }

        @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }

        - (UIImage *)navigationBarBackgroundImage
                     ForBarMetrics:(UIBarMetrics)metrics {
            return [self imageNamed:@"navigationBarBackground"];
        }

        @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }

        - (UIImage *)navigationBarBackgroundImage
                     ForBarMetrics:(UIBarMetrics)metrics {
            return [self imageNamed:@"navigationBarBackground"];
        }

        @end



                           Loads image from Bundle:
             MyMagicSkin.bundle/Contents/Resources/navigationBarBackground.png



Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }

        - (NSString *)navigationBarBackgroundImageName {
            return @"navigationBarBackground";
        }

        @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }

        - (NSString *)navigationBarBackgroundImageName {
            return @"navigationBarBackground";
        }

        @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }




        @end




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin


        @interface MyMagicSkin : SKDefaultSkin
        @end

        @implementation MyMagicSkin

        - (UIColor *)accentTintColor {
            return [UIColor blueColor];
        }




        @end



               “navigationBarBackground” is the default
                             image name.

Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin




Tuesday, December 11, 12
Skin creation
                Subclass SKDefaultSkin




Tuesday, December 11, 12
Skin creation
                3 approaches




                   1. Implement SKSkinDataSource protocol
                   2. Subclass SKSkin
                   3. Create Bundle




Tuesday, December 11, 12
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
Skin creation
                Bundle structure



               Contents/
                 Info.plist
                 Resources/
                   navigationBarBackground.png
                   navigationBarBackground@2x.png
                   ...



Tuesday, December 11, 12
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
Skin creation
                Info.plist
               <key>CFBundleName</key>
               <string>BundledSkin</string>
               <key> SKSkinDataSource </key>
               <dict>
               ! <key>baseTintColor</key>
               ! <dict>
               ! !    <key>hex</key>
                      <string>#553a26</string>
               ! </dict>
               ! <key>accentTintColor</key>
               ! <dict>
               ! !    <key>rgb</key>
               ! !    <string>0.8 0.6 0.2</string>
               ! </dict>
               ! <key>backgroundColor</key>
               ! <dict>
               ! !    <key>name</key>
               ! !    <string>underPageBackground</string>
               ! </dict>
               </dict>


Tuesday, December 11, 12
Skin creation
                Info.plist
               <key>CFBundleName</key>
               <string>BundledSkin</string>
               <key> SKSkinDataSource </key>
               <dict>
               ! <key>baseTintColor</key>
               ! <dict>
               ! !    <key>hex</key>
                      <string>#553a26</string>
               ! </dict>
               ! <key>accentTintColor</key>
               ! <dict>
               ! !    <key>rgb</key>
               ! !    <string>0.8 0.6 0.2</string>
               ! </dict>
               ! <key>backgroundColor</key>
               ! <dict>
               ! !    <key>name</key>
               ! !    <string>underPageBackground</string>
               ! </dict>
               </dict>


Tuesday, December 11, 12
Skin creation
                Info.plist
               <key>CFBundleName</key>
               <string>BundledSkin</string>
               <key> SKSkinDataSource </key>
               <dict>
               ! <key>baseTintColor</key>
               ! <dict>
               ! !    <key>hex</key>
                      <string>#553a26</string>
               ! </dict>
               ! <key>accentTintColor</key>
               ! <dict>
               ! !    <key>rgb</key>
               ! !    <string>0.8 0.6 0.2</string>
               ! </dict>
               ! <key>backgroundColor</key>
               ! <dict>
               ! !    <key>name</key>
               ! !    <string>underPageBackground</string>
               ! </dict>
               </dict>


Tuesday, December 11, 12
Outlook



Tuesday, December 11, 12
Outlook
                Planned features and improvements


                   •       Shared skins.
                   •       Custom layout.
                   •       UICollectionView customization.
                   •       Skin generator app (OS X or iOS).
                   •       CSS files.



Tuesday, December 11, 12

Mais conteúdo relacionado

Mais procurados

Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010Sander van de Graaf
 
iOS Memory Management Basics
iOS Memory Management BasicsiOS Memory Management Basics
iOS Memory Management BasicsBilue
 
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Roland Tritsch
 
Writing CouchDB Views using ClojureScript
Writing CouchDB Views using ClojureScriptWriting CouchDB Views using ClojureScript
Writing CouchDB Views using ClojureScriptcemerick
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-entechbed
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative versionWO Community
 

Mais procurados (6)

Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010
 
iOS Memory Management Basics
iOS Memory Management BasicsiOS Memory Management Basics
iOS Memory Management Basics
 
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
Sbt Concepts - Tips, Tricks, Sandbox, ... 02/2013
 
Writing CouchDB Views using ClojureScript
Writing CouchDB Views using ClojureScriptWriting CouchDB Views using ClojureScript
Writing CouchDB Views using ClojureScript
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-en
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 

Semelhante a SkinKit

[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017Oracle Korea
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSPMin-Yih Hsu
 
Coding For Config: Install Profile Development Using Features
Coding For Config: Install Profile Development Using FeaturesCoding For Config: Install Profile Development Using Features
Coding For Config: Install Profile Development Using FeaturesMyplanet Digital
 
My Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveCMy Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveCJohnKennedy
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache AntShih-Hsiang Lin
 
WebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLSTWebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLSTenpit GmbH & Co. KG
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerMarcus Lönnberg
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Susan Potter
 
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2DIphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2Dcreagamers
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Satoshi Asano
 
Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...
Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...
Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...DevDay Dresden
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDocker, Inc.
 
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The PipelineDOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The PipelinePROIDEA
 
Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Netcetera
 
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixContinuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixFlorian Georg
 
Continuos integration for iOS projects
Continuos integration for iOS projectsContinuos integration for iOS projects
Continuos integration for iOS projectsAleksandra Gavrilovska
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS DevelopmentJussi Pohjolainen
 

Semelhante a SkinKit (20)

iOS
iOSiOS
iOS
 
[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017
 
Play framework
Play frameworkPlay framework
Play framework
 
From Android NDK To AOSP
From Android NDK To AOSPFrom Android NDK To AOSP
From Android NDK To AOSP
 
Coding For Config: Install Profile Development Using Features
Coding For Config: Install Profile Development Using FeaturesCoding For Config: Install Profile Development Using Features
Coding For Config: Install Profile Development Using Features
 
My Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveCMy Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveC
 
Introduction to Apache Ant
Introduction to Apache AntIntroduction to Apache Ant
Introduction to Apache Ant
 
WebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLSTWebLogic Administration und Deployment mit WLST
WebLogic Administration und Deployment mit WLST
 
Bonjour, iCloud
Bonjour, iCloudBonjour, iCloud
Bonjour, iCloud
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with Docker
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2DIphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...
Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...
Dev Day 2019: Mirko Seifert – Next Level Integration Testing mit Docker und T...
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
 
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The PipelineDOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
DOD 2016 - Sebastian Krzyszkowiak - Jenkins: The Pipeline
 
Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1Jazoon12 355 aleksandra_gavrilovska-1
Jazoon12 355 aleksandra_gavrilovska-1
 
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixContinuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
 
Continuos integration for iOS projects
Continuos integration for iOS projectsContinuos integration for iOS projects
Continuos integration for iOS projects
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 

Último

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

SkinKit

  • 1. SkinKit Dominique d’Argent Tuesday, December 11, 12
  • 2. Agenda • Overview • Installation • Usage • Skin creation • Outlook Tuesday, December 11, 12
  • 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
  • 12. Usage AppDelegate // import framework headers #import <SkinKit/SkinKit.h> // in application:didFinishLaunchingWithOptions: SKSkinManager *manager = [SKSkinManager sharedSkinManager]; manager.skin = [[MyFancySkin alloc] init]; [manager applySkin]; 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
  • 16. Skin creation 3 approaches 1. Implement SKSkinDataSource protocol 2. Subclass SKSkin 3. Create Bundle Tuesday, December 11, 12
  • 17. Skin creation 3 approaches 1. Implement SKSkinDataSource protocol 2. Subclass SKSkin 3. Create Bundle Tuesday, December 11, 12
  • 18. Skin creation SKSkinDataSource @protocol SKSkinDataSource <NSObject> @required #pragma mark - Base colors - (UIColor *)backgroundColor; #pragma mark - Tint colors - (UIColor *)baseTintColor; - (UIColor *)accentTintColor; #pragma mark - Navigation bar - (UIColor *)navigationBarTintColor; - (UIImage *)navigationBarBackgroundImage ForBarMetrics:(UIBarMetrics)barMetrics; #pragma mark - Controls - (UIColor *)controlBaseTintColor; - (UIColor *)controlAccentTintColor; - (UIColor *)controlThumbTintColor; // ... @end Tuesday, December 11, 12
  • 19. Skin creation SKSkinDataSource @protocol SKSkinDataSource <NSObject> @required #pragma mark - Base colors - (UIColor *)backgroundColor; #pragma mark - Tint colors - (UIColor *)baseTintColor; - (UIColor *)accentTintColor; #pragma mark - Navigation bar - (UIColor *)navigationBarTintColor; - (UIImage *)navigationBarBackgroundImage ForBarMetrics:(UIBarMetrics)barMetrics; #pragma mark - Controls - (UIColor *)controlBaseTintColor; - (UIColor *)controlAccentTintColor; - (UIColor *)controlThumbTintColor; // ... @end Tuesday, December 11, 12
  • 20. Skin creation Implement SKSkinDataSource @interface MySkin : NSObject <SKSkinDataSource> @end @implementation MySkin - (UIColor *)backgroundColor { return [UIColor lightGrayColor]; } - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; } - (UIColor *)accentTintColor { return [UIColor purpleColor]; } - (UIColor *)navigationBarTintColor { return [self baseTintColor]; } - (UIColor *)controlBaseTintColor { return [self baseTintColor]; } - (UIColor *)controlAccentTintColor { return [self accentTintColor]; } - (UIColor *)controlThumbTintColor { return [UIColor yellowColor]; } // ... @end Tuesday, December 11, 12
  • 21. Skin creation Implement SKSkinDataSource @interface MySkin : NSObject <SKSkinDataSource> @end @implementation MySkin - (UIColor *)backgroundColor { return [UIColor lightGrayColor]; } - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; } - (UIColor *)accentTintColor { return [UIColor purpleColor]; } - (UIColor *)navigationBarTintColor { return [self baseTintColor]; } - (UIColor *)controlBaseTintColor { return [self baseTintColor]; } - (UIColor *)controlAccentTintColor { return [self accentTintColor]; } - (UIColor *)controlThumbTintColor { return [UIColor yellowColor]; } // ... @end Tuesday, December 11, 12
  • 22. Skin creation Implement SKSkinDataSource @interface MySkin : NSObject <SKSkinDataSource> @end @implementation MySkin - (UIColor *)backgroundColor { return [UIColor lightGrayColor]; } - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; } - (UIColor *)accentTintColor { return [UIColor purpleColor]; } - (UIColor *)navigationBarTintColor { return [self baseTintColor]; } - (UIColor *)controlBaseTintColor { return [self baseTintColor]; } - (UIColor *)controlAccentTintColor { return [self accentTintColor]; } - (UIColor *)controlThumbTintColor { return [UIColor yellowColor]; } // ... @end Tuesday, December 11, 12
  • 23. Skin creation 3 approaches 1. Implement SKSkinDataSource protocol 2. Subclass SKSkin 3. Create Bundle Tuesday, December 11, 12
  • 24. Skin creation SKSkin @interface SKSkin : NSObject <SKSkinDataSource> // ... @end @implementation SKSkin - (UIColor *)backgroundColor { return nil; } - (UIColor *)baseTintColor { return nil; } - (UIColor *)accentTintColor { return nil; } - (UIColor *)navigationBarTintColor { return nil; } // ... @end Returns nil for all methods defined in SKSkinDataSource! Tuesday, December 11, 12
  • 25. Skin creation Subclass SKSkin @interface MySkin : SKSkin @end @implementation MySkin - (UIColor *)navigationBarTintColor { return [UIColor redColor]; } - (UIColor *)backgroundColor { return [[self navigationBarTintColor] lighterColor]; } @end Tuesday, December 11, 12
  • 26. Skin creation Subclass SKSkin @interface MySkin : SKSkin @end @implementation MySkin - (UIColor *)navigationBarTintColor { return [UIColor redColor]; } - (UIColor *)backgroundColor { return [[self navigationBarTintColor] lighterColor]; } @end Tuesday, December 11, 12
  • 27. Skin creation Subclass SKSkin @interface MySkin : SKSkin @end @implementation MySkin - (UIColor *)navigationBarTintColor { return [UIColor greenColor ]; } - (UIColor *)backgroundColor { return [[self navigationBarTintColor] lighterColor]; } @end Tuesday, December 11, 12
  • 28. Skin creation Subclass SKSkin @interface MySkin : SKSkin @end @implementation MySkin - (UIColor *)navigationBarTintColor { return [UIColor greenColor ]; } - (UIColor *)backgroundColor { return [[self navigationBarTintColor] lighterColor]; } @end Tuesday, December 11, 12
  • 29. Skin creation Subclass SKSkin @interface MySkin : SKSkin @end @implementation MySkin - (UIColor *)navigationBarTintColor { return [UIColor greenColor ]; } - (UIColor *)backgroundColor { return [[self navigationBarTintColor] lighterColor]; } @end 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
  • 31. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor magentaColor]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } @end Tuesday, December 11, 12
  • 32. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor magentaColor]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } @end Tuesday, December 11, 12
  • 33. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor darkGrayColor ]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } @end Tuesday, December 11, 12
  • 34. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor darkGrayColor ]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } @end Tuesday, December 11, 12
  • 35. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor darkGrayColor ]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } @end Tuesday, December 11, 12
  • 36. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } - (UIColor *)backgroundColor { return [UIColor underPageBackgroundColor]; } @end Tuesday, December 11, 12
  • 37. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } - (UIColor *)backgroundColor { return [UIColor underPageBackgroundColor]; } @end Tuesday, December 11, 12
  • 38. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)baseTintColor { return [UIColor darkGrayColor]; } - (UIColor *)accentTintColor { return [UIColor yellowColor]; } - (UIColor *)backgroundColor { return [UIColor underPageBackgroundColor]; } @end Tuesday, December 11, 12
  • 39. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } - (UIImage *)navigationBarBackgroundImage ForBarMetrics:(UIBarMetrics)metrics { return [self imageNamed:@"navigationBarBackground"]; } @end Tuesday, December 11, 12
  • 40. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } - (UIImage *)navigationBarBackgroundImage ForBarMetrics:(UIBarMetrics)metrics { return [self imageNamed:@"navigationBarBackground"]; } @end Tuesday, December 11, 12
  • 41. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } - (UIImage *)navigationBarBackgroundImage ForBarMetrics:(UIBarMetrics)metrics { return [self imageNamed:@"navigationBarBackground"]; } @end Loads image from Bundle: MyMagicSkin.bundle/Contents/Resources/navigationBarBackground.png Tuesday, December 11, 12
  • 42. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } - (NSString *)navigationBarBackgroundImageName { return @"navigationBarBackground"; } @end Tuesday, December 11, 12
  • 43. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } - (NSString *)navigationBarBackgroundImageName { return @"navigationBarBackground"; } @end Tuesday, December 11, 12
  • 44. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } @end Tuesday, December 11, 12
  • 45. Skin creation Subclass SKDefaultSkin @interface MyMagicSkin : SKDefaultSkin @end @implementation MyMagicSkin - (UIColor *)accentTintColor { return [UIColor blueColor]; } @end “navigationBarBackground” is the default image name. Tuesday, December 11, 12
  • 46. Skin creation Subclass SKDefaultSkin Tuesday, December 11, 12
  • 47. Skin creation Subclass SKDefaultSkin Tuesday, December 11, 12
  • 48. Skin creation 3 approaches 1. Implement SKSkinDataSource protocol 2. Subclass SKSkin 3. Create Bundle 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
  • 50. Skin creation Bundle structure Contents/ Info.plist Resources/ navigationBarBackground.png navigationBarBackground@2x.png ... 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
  • 52. Skin creation Info.plist <key>CFBundleName</key> <string>BundledSkin</string> <key> SKSkinDataSource </key> <dict> ! <key>baseTintColor</key> ! <dict> ! ! <key>hex</key> <string>#553a26</string> ! </dict> ! <key>accentTintColor</key> ! <dict> ! ! <key>rgb</key> ! ! <string>0.8 0.6 0.2</string> ! </dict> ! <key>backgroundColor</key> ! <dict> ! ! <key>name</key> ! ! <string>underPageBackground</string> ! </dict> </dict> Tuesday, December 11, 12
  • 53. Skin creation Info.plist <key>CFBundleName</key> <string>BundledSkin</string> <key> SKSkinDataSource </key> <dict> ! <key>baseTintColor</key> ! <dict> ! ! <key>hex</key> <string>#553a26</string> ! </dict> ! <key>accentTintColor</key> ! <dict> ! ! <key>rgb</key> ! ! <string>0.8 0.6 0.2</string> ! </dict> ! <key>backgroundColor</key> ! <dict> ! ! <key>name</key> ! ! <string>underPageBackground</string> ! </dict> </dict> Tuesday, December 11, 12
  • 54. Skin creation Info.plist <key>CFBundleName</key> <string>BundledSkin</string> <key> SKSkinDataSource </key> <dict> ! <key>baseTintColor</key> ! <dict> ! ! <key>hex</key> <string>#553a26</string> ! </dict> ! <key>accentTintColor</key> ! <dict> ! ! <key>rgb</key> ! ! <string>0.8 0.6 0.2</string> ! </dict> ! <key>backgroundColor</key> ! <dict> ! ! <key>name</key> ! ! <string>underPageBackground</string> ! </dict> </dict> 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