Skip to content

Commit

Permalink
Add Q and A
Browse files Browse the repository at this point in the history
  • Loading branch information
mac-cain13 committed Sep 11, 2015
1 parent e700c91 commit 7cb7b11
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Documentation/QandA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Questions and Answers

## What are the requirements to run R.swift?

Recommended is the latest stable version of OS X, Xcode with the app deployed iOS 7 or higher. But OS X 10.10 with Xcode 6.1 or higher should work. R.swift should also always be runned within the Xcode build process since it needs some of the environment variables. Otherwise it could throw errors at you.

## Why should I choose R.swift over alternative X or Y?

There are many nice R.swift alternatives like [Shark](https://github.com/kaandedeoglu/Shark), [Natalie](https://github.com/krzyzanowskim/Natalie) and [SwiftGen](https://github.com/AliSoftware/SwiftGen). I believe R.swift has important advantages over all of them:
- R.swift inspects your Xcodeproj file for resources instead of scanning folders or asking you for files
- R.swift supports a lot of different assets
- R.swift stays very close to the vanilla Apple API's, it's a minimal code change with maximum impact

## How does R.swift work?

Well you add R.swift as a Build phase to your target, basically this means that:
- Every time you build R.swift will be runned
- It takes a look at your Xcode project file and inspects all resources linked with the target currently build
- It generates a `R.generated.swift` file that contains a struct with types references to all resources

## Why was R.swift created?

Swift is a beautiful language and one of it's main advantages is that more and more is typed. This catches a lot of errors at compile time. It feels very strange to refer to resources with strings that will always compile and then fail at runtime. It makes refactoring hard and it's to easy to create bugs like missing images etc.

In Android there is a generated R class that kind of solves this problem. That was why I decided to make something like it for us Swift developers and called the project R.swift. It was well received by collegues, friends and Github stargazers, so here we are now.
3 changes: 2 additions & 1 deletion Documentation/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Documentation for R.swift

- [Examples](Examples.md)
- [Examples](Examples.md)
- [Questions and Answers](QandA.md)
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ _Tip:_ Add the `*.generated.swift` pattern to your `.gitignore` file to prevent

_Tip:_ Add the `*.generated.swift` pattern to your `.gitignore` file to prevent unnecessary conflicts.

## Q&A

- [What are the requirements to run R.swift?](Documentation/QandA.md)
- [Why should I choose R.swift over alternative X or Y?](Documentation/QandA.md)
- [How does R.swift work?](Documentation/QandA.md)
- [Why was R.swift created?](Documentation/QandA.md)

## Contribute

Please post any issues, questions and compliments in the GitHub issue tracker and feel free to submit pull request with fixes and improvements. Keep in mind; a good pull request is small, forked from the `develop`-branch and well explained. It also should benefit most of the users.
Expand Down

0 comments on commit 7cb7b11

Please sign in to comment.