Part 2: Installing Theme Manager

Durul Dalkanat
2 min readApr 28, 2017

Welcome to Part 2: Installing Theme Manager.

If you need check part 1 here you go.

We always need flexible and manageable project. Because our clients always want changes and addition features.

My first recommend for you ask color palette. This is not about just for Code Challenge, it is about for your next project. Here some examples

Question ? How could we build our IBOutlet with this color. I built DRL Theme Manager for color management for all color requirement.

DRL Theme Manager is an Xcode Swift File Template for Generating maximum required files to create a theme for Swift project. When the template is installed, it will create a DRL Theme Manager.swift

Installation

  • Clone this repo.
  • Copy the contents of the “DRL Theme Manager” directory of this repository into /Library/Developer/Xcode/Templates/File Templates.
  • Relaunch Xcode and select “File > New File”, or use the ⌘N keyboard shortcut.
  • Select the “DRL Theme Manager” category, then select the “DRL Theme Manager” file, and hit “Next”.
  • Select the license that you wish to use, and hit “Next”.

Or

  • Just type the commands below in terminal.
  • $ git clone https://github.com/durul/DRL-Theme-Manager.git
  • $ cd DRL Theme Manager
  • $ ./install-templates.sh
  • If you got a permission denied error while executing the script file, give it an execution permission.
  • $ sudo chmod 755 install-templates.sh

Update

On project directory type the commands below in terminal hit enter.

open combat.xcworkspace

We installed standart ThemeManager. However I want to use WWDC 2016 color palette. First and foremost, please update your ThemeManager.swift with codes below.

All comments are very important. Because Jazzy will create documentation for us automatically.

Usage

We completed all update on ThemeManager.swift. Now, we need to call ThemeManager file under the didFinishLaunchingWithOptions delegation methods and ViewController.

class ViewController: UIViewController {let theme = ThemeManager.currentTheme()override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = theme.backgroundColor
}

Now we have custom color background. CMD + R

Done!

Source code: https://github.com/durul/combat

Next Part 3: Installing Custom Log Manager

That’s it. 😃😃😃 Thanks for reading.

If you want to follow me in social media, here are some links. github, twitter, linkedin

You can check my previous article here.

--

--