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
21 changes: 9 additions & 12 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ PODS:
- Charts (3.4.0):
- Charts/Core (= 3.4.0)
- Charts/Core (3.4.0)
- CocoaLumberjack (3.4.2):
- CocoaLumberjack/Default (= 3.4.2)
- CocoaLumberjack/Extensions (= 3.4.2)
- CocoaLumberjack/Default (3.4.2)
- CocoaLumberjack/Extensions (3.4.2):
- CocoaLumberjack/Default
- CocoaLumberjack (3.6.0):
- CocoaLumberjack/Core (= 3.6.0)
- CocoaLumberjack/Core (3.6.0)
- Crashlytics (3.14.0):
- Fabric (~> 1.10.2)
- CRToast (0.0.9)
Expand Down Expand Up @@ -160,7 +157,7 @@ PODS:
- PromiseKit/CorePromise
- Protobuf (3.10.0)
- Quick (2.2.0)
- Reveal-SDK (20)
- Reveal-SDK (24)
- SDWebImage (5.3.1):
- SDWebImage/Core (= 5.3.1)
- SDWebImage/Core (5.3.1)
Expand All @@ -171,7 +168,7 @@ PODS:
- SVProgressHUD (2.2.5)
- SwiftDate (6.1.0)
- SwiftLint (0.35.0)
- SwiftyGif (5.1.1)
- SwiftyGif (5.2.0)
- SwiftyJSON (5.0.0)
- Tabman (2.4.3):
- AutoInsetter (~> 1.7.2)
Expand Down Expand Up @@ -319,7 +316,7 @@ CHECKOUT OPTIONS:
:commit: cca23268da048a8d16b7a1dd88dcbd7dbda92a7b
:git: https://github.com/ivan-magda/swift-log.git
SVGKit:
:commit: bfe62f6d45f55c9fe39619d9e91fed1844c59da6
:commit: c40671b9a264f8f71831c4e0452736debfae2164
:git: https://github.com/SVGKit/SVGKit.git
TSMessages:
:commit: e4802d290362c87ba8a35c1afae88668dba8ab9a
Expand All @@ -335,7 +332,7 @@ SPEC CHECKSUMS:
BEMCheckBox: 5ba6e37ade3d3657b36caecc35c8b75c6c2b1a4e
Branch: 3cc6dcfd726db42ced22c418c0fb09aa5e90a847
Charts: 74c9f256eaf0460c0c416522d1cf8c634ea6b286
CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd
CocoaLumberjack: 78b0c238666f4f58db069738ec176f4519557516
Crashlytics: 540b7e5f5da5a042647227a5e3ac51d85eed06df
CRToast: 5a78c22b921c5ed3487488af605bc403a9c92fed
DeviceKit: da103891aa928d89f64ea8dd8aca738c5f3d8ac0
Expand Down Expand Up @@ -375,15 +372,15 @@ SPEC CHECKSUMS:
PromiseKit: e4863d06976e7dee5e41c04fc7371c16b3600292
Protobuf: a4dc852ad69c027ca2166ed287b856697814375b
Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e
Reveal-SDK: 43206a57f575632fd304e85385cc259b5d359e32
Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071
SDWebImage: 7137d57385fb632129838c1e6ab9528a22c666cc
SnapKit: fe8a619752f3f27075cc9a90244d75c6c3f27e2a
STRegex: dfa420d93d8c1402956233b3879ec1fc14b45fbe
SVGKit: 8a2fc74258bdb2abb54d3b65f3dd68b0277a9c4d
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
SwiftDate: fa2bb3962056bb44047b4b85a30044e5eae30b03
SwiftLint: 5553187048b900c91aa03552807681bb6b027846
SwiftyGif: f7702483db93586a41f04f4927cd682852a2fa10
SwiftyGif: b85c6b33a9411859d9e1db998b6a8214aea942df
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7
Tabman: c2c83ebfcbec3e5be67e27a1dd6689a4e3efccd3
TSMessages: eb3cf27b6900684a21bad4fe9ea426e287b8c839
Expand Down
92 changes: 70 additions & 22 deletions Stepic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Stepic.xcodeproj/xcshareddata/xcschemes/Stepic.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1030"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 8 additions & 2 deletions Stepic/Analytics/AmplitudeAnalyticsEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ struct AmplitudeAnalyticsEvents {
)
}

static func deleted(content: Content) -> AnalyticsEvent {
static func deleted(content: Content, source: DeleteDownloadSource) -> AnalyticsEvent {
return AnalyticsEvent(
name: "Download deleted",
parameters: [
"content": content.rawValue
"content": content.rawValue,
"source": source.rawValue
]
)
}
Expand All @@ -174,6 +175,11 @@ struct AmplitudeAnalyticsEvents {
case lesson
case step
}

enum DeleteDownloadSource: String {
case syllabus
case downloads
}
}

