Enable autocomplete use resources in swift project.

Related tags

Utility ResourceKit
Overview

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.

You might also like...
Generates Heroku-style random project names in Swift

RandomProjectName.swift Generates Heroku-style random project names in Swift. Usage Just call String.randomProjectName(), and specify the optional suf

Project shows how to unit test asynchronous API calls in Swift using Mocking without using any 3rd party software

UnitTestingNetworkCalls-Swift Project shows how to unit test asynchronous API ca

Use this package in order to ease up working with Combine URLSession.

Use this package in order to ease up working with Combine URLSession. We support working with Codable for all main HTTP methods GET, POST, PUT and DELETE. We also support MultipartUpload

SwiftRegressor - A linear regression tool that’s flexible and easy to use

SwiftRegressor - A linear regression tool that’s flexible and easy to use

LibAuthentication will simplify your code when if you want to use FaceID/TouchID in your tweaks.

LibAuthentication will simplify your code when if you want to use FaceID/TouchID in your tweaks.

Alert popup to notify your users if they use an unsupported iOS version

UnsupportedOSVersionAlert This source code alerts your users if they use your app with an unsupported version of iOS (e.g. iOS 10.0 beta). The alert l

SwiftExtensionsPlayground - This playground includes some extensions that I like to use

This playground includes some extensions that I like to use. You can find exampl

WholesomeExtensions - A SPM package that provides some extensions that I like to use

WholesomeExtensions This package includes some extensions that I like to use. Yo

An open source Instapaper clone that features apps and extensions that use native UI Components for Mac and iOS.
An open source Instapaper clone that features apps and extensions that use native UI Components for Mac and iOS.

TODO: Screenshot outdated Hipstapaper - iOS and Mac Reading List App A macOS, iOS, and iPadOS app written 100% in SwiftUI. Hipstapaper is an app that

Comments
  • Can not be used for Objective-C?

    Can not be used for Objective-C?

    xcodeURL: file:///Users/allen/Desktop/xxx/xxx/PROJECT_FILE_PATHproject.pbxproj, target: GlobalRobot, errorInfo: file: /Users/hirose/develop/oss/ResourceKit/Sources/ResourceKitCore/Parser/ProjectResourceParser.swift, line: 18 missing write content Command /bin/sh failed with exit code 3

    Can not be used for Objective-C?

    opened by z306007236 10
Releases(0.4.8)
Owner
bannzai
bannzai
Strong typed, autocompleted resources like images, fonts and segues in Swift projects

R.swift Get strong typed, autocompleted resources like images, fonts and segues in Swift projects Why use this? It makes your code that uses resources

Mathijs Kadijk 8.9k Jan 4, 2023
GenStore is a lightweight swift code generator for your resources.

GenStore is a lightweight swift code generator for your resources. GenStore can create classes for your images, colors and localized strings.

null 11 Oct 23, 2021
ALO sync allows you to sync resources form an ALO endpoint to your macOS file system.

ALO sync allows you to sync resources form an ALO endpoint to your macOS file system. Prerequisites macOS 11 No support for search* No suppor

Lawrence Bensaid 2 Jan 22, 2022
Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Roy Marmelstein 2.3k Jan 3, 2023
🗃 Powerful and easy to use Swift Query Builder for Vapor 3.

⚠️ This lib is DEPRECATED ⚠️ please use SwifQL with Bridges Quick Intro struct PublicUser: Codable { var name: String var petName: String

iMike 145 Sep 10, 2022
SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

Gymshark 1 Jul 6, 2021
Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects

SwiftyPick ?? ?? Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects. Purpose The idea behind t

Manu Herrera 19 May 12, 2022
This repo shows how to setup and use GitHub Actions as a CI for Swift Packages

GACalc This repo shows how to setup and use GitHub Actions as a CI for Swift Packages. Available environments on GitHib List of the all available envi

Michał Tynior 0 Nov 3, 2021
A handy collection of Swift method and Tools to build project faster and more efficient.

SwifterKnife is a collection of Swift extension method and some tools that often use in develop project, with them you might build project faster and

李阳 4 Dec 29, 2022
This library project contains a few noise generators created in Swift.

SwiftNoiseGenerator This library project contains a few noise generators created in Swift. contains: Perlin Noise Simplex Noise How to use Edit your P

Ichiro HIROTA 1 Jan 20, 2022