Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release notes 1.57 #283

Merged
merged 2 commits into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ def testing_pods
pod 'Nimble'
end

def main_pods
pod 'Appsee'
end

def adaptive_pods
pod 'Koloda', '4.3.1'
pod 'SDWebImage/GIF'
pod 'NotificationBannerSwift', '1.5.2'
end
Expand All @@ -81,6 +84,7 @@ target 'Stepic' do
target 'StepicTests' do
inherit! :search_paths
all_pods
main_pods
testing_pods
end
end
Expand Down Expand Up @@ -125,6 +129,12 @@ target 'Adaptive 3124' do
adaptive_pods
end

target 'Adaptive 8290' do
platform :ios, '9.0'
all_pods
adaptive_pods
end

target 'Adaptive 1838 Screenshots' do
pod 'SimulatorStatusMagic', :configurations => ['Debug']
end
Expand Down
1,432 changes: 1,413 additions & 19 deletions Stepic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions Stepic.xcodeproj/xcshareddata/xcschemes/Adaptive 8290.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2CA8D1392088D9C000E105E9"
BuildableName = "Adaptive 8290.app"
BlueprintName = "Adaptive 8290"
ReferencedContainer = "container:Stepic.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2CA8D1392088D9C000E105E9"
BuildableName = "Adaptive 8290.app"
BlueprintName = "Adaptive 8290"
ReferencedContainer = "container:Stepic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2CA8D1392088D9C000E105E9"
BuildableName = "Adaptive 8290.app"
BlueprintName = "Adaptive 8290"
ReferencedContainer = "container:Stepic.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2CA8D1392088D9C000E105E9"
BuildableName = "Adaptive 8290.app"
BlueprintName = "Adaptive 8290"
ReferencedContainer = "container:Stepic.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
12 changes: 10 additions & 2 deletions Stepic/AnalyticsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ import FirebaseCore
import Mixpanel
import YandexMobileMetrica
import Crashlytics
import Appsee

#if ENABLE_APPSEE
import Appsee
#endif

