Skip to content
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
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def testing_pods
end

target 'Stepic' do
platform :ios, '9.0'
platform :ios, '11.0'
all_pods
target 'StepicTests' do
inherit! :search_paths
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,6 @@ SPEC CHECKSUMS:
VK-ios-sdk: 7fd48bc5aaa6b96c3197c1987eb6593f2ea67331
YandexMobileMetrica: f18374ee6977a4cd1d0a86298a0df4ad7baf4135

PODFILE CHECKSUM: 0c6f3046cd7795142e613d85d7621ac20ce19346
PODFILE CHECKSUM: 12d559e44fc554e5784933ff129a59fc9eeb8241

COCOAPODS: 1.8.0
360 changes: 41 additions & 319 deletions Stepic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions Stepic/AdaptiveRatingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ class AdaptiveRatingsViewController: UIViewController {

tableView.register(UINib(nibName: "LeaderboardTableViewCell", bundle: nil), forCellReuseIdentifier: LeaderboardTableViewCell.reuseId)

#if swift(>=3.2)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = UIScrollView.ContentInsetAdjustmentBehavior.never
}
#endif
self.tableView.contentInsetAdjustmentBehavior = .never
}
}

Expand Down
12 changes: 2 additions & 10 deletions Stepic/AudioManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ class AudioManager: NSObject {
set(ignore) {
do {
print("setting ignore status to \(ignore)")
if #available(iOS 10.0, *) {
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default)
} else {
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, options: [])
}
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default)
try AVAudioSession.sharedInstance().setActive(!ignore)
} catch {
print("Error while setting ignore mute switch")
Expand All @@ -36,11 +32,7 @@ class AudioManager: NSObject {

func initAudioSession() -> Bool {
do {
if #available(iOS 10.0, *) {
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default)
} else {
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, options: [])
}
try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default)
return true
} catch {
return false
Expand Down
237 changes: 0 additions & 237 deletions Stepic/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions Stepic/CardStepViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ class CardStepViewController: UIViewController, CardStepView {

setupWebView()
presenter?.refreshStep()
NotificationCenter.default.addObserver(self, selector: #selector(self.didScreenRotate), name: UIDevice.orientationDidChangeNotification, object: nil)

if #available(iOS 11.0, *) {
scrollView.contentInsetAdjustmentBehavior = .never
}
self.scrollView.contentInsetAdjustmentBehavior = .never

NotificationCenter.default.addObserver(
self,
selector: #selector(self.didScreenRotate),
name: UIDevice.orientationDidChangeNotification,
object: nil
)
}

@objc func didScreenRotate() {
Expand Down
10 changes: 2 additions & 8 deletions Stepic/CertificatesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ final class CertificatesViewController: UIViewController, ControllerWithStepikPl
action: #selector(CertificatesViewController.refreshCertificates),
for: .valueChanged
)
if #available(iOS 10.0, *) {
tableView.refreshControl = refreshControl
} else {
tableView.addSubview(refreshControl)
}
tableView.refreshControl = refreshControl
refreshControl.layoutIfNeeded()
refreshControl.beginRefreshing()

Expand All @@ -111,9 +107,7 @@ final class CertificatesViewController: UIViewController, ControllerWithStepikPl

tableView.backgroundColor = UIColor.groupTableViewBackground

if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.contentInsetAdjustmentBehavior = .never

DispatchQueue.main.async {
self.displayRefreshing()
Expand Down
6 changes: 1 addition & 5 deletions Stepic/ChoiceQuizViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ final class ChoiceQuizViewController: QuizViewController {
var cellHeights: [CGFloat?] = []

var cellWidth: CGFloat {
if #available(iOS 11.0, *) {
return tableView.bounds.width - view.safeAreaInsets.left - view.safeAreaInsets.right
} else {
return tableView.bounds.width
}
return tableView.bounds.width - view.safeAreaInsets.left - view.safeAreaInsets.right
}

override func viewDidLoad() {
Expand Down
25 changes: 10 additions & 15 deletions Stepic/CodeInputAccessoryCollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,14 @@
//

import UIKit
import Foundation

class CodeInputAccessoryCollectionViewCell: UICollectionViewCell {

final class CodeInputAccessoryCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var textLabel: UILabel!

var text: String?
var size: CodeInputAccessorySize?

override func awakeFromNib() {
super.awakeFromNib()
}

fileprivate func setRoundedStyle() {
self.layer.cornerRadius = 4.0
self.layer.borderWidth = 1.0
self.layer.borderColor = UIColor.clear.cgColor
self.layer.masksToBounds = true
}

class func width(for text: String, size: CodeInputAccessorySize) -> CGFloat {
static func width(for text: String, size: CodeInputAccessorySize) -> CGFloat {
let label = UILabel(frame: CGRect(x: 0, y: 0, width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude))
label.numberOfLines = 1
label.text = text
Expand All @@ -45,4 +33,11 @@ class CodeInputAccessoryCollectionViewCell: UICollectionViewCell {
textLabel.font = regularCourier
setRoundedStyle()
}

private func setRoundedStyle() {
self.layer.cornerRadius = 4.0
self.layer.borderWidth = 1.0
self.layer.borderColor = UIColor.clear.cgColor
self.layer.masksToBounds = true
}
}
4 changes: 2 additions & 2 deletions Stepic/CodeInputAccessoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import Foundation
import SnapKit

class CodeInputAccessoryView: NibInitializableView {

final class CodeInputAccessoryView: NibInitializableView {
@IBOutlet weak var hideKeyboardImageView: UIImageView!
@IBOutlet weak var collectionView: UICollectionView!

Expand All @@ -21,6 +20,7 @@ class CodeInputAccessoryView: NibInitializableView {
collectionView.reloadData()
}
}

var size: CodeInputAccessorySize = .small

override var nibName: String {
Expand Down
31 changes: 0 additions & 31 deletions Stepic/CodeLanguagePickerViewController.swift

This file was deleted.

4 changes: 1 addition & 3 deletions Stepic/CodePlaygroundManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

import Foundation

class CodePlaygroundManager {
init() {}

final class CodePlaygroundManager {
let closers: [String: String] = ["{": "}", "[": "]", "(": ")", "\"": "\"", "'": "'"]

typealias Autocomplete = (suggestions: [String], prefix: String)
Expand Down
16 changes: 0 additions & 16 deletions Stepic/CodeQuizToolbarDelegate.swift

This file was deleted.

52 changes: 0 additions & 52 deletions Stepic/CodeQuizToolbarView.swift

This file was deleted.

75 changes: 0 additions & 75 deletions Stepic/CodeQuizToolbarView.xib

This file was deleted.

Loading