This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a quick tutorial for analysing Swift compile time. | |
3 main steps: | |
1) Log the whole app build: | |
xcodebuild -workspace ./App.xcworkspace -scheme App clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | tee ~/Desktop/compile_log.txt | |
2) Get sorted data we want from build: | |
grep '^\d*\.\d*ms' compile_log.txt | sort -n -k1 -r > compile_analyzed.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment the next line to define a global platform for your project | |
# platform :ios, '9.0' | |
workspace 'App.xcworkspace' | |
project 'App.xcodeproj' | |
platform :ios, '10.0' | |
inhibit_all_warnings! | |
use_frameworks! | |
CCPod = Struct.new(:name, :version, :git, :branch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
/** | |
This is the order of how the frameworks are being compiled. | |
It starts with CCCore but if CCCore contains other imported framework | |
then the compiler jumps to that framework. | |
*/ | |
import CCCore | |
import CCFeature0 | |
import CCFeature1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Every child flow must implement Flow protocol | |
- func start: Starts the flow process, it usually decides what is | |
going to be presented | |
- var services: Property that contains all the services that are | |
being used in the app | |
- var finish: Is a closure that notifies parent Flow | |
that the child flow is finished. | |
- var currentVC: Returns view controller that is currently being displayed | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CCFeature2Flow: Flow { | |
public var finish: (Flow) -> () = { _ in } | |
public var services: Services | |
public var navigation: UINavigationController? | |
public required init(services: Services, navigationVC: UINavigationController?) { | |
self.services = services | |
self.navigation = navigationVC | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol LocalizedStringRepresentable { | |
var text: String { get } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum LoginLocalization: String, LocalizedStringRepresentable { | |
//WelcomeVC | |
case signInSignUp | |
//SignInSignUpVC | |
case termsAndCond, signIn, signUp, signUpShort, email, password, repeatPassword, | |
signInWithFB, signUPWithFB, selectAvatar, selectAnother | |
//SignInWalkthroughVC | |
case wCreateGoal, wSelectCategoryOfGoals, wTrackAchievements, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"module.login.termsAndCond" = "Terms And Cond"; | |
"module.login.signIn" = "SIGN IN"; | |
"module.login.signUp" = "SIGN UP"; | |
"module.login.signUpShort" = "SIGN UP"; | |
"module.login.email" = "Email"; | |
"module.login.password" = "Password"; | |
"module.login.repeatPassword" = "Repeat Password"; | |
"module.login.signUPWithFB" = "SIGN UP WITH FACEBOOK"; | |
"module.login.signInWithFB" = "SIGN IN WITH FACEBOOK"; | |
"module.login.selectAvatar" = "SELECT AVATAR"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
func localized(bundle: Bundle = .main, tableName: String = "Localization") -> String { | |
return NSLocalizedString(self, tableName: tableName, value: "\(self)**", comment: "") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let button = AchieveMeButton(title: LoginLocalization.signInSignUp.text, | |
normalColor: .white, | |
touchColor: .lightGray, | |
titleColor: UIColor.amBlue()) |
OlderNewer