Coder Social home page Coder Social logo

augmify / dknightversion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from draveness/dknightversion

0.0 1.0 0.0 798 KB

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

License: MIT License

Ruby 10.08% Objective-C 76.62% C 0.66% HTML 12.65%

dknightversion's Introduction

DKNightVersion

DKNightVersion is a light weight framework. It's built through objc/runtime library, providing a neat approach adding night version to your iOS app. A great many of code for this framework is generated by Ruby script.

The most delightful feature of DKNightVersion is that it appends one more property nightColor to frequently-used UIKit components. It is easily-used and well-designed. Hope you have a great joy to use DKNightVersion to integrate night mode in your Apps.

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.5"

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];

Contact

License

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

Todo

  • Add more color support
  • Test
  • Documentation

Using property table generate color

Not recommend use property table for production.

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 generator.rb

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

And drag files generated just now in your workspace.

dknightversion's People

Contributors

bromine0x23 avatar draveness avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.