Skip to content

Commit

Permalink
Fix theme path and build as framework in example project
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddfawcett committed Nov 18, 2016
1 parent 4f35f6b commit 6a9e702
Show file tree
Hide file tree
Showing 7 changed files with 243 additions and 48 deletions.
230 changes: 184 additions & 46 deletions Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Notepad

class ViewController: UIViewController {

Expand Down
2 changes: 1 addition & 1 deletion Notepad/Element.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation

/// A String type enum to keep track of the different elements we're tracking with regex.
public enum Element: String {
case unknown = ""
case unknown = "x^"

case h1 = "^(\\#[^\\#](.*))$"
case h2 = "^(\\#{2}(.*))$"
Expand Down
24 changes: 24 additions & 0 deletions Notepad/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions Notepad/Notepad.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Notepad.h
// Notepad
//
// Created by Rudd Fawcett on 11/17/16.
// Copyright © 2016 Rudd Fawcett. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for Notepad.
FOUNDATION_EXPORT double NotepadVersionNumber;

//! Project version string for Notepad.
FOUNDATION_EXPORT const unsigned char NotepadVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Notepad/PublicHeader.h>


13 changes: 13 additions & 0 deletions Notepad/Notepad.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// Notepad.m
// Notepad
//
// Created by Rudd Fawcett on 11/17/16.
// Copyright © 2016 Rudd Fawcett. All rights reserved.
//

#import "Notepad.h"

@implementation Notepad

@end
2 changes: 1 addition & 1 deletion Notepad/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct Theme {
///
/// - returns: The Theme.
init(_ name: String) {
if let path = Bundle(for: object_getClass(self)).path(forResource: name, ofType: "json") {
if let path = Bundle(for: object_getClass(self)).path(forResource: "Notepad.framework/themes/\(name)", ofType: "json") {
if let data = convertFile(path) {
configure(data)
}
Expand Down

0 comments on commit 6a9e702

Please sign in to comment.