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
[#58 CollectionView extension for adaptive grid layout](https://github.com/Luur/SwiftTips#58-collectionview-extension-for-adaptive-grid-layout)<br />
17
17
[#57 Render HTML within a `UILabel`](https://github.com/Luur/SwiftTips#57-render-html-within-a-uilabel)<br />
@@ -76,14 +76,14 @@ Here's list of Swift tips & tricks with all additional sources (playgrounds, ima
76
76
77
77
Below I want to show you a few simple ways how to make usage of string literals connected with `UIStoryboard` much more safer.
78
78
79
-
* Global constant string literals
79
+
* Global constant string literals<br />
80
80
At first it sounds like a good idea. You only need to define the constant once and it will be available everywhere. Then if you want to change its value, there is only one place in code to change for which the effects will cascade throughout the project.
81
81
But global constants have some disadvantages. Not as much as global variables but still enought to stop using them. It's not the best practice. I will cover the topic of andvatages and disadavntages of global constants/variables usage in my next posts.
82
82
83
-
* Relatable storyboard names
83
+
* Relatable storyboard names<br />
84
84
Your storyboards should be named after the sections of which they cover. It's a general rule. If you have a storyboard which houses view controllers are related to Profile, then the name of that storyboard’s file should be `Profile.storyboard`.
85
85
86
-
* Uniform storyboard identifiers
86
+
* Uniform storyboard identifiers<br />
87
87
When you want to use `Storyboard Identifiers` on your view controllers, usage of the class names as identifiers will be a good practice. For example, “ProfileViewController” would be the identifier for ProfuleViewController. Adding this to your naming convention is a good idea.
88
88
89
89
* Enum
@@ -122,6 +122,7 @@ I'm prety sure that almost every one has heard about "main" MVC problem known as
122
122
Let's list main storyboard problems:
123
123
124
124
* Storyboard always become unwieldy and unmanageable.
125
+
125
126

126
127
127
128
* Storyboard is slow. Extremely slow. As it grows in size, it doesn't only become unhandy for developers but also for XCode. Once you tap on a storyboard file of this size, you can leave your seat, grab a cup of coffee and come back. You’ll be lucky if XCode has loaded the storyboard.
@@ -137,8 +138,6 @@ Storyboard can be easily splitted into multiple storyboards, with each one repre
137
138
138
139
Also don't forget about Storyboard References introduced in iOS 9.
139
140
140
-

141
-
142
141
**But splitting storyboard will not help with one serious problem.** Storyboard usage has strong coupling with one silent killer known as `String Literals`. Look for the solution in [#63`StoryboardIdentifiable` protocol]()
143
142
144
143
Back to [Top](https://github.com/Luur/SwiftTips#-table-of-contents)
0 commit comments