9191app / DKNightVersion

A light weight framework adding night version (night mode) to your app on iOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DSNightVersion

A light weight framework adding night version to your iOS app.

Build Status

Demo

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like DKNightVersion in your projects. See the Get Started section for more details.

Podfile

pod "DKNightVersion", "~> 0.4.3"

Usage

#import "DKNightVersion.h"

How to use

API documentation is not available now.

Using night color

This framework is based on a property nightColor, such as nightBackgroundColor nightTextColor...

Assign the night version color you want to the UIKit component:

self.view.nightBackgroundColor = [UIColor blackColor];
self.label.nightTextColor = [UIColor whiteColor];

Using DKNightVersionManager change theme

Use DKNightVersionManager sets the theme.

[DKNightVersionManager nightFalling];

If you'd like to switch back to normal theme version:

[DKNightVersionManager dawnComing];

Using property table generate color

property_table.yaml is a file which saves the night color you need, if the exising colors is not enough for you, add the class and property in it.

UIView:
  properies:
    - backgroundColor
UILabel:
  superclass: UIView
  properies:
    - textColor

Notice the superclass property is needed if it has a superclass.

ruby objc_generator.rb

Run this command in Classes/Generator folder, this will dynamically generate Objective-C code in Classes/UIKit/Auto folder.

Drag them in your workspace. And then everything works fine.

Contact

License

DKNightVersion is available under the MIT license. See the LICENSE file for more info.

Todo

Add UIButton support

About

A light weight framework adding night version (night mode) to your app on iOS.

License:MIT License


Languages

Language:Objective-C 70.2%Language:Ruby 28.9%Language:C 0.9%