-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #983 from StepicOrg/release/1.175
Release 1.175
- Loading branch information
Showing
70 changed files
with
3,086 additions
and
99 deletions.
There are no files selected for viewing
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 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...c/Images.xcassets/New course list/user-courses-reviews-block-stars.imageset/Contents.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "user-courses-reviews-block-stars.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file added
BIN
+2.59 KB
...ourse list/user-courses-reviews-block-stars.imageset/user-courses-reviews-block-stars.pdf
Binary file not shown.
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 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 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 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 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 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 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 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 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
26 changes: 26 additions & 0 deletions
26
Stepic/Legacy/Model/PlainObjects/CourseReviewPlainObject.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Foundation | ||
|
||
struct CourseReviewPlainObject { | ||
let id: Int | ||
let courseID: Int | ||
let userID: Int | ||
let score: Int | ||
let text: String | ||
let creationDate: Date | ||
var course: CoursePlainObject? | ||
} | ||
|
||
extension CourseReviewPlainObject { | ||
init(courseReview: CourseReview) { | ||
self.id = courseReview.id | ||
self.courseID = courseReview.courseID | ||
self.userID = courseReview.userID | ||
self.score = courseReview.score | ||
self.text = courseReview.text | ||
self.creationDate = courseReview.creationDate | ||
|
||
if let course = courseReview.course { | ||
self.course = CoursePlainObject(course: course, withSections: false) | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
Stepic/Legacy/Views/Skeleton/Views/CourseList/UserCoursesReviewsBlockSkeletonView.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import SnapKit | ||
import UIKit | ||
|
||
extension UserCoursesReviewsBlockSkeletonView { | ||
struct Appearance { | ||
let cornerRadius: CGFloat = 4 | ||
} | ||
} | ||
|
||
final class UserCoursesReviewsBlockSkeletonView: UIView { | ||
let appearance: Appearance | ||
|
||
private lazy var titleLabelSkeleton = UIView() | ||
|
||
init( | ||
frame: CGRect = .zero, | ||
appearance: Appearance = Appearance() | ||
) { | ||
self.appearance = appearance | ||
super.init(frame: frame) | ||
|
||
self.setupView() | ||
self.addSubviews() | ||
self.makeConstraints() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
} | ||
|
||
extension UserCoursesReviewsBlockSkeletonView: ProgrammaticallyInitializableViewProtocol { | ||
func setupView() { | ||
self.backgroundColor = .clear | ||
|
||
self.titleLabelSkeleton.clipsToBounds = true | ||
self.titleLabelSkeleton.layer.cornerRadius = self.appearance.cornerRadius | ||
} | ||
|
||
func addSubviews() { | ||
self.addSubview(self.titleLabelSkeleton) | ||
} | ||
|
||
func makeConstraints() { | ||
self.titleLabelSkeleton.translatesAutoresizingMaskIntoConstraints = false | ||
self.titleLabelSkeleton.snp.makeConstraints { $0.edges.equalToSuperview() } | ||
} | ||
} |
Oops, something went wrong.