Skip to content

Commit d2fcf49

Browse files
author
Bernard Gatt
committed
Merge branch 'release/0.6.0'
2 parents 8198306 + 26299e1 commit d2fcf49

15 files changed

Lines changed: 549 additions & 57 deletions

File tree

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: objective-c
2+
3+
xcode_project: StyleKit.xcodeproj
4+
xcode_scheme: StyleKit
5+
osx_image: xcode8.3
6+
xcode_sdk: macosx10.11
7+
8+
script:
9+
- xcodebuild clean build test -project StyleKit.xcodeproj -scheme StyleKit -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.3'

README.md

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
![alt text](https://i.imgur.com/IqDIU4q.png "StyleKit - A powerful & easy to use styling framework written in Swift")
22

3-
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
3+
[![Build Status](https://travis-ci.org/146BC/StyleKit.svg?branch=develop)](https://travis-ci.org/146BC/StyleKit) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
44

55
StyleKit is a microframework that enables you to style your applications using a simple JSON file. Behind the scenes, StyleKit uses [UIAppearance](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAppearance_Protocol/) and some selector magic to apply the styles. You can also customize the parser for greater flexibility.
66

77

8-
###How does it work?
8+
### How does it work?
99

10-
####Create a JSON file in the following format
10+
#### Create a JSON file in the following format
1111

1212
```js
1313
{
14+
"@headingFont": "HelveticaNeue-Bold:30.0",
1415
"UILabel": {
15-
"font": "HelveticaNeue-Bold:30.0",
16+
"font": "@headingFont",
1617
"backgroundColor": "#000FFF"
1718
},
1819
"StyleKitDemo.SKView": {
@@ -30,7 +31,7 @@ StyleKit is a microframework that enables you to style your applications using a
3031
"StyleKitDemo.SKNavigationBar": {
3132
"titleTextAttributes": {
3233
"NSColor": "#000FFF",
33-
"NSFont": "HelveticaNeue-Bold:30.0"
34+
"NSFont": "@headingFont"
3435
}
3536
},
3637
"StyleKitDemo.SKTextField": {
@@ -39,7 +40,7 @@ StyleKit is a microframework that enables you to style your applications using a
3940
}
4041
}
4142
```
42-
####Load JSON file
43+
#### Load JSON file
4344

4445
*AppDelegate.swift*
4546

@@ -58,7 +59,7 @@ func application(_ application: UIApplication,
5859
On application launch the JSON file will be loaded and the styles applied.
5960

6061

61-
###The JSON file structure
62+
### The JSON file structure
6263

6364
Each object inside the JSON file should contain the name of the UIView as a key and the object inside should either contain the properties/functions that need to be set/called or another UIView, this will give you the ability to apply styles on views when contained in other views, an example of this would be the following.
6465

@@ -79,7 +80,25 @@ This would apply HelveticaNeue-Bold with size 20 to all the UIButtons except the
7980

8081
Custom classes must be namespaced by the name of the module they are contained in. e.g. `StyleKitDemo.SKTextField`
8182

82-
###Bring Your Own Parser
83+
### Aliases
84+
85+
```js
86+
{
87+
"@mainFont": "HelveticaNeue-Bold:20.0",
88+
"@primaryColor": "#000FFF",
89+
"UIButton": {
90+
"font": "@mainFont"
91+
},
92+
"MyApp.LoginView": {
93+
"UIButton": {
94+
"font": "HelveticaNeue-Light:25.0",
95+
"titleColor:normal": "@primaryColor"
96+
}
97+
}
98+
}
99+
```
100+
101+
### Bring Your Own Parser
83102

84103
StyleKit's initialiser supports passing a custom parser which should conform to the `StyleParsable` protocol.
85104

@@ -115,7 +134,7 @@ func application(_ application: UIApplication,
115134
}
116135
```
117136

118-
###Logging###
137+
### Logging
119138

120139
By default, StyleKit will log any errors to the console. To customise the level of logging, you can pass a logLevel parameter as follows:
121140

@@ -131,23 +150,23 @@ The levels of logging are:
131150
* ```.none```
132151

133152

134-
###How to install?
153+
### How to install?
135154

136-
####Carthage
155+
#### Carthage
137156

138-
#####Swift 2.2 & 2.3
157+
##### Swift 2.2 & 2.3
139158

140159
```ogdl
141160
github "146BC/StyleKit" ~> 0.4
142161
```
143162

144-
#####Swift 3
163+
##### Swift 3
145164

146165
```ogdl
147-
github "146BC/StyleKit" ~> 0.5
166+
github "146BC/StyleKit" ~> 0.6
148167
```
149168

150-
####CocoaPods
169+
#### CocoaPods
151170

152171
Add the 146BC Source
153172

@@ -156,14 +175,14 @@ source 'https://github.com/146BC/Specs.git'
156175
source 'https://github.com/CocoaPods/Specs.git'
157176
```
158177

159-
#####Swift 2.2 & 2.3
178+
##### Swift 2.2 & 2.3
160179

161180
```ruby
162181
pod 'StyleKit', '~> 0.4'
163182
```
164183

165-
#####Swift 3
184+
##### Swift 3
166185

167186
```ruby
168-
pod 'StyleKit', '~> 0.5'
169-
```
187+
pod 'StyleKit', '~> 0.6'
188+
```

0 commit comments

Comments
 (0)