SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
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 Podle
                           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 dened 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
                           specied 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 
Play framework
Play frameworkPlay framework
Play frameworkAndrew Skiba
 
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
 
Bonjour, iCloud
Bonjour, iCloudBonjour, iCloud
Bonjour, iCloudChris Adamson
 
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
 

Ähnlich wie 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
 

KĂźrzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂşjo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

KĂźrzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

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 Podle 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 dened 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 specied 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 les. Tuesday, December 11, 12