如何在Swift中制作日历视图 [英] How can I make calendar view in Swift

查看:121
本文介绍了如何在Swift中制作日历视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Swift 2中制作简单的日历应用程序,但是我不知道从哪里开始.我知道cocopoads提供了一些很棒的日历组件,但是它们的文档尚未完成,作为一个初学者,我很难阅读它们并研究代码.我下载了一些流行的cocoapods并与它们一起玩,但是我缺少一个需要的功能.

I want to make simple calendar app in Swift 2, but I don't know where to start. I know there are some great calendar components available in cocopoads but docs for them are unfinished and as a beginner it is hard for me to read them and investigate code. I downloaded some popular cocoapods and played with them but that one functionalty I need is missing.

我想用一些日期和其他东西制作简单的月经日记.我以为这很简单,但是经过一天的调查,我觉得这很困难.也许我错了.

I want to make simple menstrual diary for a practice with dates and other stuff. I imagined this would be simple but after a day of investigating I thing it is rather hard. Maybe I'm wrong.

那么我如何制作自己的日历视图?我应该从日期的表视图和集合视图开始吗?

So how I make my own calendar view? Should I start with tableview and collection view for dates?

有人可以给我一些指导,我现在迷失了.我应该以某种方式学会发表自己的看法(我是新手,所以这可能太难了)还是我应该使用一些自定义日历?

Can somebody give me some pointers, I'm lost at this point. Shoud I somehow learn to make my own view (I am a beginner so maybe this is too hard) or shoud I use some custom calendar?

推荐答案

Apple没有没有日历控件,许多开发人员迷失了如何构建日历控件.

Apple has no calendar control, and many developers are lost in how to build one.

是一个很好的文档.它是我自己开发的.如果您在设置方面需要帮助,我可以提供.您可以在此处找到完整的教程.

A good cocoapod that is well documented is this one. It was developed by myself. If you need help setting up things, I can provide that. Full tutorials to get you started located here.

但是,如果您想知道它是如何由内而外构建的,那么您可以自己构建一个,然后可以查看

If however, you want to know how it was built inside out so that you can build one yourself, then you can check out this link. It shows you in detail how it was built using a UICollectionView. Since you said you are new to programming, the first option is easier in my honest opinion for now.

但是您是一名编码人员,在某些时候您应该学习.因此,我建议您学习swift/objective-c,直到您对此感到满意为止.从创建表视图等简单项目开始.了解委派的工作原理等.

But you're a coder, and at some point you should learn. So I suggest learning swift/objective-c until you become comfortable with it. Start out with simple projects like creating a table view etc. Learn how delegation works etc.

一旦您在视图,委派等方面更胜一筹,那么您将更容易创建自己的日历控件.

Once you are better at views, delegation, etc, then you will be more comfortable to create you own calendar control.

这篇关于如何在Swift中制作日历视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