Coder Social home page Coder Social logo

resourcekit's Introduction

ResourceKit

MIT License platform

Enable autocomplete use resources in swift project.

まだハードコードで消耗してるの? ResourceKitで安全コーディング!

How does ResourceKit work?

ResouceKit makes your code that uses write for resources:

  • Becomes clear, nessary to cast and guessing easy what a method will return.
  • Checked, the mistaken character doesn't enter your app code.
  • Autocompleted, never have to exist hard code when using resource.
Standard use resources.
// Get ViewController
let storyboard = UIStoryboard(name: "Storyboard", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier: "XXXX") as! ViewController

// PerformSegue
performSegue(withIdentifier: "Open", sender: sender)

// Nib
let nib = UINib(nibName: "TableViewCell", bundle: nil)
let cell = nib.instantiate(withOwner: nil, options: nil)[0] as! TableViewCell

Please see ResouceKitDemo for more information, or Examples.md

Use ResourceKit.
// Get ViewController
let viewController = ViewController.instanceFromStoryboard() // <- viewController is ViewController class.

// PerformSegue
performSegueOpen() // <- can write to use autocomplete.

// Nib
let cell = TableViewCell.Xib.view() // <- easy get instance.

Features

After installing ResourceKit into your project, and build it. ResourceKit will correct any missing/changed/added resources.

ResouceKit supports resource types.

Installation

CocoaPods is the recommended way of installation, as this avoids including any binary files into your project.

Cocoapods

  1. Add pod 'ResourceKit' to your Podfile and run pod install.
  2. In Xcode: Click on your project in the file list, choose your target under TARGETS, click the Build Phases tab and add a New Run Script Phase by clicking the little plus icon in the top left.
  3. Drag the new Run Script phase above the Compile Sources phase and below Check Pods Manifest.lock, expand it and paste the following script: "$PODS_ROOT/ResourceKit/ResourceKit"
  4. Build your project, in Finder you will now see a ResourceKit.generated.swift in the $SRCROOT-folder, drag the ResourceKit.generated.swift files into your project and uncheck Copy items if needed

Manual

  1. Download a ResourceKit , unzip it and put it your source root directory.
  2. In Xcode: Click on your project in the file list, choose your target under TARGETS, click the Build Phases tab and add a New Run Script Phase by clicking the little plus icon in the top left
  3. Drag the new Run Script phase above the Compile Sources phase, expand it and paste the following script: "$SRCROOT/ResourceKit"
  4. Build your project, in Finder you will now see a ResourceKit.generated.swift in the $SRCROOT-folder, drag the ResourceKit.generated.swift files into your project and uncheck Copy items if needed.

TODO:

  • Cocoapods support.
  • Images support.
  • LocaliazedString Support.
  • Adjust indent.
  • Collaboration SegueAddition.
  • User Chose Generate Resource Support.

Help:

Q.When want to use a Third party UI Library, how should it be done

A. You can write import CustomView to ResourceKit.generated.swift.
And build again, but It's left import CustomView!

License

ResourceKit is released under the MIT license. See LICENSE.txt for details.

resourcekit's People

Contributors

bannzai avatar

Watchers

masaya-dake 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.