/arKit

A framework for rendering app layouts on the fly from a configuration file

Primary LanguageObjective-COtherNOASSERTION

This is version 0.1 alpha of ARKit.


###Why ARKit?

  • styles seperate from code
  • simple layout scheme

These are just a few of most interesting features in ARKit.


###ARUtils

  • Benchmarking tools - ARBenchmark
    • Reports effectively what function is taking the most time.
    • Use start:(NSStrings *)name at the beginning of a function and stop:(NSString *)name at the end of a function to see the efficiency of that particular function.
  • App Utility tools - ARAppUtils
    • It tells the user system information such as: isSimulator, iOSVersion, isRetina, isIphone5, isIpad, ... , etc.
    • iosVersionEqualOrGreaterThan:(NSString *)version is useful when dealing with compatibility with ios6 and ios7.

###ARLayout

  • This is really useful!!
  • If you have multiple views and their positions are dependent on each other, this tool can come really handy. You can position the views relative to other views by doing:[myView addSubView:mySubView above:bottomView offsetBottom:10 offSetLeft:0]. In this case mySubView is a subview of myView, and it is left aligned with bottomView, and the top of myView is 10 px above the top of bottomView.
  • We added width and height as properties to UIView. Therefore, you can directly alloc and init like this: UIView *view = [[UIView alloc] initWithWidth:100 height:100], and if you wish, you could also set width and height just like this:[myView setWidth:10] or myView.height = 10

###ARTheme

  • Theme
    • You can completely pulled the design out of your app's functional logic by using this. It is really similar to CSS (style sheets) for website design, the only difference is that ARTheme offers more than that, and it is more awesome.
    • Set up with a theme folder by doing: [ARTheme setupWithThemeFile:(NSString *)filePath]
    • A theme folder should contain the following files: styles_*.json, colors_*.json, fonts_*.json, images_*.json, strings_*.json, settings.json
    • Here is an example of how you could use it:
"PageName_LabelName" {
		"textAlignment": "center",
		"textColor": "black",
		"font": "labelName_font",
		"layer": {
			"shadowColor": "black",
			"shadowOpacity": "0.8"
			"shadowOffset": { "width": -1, "height": -1 },
		}
}

"font" key will look into the file fonts_*.json to find labelName_font; textColor will look into the file colors_*json to find black. The styles sheets styles_*.json are available for the following UI Elements: * UILabel * UISegmentedControl * UIView * UIImageView * UIButton * UITextField

  • strings_*.json localizes your app. A simple example: If you want to localize your app for Spanish, you can write "Name": "Enrique" in strings.json, and in your app, write [ARStrings localized:"Name"] to print out the word "Enrique".
  • settings.json should contain a list of settings in json format for your app. For example, this could be a list of bools to turn on/off some features. "Feature_name": 1, you can do [ARTheme boolForSettings:@"Feature_name"] to check if the setting is turned on.