Skip to content

Instantly share code, notes, and snippets.

@dennda
Created June 14, 2018 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennda/710e40ae14777bf94fbe0f6108619fad to your computer and use it in GitHub Desktop.
Save dennda/710e40ae14777bf94fbe0f6108619fad to your computer and use it in GitHub Desktop.
diff --git a/DuolingoMobile/Metadata/DuolingoMobile-Info.plist b/DuolingoMobile/Metadata/DuolingoMobile-Info.plist
index d3fa5550e..71cdb2d3a 100644
--- a/DuolingoMobile/Metadata/DuolingoMobile-Info.plist
+++ b/DuolingoMobile/Metadata/DuolingoMobile-Info.plist
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.2.29</string>
+ <string>5.2.30</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -54,7 +54,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
- <string>5.2.29.0</string>
+ <string>5.2.30.explanations.phonetics.0</string>
<key>FacebookAppID</key>
<string>234536436609303</string>
<key>FacebookDisplayName</key>
@@ -97,8 +97,7 @@
<string>MuseoSansRounded-700.otf</string>
</array>
<key>UIBackgroundModes</key>
- <array>
- </array>
+ <array/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
diff --git a/DuolingoMobile/Sources/Explanations/ExplanationRoutes.swift b/DuolingoMobile/Sources/Explanations/ExplanationRoutes.swift
index 2bab268c6..2577e86c4 100644
--- a/DuolingoMobile/Sources/Explanations/ExplanationRoutes.swift
+++ b/DuolingoMobile/Sources/Explanations/ExplanationRoutes.swift
@@ -8,10 +8,10 @@
import Foundation
/// The base URL for the explanations microservice.
-private let ExplanationServiceBaseURLString = "https://explanations.duolingo.com/diagnostics-api/explanations/"
-#if DEBUG
-//private let ExplanationServiceBaseURLString = "https://explanations-stage.duolingo.com/diagnostics-api/explanations/"
-#endif
+//private let ExplanationServiceBaseURLString = "https://explanations.duolingo.com/diagnostics-api/explanations/"
+//#if DEBUG
+private let ExplanationServiceBaseURLString = "https://explanations-stage.duolingo.com/diagnostics-api/explanations/"
+//#endif
/// Base explanations route.
protocol ExplanationRoute: APIRoute {}
@@ -29,7 +29,7 @@ extension ExplanationRoute {
}
}
-#if DEBUG
+//#if DEBUG
/// Get a list of all the available explanations for the course.
struct ListExplanations: ExplanationRoute {
@@ -73,7 +73,7 @@ struct ListExplanations: ExplanationRoute {
}
}
}
-#endif
+//#endif
/// MARK: NetworkClient + Explanations
@@ -89,7 +89,7 @@ private let DefaultRetryPolicy = RetryPolicy(attempt: 0,
backoffJitter: 0.25,
retriedErrorTypes: DefaultRetriedErrorTypes)
-#if DEBUG
+//#if DEBUG
extension NetworkClient {
/*
@@ -133,4 +133,4 @@ extension NetworkClient {
return retry(retriable, policy: DefaultRetryPolicy, completion: completion)
}
}
-#endif
+//#endif
diff --git a/DuolingoMobile/Sources/Explanations/ExplanationsDebugListVC.swift b/DuolingoMobile/Sources/Explanations/ExplanationsDebugListVC.swift
index ce73e3e6a..c92fa3cd0 100644
--- a/DuolingoMobile/Sources/Explanations/ExplanationsDebugListVC.swift
+++ b/DuolingoMobile/Sources/Explanations/ExplanationsDebugListVC.swift
@@ -7,7 +7,7 @@
import Foundation
-#if DEBUG
+//#if DEBUG
@objc(DUOExplanationsDebugListVC)
class ExplanationsDebugListVC: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate,
@@ -198,4 +198,4 @@ private class ExplanationReferenceCell: UICollectionViewCell {
}
-#endif
+//#endif
diff --git a/DuolingoMobile/Sources/Skills/Skill Tree/Controllers/DUOSkillTreeViewController.m b/DuolingoMobile/Sources/Skills/Skill Tree/Controllers/DUOSkillTreeViewController.m
index 416dcf8f6..b51cdbf13 100644
--- a/DuolingoMobile/Sources/Skills/Skill Tree/Controllers/DUOSkillTreeViewController.m
+++ b/DuolingoMobile/Sources/Skills/Skill Tree/Controllers/DUOSkillTreeViewController.m
@@ -334,12 +334,12 @@ - (void)viewDidLoad
[self installObservers];
-#ifdef DEBUG
- // Add a debug-only feature to simplify testing conversations.
- UILongPressGestureRecognizer *conversationsDebugRecognizer = [[UILongPressGestureRecognizer alloc]
- initWithTarget:self
- action:@selector(handleTutorDebugTap:)];
- [self.tableView addGestureRecognizer:conversationsDebugRecognizer];
+//#ifdef DEBUG
+// // Add a debug-only feature to simplify testing conversations.
+// UILongPressGestureRecognizer *conversationsDebugRecognizer = [[UILongPressGestureRecognizer alloc]
+// initWithTarget:self
+// action:@selector(handleTutorDebugTap:)];
+// [self.tableView addGestureRecognizer:conversationsDebugRecognizer];
// Add a debug-only feature to simplify testing explanations.
UITapGestureRecognizer *explanationsDebugRecognizer = [[UITapGestureRecognizer alloc]
@@ -347,10 +347,10 @@ - (void)viewDidLoad
action:@selector(handleExplanationsDebugTap:)];
explanationsDebugRecognizer.numberOfTapsRequired = 2;
[self.tableView addGestureRecognizer:explanationsDebugRecognizer];
-#endif
+//#endif
}
-#ifdef DEBUG
+//#ifdef DEBUG
- (void)handleExplanationsDebugTap:(UITapGestureRecognizer *)tapRecognizer {
__weak DUOSkillTreeViewController *weakSelf = self;
@@ -363,82 +363,82 @@ - (void)handleExplanationsDebugTap:(UITapGestureRecognizer *)tapRecognizer {
[self presentViewController:vc animated:YES completion:^{}];
}
-- (void)handleTutorDebugTap:(UIGestureRecognizer *)recognizer {
- /*
- To make testing/debugging tutor content easier, bring up a list of all scripts and let the user choose the
- script they want to test. Once they choose one, the list disappears and the tutor is shown for that script.
-
- This doesn't affect the local tutor state (it uses a different list controller), but it will potentially put
- stuff in the users inbox, mark things as read, etc.
- */
- DUOChatScriptListDebugController *debugListController = [[DUOChatScriptListDebugController alloc]
- initWithNetworkClient:self.networkClient
- userClient:self.userClient.userClient];
-
- __weak DUOSkillTreeViewController *weakSelf = self;
-
- DUOChatScriptDebugVC<DUOHomeBarOwner> *selectionVC = [[DUOChatScriptDebugVC alloc] initWithNetworkClient:self.networkClient
- userClient:self.userClient.userClient
- resourceClient:self.resourceClient
- scriptListController:debugListController
-
- dismiss:^() { }
- scriptSelected:^(NSString * _Nonnull scriptID,
- BOOL useMasterVersion,
- NSDictionary * _Nonnull extraTrackingProperties)
- {
- [weakSelf dismissViewControllerAnimated:true completion:^{
- DUOSkillTreeViewController *strongSelf = weakSelf;
- if (strongSelf == nil) {
- return;
- }
-
- UIViewController *tutorPresenter = weakSelf;
- DUOChatScriptDescriptor *script = [DUOChatScriptDescriptor makeFakeDescriptorForScriptWithID:scriptID];
- DUOChatController *chatController = [[DUOChatController alloc] initWithCurrentScriptID:script.identifier
- client:strongSelf.networkClient
- userClient:strongSelf.userClient.userClient];
- DUOChatVC *tutorVC = [[DUOChatVC alloc] initWithResourceClient:strongSelf.resourceClient
- scriptIDToStart:script.identifier
- skillID:nil
- currentLevelIndex:nil
- useMasterVersion:useMasterVersion
- extraTrackingProperties:script.extraTrackingProperties
- client:strongSelf.networkClient
- userClient:strongSelf.userClient.userClient
- adsClient:strongSelf.adsClient
- storeManager:strongSelf.storeManager
- chatController:chatController
- dismiss:^(BOOL didAbandon)
- {
- [tutorPresenter dismissViewControllerAnimated:true completion:^{}];
- }];
- [tutorPresenter presentViewController:tutorVC animated:YES completion:^{}];
- }];
- }];
-
- DUOHomeBarVC *debugVC = [[DUOHomeBarVC alloc] initWithChildVC:selectionVC];
-
- [self presentViewController:debugVC animated:true completion:^{
- // Swap out the ring of fire for a close button.
- UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeSystem];
- [closeButton setTitle:@"Close" forState:UIControlStateNormal];
- closeButton.titleLabel.font = [DUOStyle defaultStyle].lightFont;
- [closeButton setTitleColor:[UIColor duolingoBlueColor] forState:UIControlStateNormal];
- [closeButton addTarget:self action:@selector(handleTutorDebugClose:) forControlEvents:UIControlEventTouchUpInside];
- selectionVC.homeBarItem.leftView = closeButton;
-
- // Kill the "new chat" button
- selectionVC.homeBarItem.rightView = [[UIView alloc] init];
-
- [debugListController fetchWithMasterVersions:NO fetchAllScripts:YES];
- }];
-}
-
-- (void)handleTutorDebugClose:(UIButton *)sender {
- [self dismissViewControllerAnimated:true completion:^{}];
-}
-#endif
+//- (void)handleTutorDebugTap:(UIGestureRecognizer *)recognizer {
+// /*
+// To make testing/debugging tutor content easier, bring up a list of all scripts and let the user choose the
+// script they want to test. Once they choose one, the list disappears and the tutor is shown for that script.
+//
+// This doesn't affect the local tutor state (it uses a different list controller), but it will potentially put
+// stuff in the users inbox, mark things as read, etc.
+// */
+// DUOChatScriptListDebugController *debugListController = [[DUOChatScriptListDebugController alloc]
+// initWithNetworkClient:self.networkClient
+// userClient:self.userClient.userClient];
+//
+// __weak DUOSkillTreeViewController *weakSelf = self;
+//
+// DUOChatScriptDebugVC<DUOHomeBarOwner> *selectionVC = [[DUOChatScriptDebugVC alloc] initWithNetworkClient:self.networkClient
+// userClient:self.userClient.userClient
+// resourceClient:self.resourceClient
+// scriptListController:debugListController
+//
+// dismiss:^() { }
+// scriptSelected:^(NSString * _Nonnull scriptID,
+// BOOL useMasterVersion,
+// NSDictionary * _Nonnull extraTrackingProperties)
+// {
+// [weakSelf dismissViewControllerAnimated:true completion:^{
+// DUOSkillTreeViewController *strongSelf = weakSelf;
+// if (strongSelf == nil) {
+// return;
+// }
+//
+// UIViewController *tutorPresenter = weakSelf;
+// DUOChatScriptDescriptor *script = [DUOChatScriptDescriptor makeFakeDescriptorForScriptWithID:scriptID];
+// DUOChatController *chatController = [[DUOChatController alloc] initWithCurrentScriptID:script.identifier
+// client:strongSelf.networkClient
+// userClient:strongSelf.userClient.userClient];
+// DUOChatVC *tutorVC = [[DUOChatVC alloc] initWithResourceClient:strongSelf.resourceClient
+// scriptIDToStart:script.identifier
+// skillID:nil
+// currentLevelIndex:nil
+// useMasterVersion:useMasterVersion
+// extraTrackingProperties:script.extraTrackingProperties
+// client:strongSelf.networkClient
+// userClient:strongSelf.userClient.userClient
+// adsClient:strongSelf.adsClient
+// storeManager:strongSelf.storeManager
+// chatController:chatController
+// dismiss:^(BOOL didAbandon)
+// {
+// [tutorPresenter dismissViewControllerAnimated:true completion:^{}];
+// }];
+// [tutorPresenter presentViewController:tutorVC animated:YES completion:^{}];
+// }];
+// }];
+//
+// DUOHomeBarVC *debugVC = [[DUOHomeBarVC alloc] initWithChildVC:selectionVC];
+//
+// [self presentViewController:debugVC animated:true completion:^{
+// // Swap out the ring of fire for a close button.
+// UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeSystem];
+// [closeButton setTitle:@"Close" forState:UIControlStateNormal];
+// closeButton.titleLabel.font = [DUOStyle defaultStyle].lightFont;
+// [closeButton setTitleColor:[UIColor duolingoBlueColor] forState:UIControlStateNormal];
+// [closeButton addTarget:self action:@selector(handleTutorDebugClose:) forControlEvents:UIControlEventTouchUpInside];
+// selectionVC.homeBarItem.leftView = closeButton;
+//
+// // Kill the "new chat" button
+// selectionVC.homeBarItem.rightView = [[UIView alloc] init];
+//
+// [debugListController fetchWithMasterVersions:NO fetchAllScripts:YES];
+// }];
+//}
+//
+//- (void)handleTutorDebugClose:(UIButton *)sender {
+// [self dismissViewControllerAnimated:true completion:^{}];
+//}
+//#endif
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment