You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-21
Original file line number
Diff line number
Diff line change
@@ -49,19 +49,16 @@ var body: Interface {
49
49
50
50
## Why IBKit
51
51
52
-
Storyboard, XIB is a kind of XML file. However have you ever edited a storyboard or XIB by hand? Probably not. It isn't easy to read or edit. Storyboards and XIBs have many troublesome properties such as `id`, `destination`, etc. Futhermore these contain a fairly large amount of XML. So it is impossible to see what’s changed when someone opens a pull request with its modification.
52
+
IBKit lets you write intuitive UI code in a collaboration-friendly way.
53
53
54
-
Worse, Storyboards have a habit of growing larger and larger over time. they might start off small, but then you add another view controller and another, and another, and suddenly you realize that you have ten screens of data in a single file, and any source control changes you make are suddenly quite painful.
54
+
Xcode storyboards and interface builders have advantages in visual representation, but have critical weaknesses:
55
55
56
-
Also, Interface Builder doesn’t know much about the Swift code, and vice versa. It makes you have lots of unsafe functionality. For example, we Ctrl-drag from IB into our code to connect something to an action. Then what if we delete that action on the code? The code still compiles well but it will be crashed!
56
+
- Readability. IB files are designed to be read by Xcode, not humans.
57
+
- Collaboration. Due to low readability, it is hard to review changes and resolve conflicts.
58
+
- Scope handling. A single storyboard file keeps growing as your codebase grows. If you don't pay enough attention, you'll find a single file contains tens of screens.
59
+
- Safety. Interface builders don't know much about your Swift code. Missing references are not caught at compile-time and lead to runtime crash.
57
60
58
-
~Finally Interface Builder doesn't work as intended. Named colors that set from xib can not be changed in `viewDidLoad`, `viewWillAppear`, `awakeFromNib` method.~
59
-
60
-
Nevertheless, Storyboard, XIB has powerful advantages. It gives you a very good visual representation. Also it is easy of use. When you create a ViewController programmatically, it has a lot of codes and looks too verbose.
61
-
62
-
Basically, IBKit is a tool for programmtically UI. By using declarative style, you can understand the UI intuitively. Also IBKit has a simple `Preview` class for Xcode Previews. You can be given a realtime visual representation easily.
63
-
64
-
IBKit is the most straight forward, the easiest way to implement your UI.
61
+
IBKit has an intuitive syntax written in Swift code, inspired by SwiftUI, and supports easy integration with Xcode Previews.
65
62
66
63
## Requirements
67
64
@@ -71,10 +68,9 @@ IBKit is the most straight forward, the easiest way to implement your UI.
71
68
72
69
## Installation
73
70
74
-
`IBKit` doesn't contain any external dependencies.
75
-
These are currently support options:
71
+
`IBKit` requires no external dependencies. Supported installation options are:
76
72
77
-
### Cocoapods
73
+
### CocoaPods
78
74
```
79
75
# Podfile
80
76
user_framework!
@@ -86,7 +82,7 @@ Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type:
86
82
```
87
83
$ pod install
88
84
```
89
-
> Deployment target 11.0+ is required to install IBKit via Cocoapods.
85
+
> Deployment target 11.0+ is required to install IBKit via CocoaPods.
90
86
91
87
### Swift Package Manager
92
88
@@ -129,7 +125,7 @@ class PriceView: UIView, InterfaceBuilder {
129
125
}
130
126
```
131
127
132
-
Declare user interfaces in the body
128
+
Declare user interfaces in `body`.
133
129
134
130
```Swift
135
131
ViewGroup {
@@ -153,7 +149,7 @@ ViewGroup {
153
149
}
154
150
```
155
151
156
-
Instantiate your view(Controller) using a `loadFromIB` method.
152
+
Instantiate your view (or view controller) using a `loadFromIB` method.
0 commit comments