class AnalyticsHelper: NSObject {
static var sharedHelper = AnalyticsHelper()
fileprivate override init() {super.init()}

func setupAnalytics() {
Fabric.with([Crashlytics.self, Appsee.self])
#if ENABLE_APPSEE
Fabric.with([Crashlytics.self, Appsee.self])
#else
Fabric.with([Crashlytics.self])
#endif

FirebaseApp.configure()

Mixpanel.initialize(token: Tokens.shared.mixpanelToken)
Expand Down
15 changes: 12 additions & 3 deletions Stepic/CardStepPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ class CardStepPresenter {

// Set up quiz view controller
switch step.block.name {
case "choice": quizViewController = ChoiceQuizViewController(nibName: "QuizViewController", bundle: nil)
case "string": quizViewController = StringQuizViewController(nibName: "QuizViewController", bundle: nil)
case "number": quizViewController = NumberQuizViewController(nibName: "QuizViewController", bundle: nil)
case "choice":
quizViewController = ChoiceQuizViewController(nibName: "QuizViewController", bundle: nil)
case "string":
let vc = StringQuizViewController(nibName: "QuizViewController", bundle: nil)
vc.useSmallPadding = true
vc.textView.placeholder = NSLocalizedString("StringInputTextFieldPlaceholder", comment: "")
quizViewController = vc
case "number":
let vc = NumberQuizViewController(nibName: "QuizViewController", bundle: nil)
vc.useSmallPadding = true
vc.textField.placeholder = NSLocalizedString("NumberInputTextFieldPlaceholder", comment: "")
quizViewController = vc
default: break
}

Expand Down
2 changes: 1 addition & 1 deletion Stepic/CardStepViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class CardStepViewController: UIViewController, CardStepView {
}
}

private func refreshWebView() {
func refreshWebView() {
resetWebViewHeight(5.0)

func reloadContent() -> Promise<Void> {
Expand Down
9 changes: 6 additions & 3 deletions Stepic/NumberQuizViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class NumberQuizViewController: QuizViewController {
var dataset: String?
var reply: NumberReply?

// Hack for adaptive mode (ugly layout when child quiz has padding)
var useSmallPadding: Bool = false

override func viewDidLoad() {
super.viewDidLoad()

Expand All @@ -27,11 +30,11 @@ class NumberQuizViewController: QuizViewController {

if #available(iOS 11.0, *) {
NSLayoutConstraint.activate([
textField.leadingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.leadingAnchor, constant: 16),
textField.trailingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.trailingAnchor, constant: -16)
textField.leadingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.leadingAnchor, constant: useSmallPadding ? 8 : 16),
textField.trailingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.trailingAnchor, constant: useSmallPadding ? -8 : -16)
])
} else {
textField.alignLeading("16", trailing: "-16", toView: containerView)
textField.alignLeading(useSmallPadding ? "8" : "16", trailing: useSmallPadding ? "-8" : "-16", toView: containerView)
}

textField.borderStyle = UITextBorderStyle.roundedRect
Expand Down
13 changes: 13 additions & 0 deletions Stepic/OnboardingCardStepViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ class OnboardingCardStepViewController: CardStepViewController {
stepWebView.loadHTMLString(html, baseURL: step.baseURL)
}

override func refreshWebView() {
// Workaround for strange encoding bug
// Skip refreshing for onboarding
alignImages(in: self.stepWebView).then {
self.getContentHeight(self.stepWebView)
}.then { height -> Void in
self.resetWebViewHeight(Float(height))
self.scrollView.layoutIfNeeded()
}.catch { _ in
print("onboarding card step: error while refreshing")
}
}

override func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
super.webView(webView, didFinish: navigation)
delegate?.contentLoadingDidComplete()
Expand Down
13 changes: 9 additions & 4 deletions Stepic/StringQuizViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
//

import UIKit
import IQKeyboardManagerSwift

class StringQuizViewController: QuizViewController {

var textView = UITextView()
var textView = IQTextView()

var dataset: String?
var reply: TextReply?

let textViewHeight = 64

// Hack for adaptive mode (ugly layout when child quiz has padding)
var useSmallPadding: Bool = false

override func viewDidLoad() {
super.viewDidLoad()

Expand All @@ -26,12 +30,13 @@ class StringQuizViewController: QuizViewController {

if #available(iOS 11.0, *) {
NSLayoutConstraint.activate([
textView.leadingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.leadingAnchor, constant: 16),
textView.trailingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.trailingAnchor, constant: -16)
textView.leadingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.leadingAnchor, constant: useSmallPadding ? 8 : 16),
textView.trailingAnchor.constraint(equalTo: containerView.safeAreaLayoutGuide.trailingAnchor, constant: useSmallPadding ? -8 : -16)
])
} else {
textView.alignLeading("16", trailing: "-16", toView: containerView)
textView.alignLeading(useSmallPadding ? "8" : "16", trailing: useSmallPadding ? "-8" : "-16", toView: containerView)
}

textView.setRoundedCorners(cornerRadius: 8.0, borderWidth: 0.5, borderColor: UIColor.lightGray)

textView.font = UIFont.systemFont(ofSize: 16)
Expand Down
4 changes: 3 additions & 1 deletion Stepic/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ StreakNotificationsAlertMessage = "Seems like you've disabled notifications in s
PassedPercent = "Passed";
AuthorDidntUploadVideo = "Author didn't upload any video yet.";
NoVideo = "No video";
StringInputTextFieldPlaceholder = "Enter your answer";
NumberInputTextFieldPlaceholder = "Enter your answer";
FillBlankOptionTitle = "Select option";
FillBlankInputTextFieldPlaceholder = "Enter your answer";
FillBlanksSelectAnswerString = "Select your answer";
Expand Down Expand Up @@ -486,4 +488,4 @@ CodeEditorLanguage = "Language";
CodeEditorFont = "Font";
CodeEditorColor = "Colors";
CodeEditorCurrentTheme = "Current: %@";
CodeEditorCurrentFontSize = "Current: %@pt";
CodeEditorCurrentFontSize = "Current: %@pt";
4 changes: 3 additions & 1 deletion Stepic/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ StreakNotificationsAlertMessage = "Похоже, вы запретили при
PassedPercent = "Пройдено";
AuthorDidntUploadVideo = "Автор еще не загрузил видео.";
NoVideo = "Нет видео";
StringInputTextFieldPlaceholder = "Введите ответ";
NumberInputTextFieldPlaceholder = "Введите ответ";
FillBlankOptionTitle = "Выберите вариант";
FillBlankInputTextFieldPlaceholder = "Введите ответ";
FillBlanksSelectAnswerString = "Выберите ответ";
Expand Down Expand Up @@ -486,4 +488,4 @@ CodeEditorLanguage = "Язык";
CodeEditorFont = "Шрифт";
CodeEditorColor = "Цвет";
CodeEditorCurrentTheme = "Используется: %@";
CodeEditorCurrentFontSize = "Используется: %@pt";
CodeEditorCurrentFontSize = "Используется: %@pt";
6 changes: 6 additions & 0 deletions StepicAdaptiveCourse/AdaptiveAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Mixpanel
import Fabric
import Crashlytics
import PromiseKit
import IQKeyboardManagerSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -29,6 +30,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
DefaultsContainer.launch.didLaunch = true
}

IQKeyboardManager.sharedManager().enable = true
IQKeyboardManager.sharedManager().shouldResignOnTouchOutside = true
IQKeyboardManager.sharedManager().keyboardDistanceFromTextField = 16
IQKeyboardManager.sharedManager().enableAutoToolbar = false

LocalNotificationsHelper.registerNotifications()

if let launchNotification = launchOptions?[UIApplicationLaunchOptionsKey.localNotification] as? UILocalNotification {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
Loading