All Projects → gwpp → Gwpcourselistview

gwpp / Gwpcourselistview

Licence: apache-2.0
一个简单实用的课程表控件

Projects that are alternatives of or similar to Gwpcourselistview

Csc deeplearning
3-day dive into deep learning at csc
Stars: ✭ 22 (-29.03%)
Mutual labels:  course, school
Bell
⏱ Counting down to the next time the bell rings at school
Stars: ✭ 15 (-51.61%)
Mutual labels:  school
Learn Fp
learn-by-doing course/tutorial for functional programming on scala
Stars: ✭ 548 (+1667.74%)
Mutual labels:  course
Typescript Fundamentals
👨‍🏫 Mike's TypeScript Fundamentals Course
Stars: ✭ 732 (+2261.29%)
Mutual labels:  course
Course Crawler
🎓 中国大学MOOC、学堂在线、网易云课堂、好大学在线、爱课程 MOOC 课程下载。
Stars: ✭ 611 (+1870.97%)
Mutual labels:  course
Rutgersclasses
a Repo for CS assignments
Stars: ✭ 6 (-80.65%)
Mutual labels:  school
T 414 Aflv
T-414-ÁFLV: A Competitive Programming Course
Stars: ✭ 488 (+1474.19%)
Mutual labels:  course
Course
Slides and Jupyter notebooks
Stars: ✭ 29 (-6.45%)
Mutual labels:  course
School
A productivity app to organize school tasks
Stars: ✭ 28 (-9.68%)
Mutual labels:  school
Mastering Pycharm Course
Course demos and handouts for Talk Python's Mastering PyCharm course
Stars: ✭ 700 (+2158.06%)
Mutual labels:  course
42 subjects
All Subjects of 42 School
Stars: ✭ 693 (+2135.48%)
Mutual labels:  school
Machine Learning Book
《机器学习宝典》包含:谷歌机器学习速成课程(招式)+机器学习术语表(口诀)+机器学习规则(心得)+机器学习中的常识性问题 (内功)。该资源适用于机器学习、深度学习研究人员和爱好者参考!
Stars: ✭ 616 (+1887.1%)
Mutual labels:  course
Kubernetes Complete Course
Kubernetes 完全教程
Stars: ✭ 651 (+2000%)
Mutual labels:  course
Pl Compiler Resource
程序语言与编译技术相关资料(持续更新中)
Stars: ✭ 578 (+1764.52%)
Mutual labels:  course
React Intro
Исходный код для курса "Знакомство с React"
Stars: ✭ 15 (-51.61%)
Mutual labels:  course
Seckill
一个整合SSM框架的高并发和商品秒杀项目,学习目前较流行的Java框架组合实现高并发秒杀API
Stars: ✭ 513 (+1554.84%)
Mutual labels:  course
Machine Learning Curriculum
💻 Make machines learn so that you don't have to struggle to program them; The ultimate list
Stars: ✭ 761 (+2354.84%)
Mutual labels:  course
Cs704
CS 704 course website - Principles of Programming Languages
Stars: ✭ 30 (-3.23%)
Mutual labels:  course
Python plotting snippets
Tips and tricks for plotting in python
Stars: ✭ 28 (-9.68%)
Mutual labels:  course
Course julia day
Notes for getting to know the Julia programming language in one day.
Stars: ✭ 23 (-25.81%)
Mutual labels:  course

GWPCourseListView,一个简单实用的课程表控件

Install:

  • git clone本项目后,里面有一个GWPCourseListView文件夹,直接将该文件夹拖入项目即可。

Use:

  • GWPCourseListView直接继承自UIView,控件布局方面没有任何特殊要求。
  • 基本的几个代理方法,实现数据回调
#pragma mark - GWPCourseListViewDataSource
- (NSArray<id<Course>> *)courseForCourseListView:(GWPCourseListView *)courseListView{
    return self.courseArr;
}

/** 课程单元背景色自定义 */
- (UIColor *)courseListView:(GWPCourseListView *)courseListView courseTitleBackgroundColorForCourse:(id<Course>)course{
    if ([course isEqual:[self.courseArr firstObject]]) {    // 第一个,返回自定义颜色
        return [UIColor blueColor];
    }
    
    // 其他返回默认的随机色
    return nil;
}

/** 设置选项卡的title的文字属性,如果实现该方法,该方法返回的attribute将会是attributeString的属性 */
- (NSDictionary*)courseListView:(GWPCourseListView *)courseListView titleAttributesInTopbarAtIndex:(NSInteger)index{
    if (index==0) {
        return @{NSForegroundColorAttributeName:[UIColor greenColor], NSFontAttributeName:[UIFont systemFontOfSize:18]};
    }
    
    return nil;
}
/** 设置选项卡的title的背景颜色,默认白色 */
- (UIColor*)courseListView:(GWPCourseListView *)courseListView titleBackgroundColorInTopbarAtIndex:(NSInteger)index{
    if (index==1) {
        return [UIColor purpleColor];
    }
    
    return nil;
}

#pragma mark - GWPCourseListViewDelegate
/** 选中(点击)某一个课程单元之后的回调 */
- (void)courseListView:(GWPCourseListView *)courseListView didSelectedCourse:(id<Course>)course{
    
}
  • 项目中的CourseModel并非必需,您可以自定义模型,只要遵守Course协议即可。

其他见DEMO

集成后使用效果

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].