【代码笔记】iOS-日历
一, 效果图。
二,工程图。
三,代码。
RootViewController.h

#import <UIKit/UIKit.h> #import "CalendarView.h"
#import "CalendarUtils.h"
#import "CalendarStyle.h" @interface RootViewController : UIViewController
<CalendarViewDelegate>
{
CalendarView *calendarView;
} @end

RootViewController.m

#import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. self.title=@"Calendar"; [self initWithCalendarView]; }
-(void)initWithCalendarView
{
if(calendarView)
[calendarView removeFromSuperview];
calendarView = [[CalendarView alloc]initWithFrame:CGRectMake(10, self.view.bounds.size.height - 200 - 320 + 20, 300, 300)];
[calendarView refleshriCheng:^(NSDate *date,NSString *str) {
if([str isEqualToString:@"left"]){ UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"点击了左侧按钮" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
}
else if([str isEqualToString:@"right"]){
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"点击了右侧按钮" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
}
}];
calendarView.delegate=self;
[self.view addSubview:calendarView];
}
#pragma -mark -CalendarViewDelegate
- (void) calendarViewDidSelectDate:(NSDate *)date todayDate:(NSDate *)todayDate
{ UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"点击了日期" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show]; } - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

【代码笔记】iOS-日历的更多相关文章
- IOS开发笔记 IOS如何访问通讯录
IOS开发笔记 IOS如何访问通讯录 其实我是反对这类的需求,你说你读我的隐私,我肯定不愿意的. 幸好ios6.0 以后给了个权限控制.当打开app的时候你可以选择拒绝. 实现方法: [plain] ...
- 【hadoop代码笔记】Mapreduce shuffle过程之Map输出过程
一.概要描述 shuffle是MapReduce的一个核心过程,因此没有在前面的MapReduce作业提交的过程中描述,而是单独拿出来比较详细的描述. 根据官方的流程图示如下: 本篇文章中只是想尝试从 ...
- 【hadoop代码笔记】hadoop作业提交之汇总
一.概述 在本篇博文中,试图通过代码了解hadoop job执行的整个流程.即用户提交的mapreduce的jar文件.输入提交到hadoop的集群,并在集群中运行.重点在代码的角度描述整个流程,有些 ...
- 【Hadoop代码笔记】目录
整理09年时候做的Hadoop的代码笔记. 开始. [Hadoop代码笔记]Hadoop作业提交之客户端作业提交 [Hadoop代码笔记]通过JobClient对Jobtracker的调用看详细了解H ...
- 笔记-iOS 视图控制器转场详解(上)
这是一篇长文,详细讲解了视图控制器转场的方方面面,配有详细的示意图和代码,为了使得文章在微信公众号中易于阅读,seedante 辛苦将大量长篇代码用截图的方式呈现,另外作者也在 Github 上附上了 ...
- 通过 C# 代码操作 Google 日历
原文:通过 C# 代码操作 Google 日历 本文主题 借助 Google .NET APIs Client Library,通过 C# 代码在 Google 日历中创建会议邀请. 本文背景 最近, ...
- <Python Text Processing with NLTK 2.0 Cookbook>代码笔记
如下是<Python Text Processing with NLTK 2.0 Cookbook>一书部分章节的代码笔记. Tokenizing text into sentences ...
- 超级简单!80行代码实现Google日历(拖放、移动、AJAX)
行代码实现Google日历 Introduction 本实例介绍使用DayPilot Lite for ASP.NET MVC library 类来实现类google日历效果. 在线实例 天视图 星 ...
- [学习笔记] SSD代码笔记 + EifficientNet backbone 练习
SSD代码笔记 + EifficientNet backbone 练习 ssd代码完全ok了,然后用最近性能和速度都非常牛的Eifficient Net做backbone设计了自己的TinySSD网络 ...
- DW网页代码笔记
DW网页代码笔记 1.样式. class 插入类样式 标签技术(html)解决页面的内容样式技术(css)解决页面的外观脚本技术 解决页面动态交互问题<form> ...
随机推荐
- Oracle10g在Win2008R2下因版本无法安装问题的解决
次文章为转载的: 首先需要从官网下载Windows_vista版本的oracle10g,下载地址为:http://download.oracle.com/otn/nt/oracle10g/10203/ ...
- 使用LinkedList模拟一个堆栈或者队列数据结构
使用LinkedList模拟一个堆栈或者队列数据结构. 堆栈:先进后出 如同一个杯子. 队列:先进先出 如同一个水管. import java.util.LinkedList; public cl ...
- LeetCode - 50. Pow(x, n)
50. Pow(x, n) Problem's Link ----------------------------------------------------------------------- ...
- 【原创】kafka controller源代码分析(一)
Kafka集群中的一个broker会被作为controller负责管理分区和副本的状态以及执行类似于重分配分区之类的管理任务.如果当前的controller失败了,会从剩下的broker中选出新的co ...
- 炉石传说 C# 开发笔记 (法术篇)
炉石的设计,最核心的内容是法术效果. 法术卡牌,无疑是法术的集中体现,但是,法术效果除了在法术卡牌之外,也不除不在. 随从的战吼,亡语,奥秘的揭示等等都是法术效果的体现. 法术卡牌在炉石里面有很多种( ...
- 算法实例-C#-快速排序-QuickSort
算法实例 ##排序算法Sort## ### 快速排序QuickSort ### bing搜索结果 http://www.bing.com/knows/search?q=%E5%BF%AB%E9%80% ...
- 传智播客JavaWeb听课总结
一. JavaWeb基础 第一天: 1.Eclipse详解: (1).Bad versionnumber in .class file:编译器版本和运行(JRE)版本不符合.高的JRE版本兼容低版本的 ...
- 基于类型系统的面向对象编程语言Go
(整理自网络) 面向对象编程 Go语言的面向对象编程(OOP)非常简洁而优雅.说它简洁,在于它没有了OOP中很多概念,比如:继承.虚函数.构造函数和析构函数.隐藏的this指针等等.说它优雅,是它的面 ...
- oracle sql初次接触
oracle 语法有些地方都是和mysql一样,但还是有很多不同之处: 注意:dual该表为oracle中本身就存在的数据表.比如想取数据库时间(系统时间)就可以用这张表来完成. 创建表语法: cre ...
- Scalaz(31)- Free :自由数据结构-算式和算法的关注分离
我们可以通过自由数据结构(Free Structure)实现对程序的算式和算法分离关注(separation of concern).算式(Abstract Syntax Tree, AST)即运算表 ...