struct Search {
Expand Down
63 changes: 0 additions & 63 deletions Stepic/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,6 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Downloads-->
<scene sceneID="B6E-0I-IzT">
<objects>
<viewController storyboardIdentifier="DownloadsViewController" id="g7w-5Y-f4V" customClass="DownloadsViewController" customModule="Stepic" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="VVz-oY-EAd">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="60" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="jdI-2w-A1S" customClass="StepikTableView" customModule="Stepic">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="dataSource" destination="g7w-5Y-f4V" id="AXZ-6d-SaB"/>
<outlet property="delegate" destination="g7w-5Y-f4V" id="nUB-Md-pGz"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="jdI-2w-A1S" firstAttribute="bottom" secondItem="Wte-7e-MNR" secondAttribute="bottom" id="FCZ-yK-uZj"/>
<constraint firstItem="Wte-7e-MNR" firstAttribute="trailing" secondItem="jdI-2w-A1S" secondAttribute="trailing" id="FN6-0f-0IO"/>
<constraint firstItem="jdI-2w-A1S" firstAttribute="top" secondItem="VVz-oY-EAd" secondAttribute="top" id="J49-xR-zY8"/>
<constraint firstItem="jdI-2w-A1S" firstAttribute="leading" secondItem="Wte-7e-MNR" secondAttribute="leading" id="grd-Io-dlx"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Wte-7e-MNR"/>
</view>
<navigationItem key="navigationItem" title="Downloads" id="9Ja-ap-5iY">
<barButtonItem key="rightBarButtonItem" title="Clear cache" id="WWT-xn-H4f">
<connections>
<action selector="clearCachePressed:" destination="g7w-5Y-f4V" id="2ET-gg-F9K"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="tableView" destination="jdI-2w-A1S" id="M2W-YW-0ok"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="7a5-ET-4lH" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1670" y="2641"/>
</scene>
<!--Styled Tab Bar View Controller-->
<scene sceneID="h7W-ra-FMl">
<objects>
Expand All @@ -77,25 +36,6 @@
</objects>
<point key="canvasLocation" x="1458" y="842"/>
</scene>
<!--Downloads-->
<scene sceneID="Laj-7g-BZD">
<objects>
<navigationController storyboardIdentifier="DownloadsNavigation" automaticallyAdjustsScrollViewInsets="NO" id="MT9-2h-A7A" customClass="StyledNavigationController" customModule="Stepic" customModuleProvider="target" sceneMemberID="viewController">
<tabBarItem key="tabBarItem" title="Downloads" image="tab-downloads" selectedImage="tab-downloads" id="Wmp-3r-xny"/>
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="W60-es-dLX">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="g7w-5Y-f4V" kind="relationship" relationship="rootViewController" id="4gB-gX-pmH"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="KcB-yW-iiN" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="900" y="2641"/>
</scene>
<!--Styled Navigation Controller-->
<scene sceneID="dHl-Iz-Z0Q">
<objects>
Expand Down Expand Up @@ -173,7 +113,4 @@
<point key="canvasLocation" x="857" y="843"/>
</scene>
</scenes>
<resources>
<image name="tab-downloads" width="20" height="22"/>
</resources>
</document>
9 changes: 5 additions & 4 deletions Stepic/Course.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,17 @@ final class Course: NSManagedObject, IDFetchable {
}
}

class func getAllCourses(enrolled: Bool? = nil) -> [Course] {
static func getAllCourses(enrolled: Bool? = nil) -> [Course] {
let request = NSFetchRequest<NSFetchRequestResult>(entityName: "Course")
var predicate = NSPredicate(value: true)

if let e = enrolled {
let p = NSPredicate(format: "managedEnrolled == %@", e as NSNumber)
predicate = NSCompoundPredicate(type: NSCompoundPredicate.LogicalType.and, subpredicates: [predicate, p])
if let enrolled = enrolled {
let enrolledPredicate = NSPredicate(format: "managedEnrolled == %@", enrolled as NSNumber)
predicate = NSCompoundPredicate(type: .and, subpredicates: [predicate, enrolledPredicate])
}

request.predicate = predicate

do {
let results = try CoreDataHelper.instance.context.fetch(request)
return results as! [Course]
Expand Down
32 changes: 0 additions & 32 deletions Stepic/DownloadTableViewCell.swift

This file was deleted.

80 changes: 0 additions & 80 deletions Stepic/DownloadTableViewCell.xib

This file was deleted.

Loading