制作“照片库”的最佳方法应用程序
我真的很想尝试制作一个可以存储照片并受密码保护的应用程序,就像其他应用程序一样。 IE。只有我的眼睛,等等。我不会要求这里的任何人给我一步一步的指导如何制作一个(不过会很好;)。我要问的是我应该从哪里开始?我想使用分割视图控制器,并且我一直在努力让它们发挥作用。提前致谢,
泰特
I really wanted to try to make an app that stores photos and is password protected, much like the other apps out there. IE. My eyes only, etc. I am not asking anyone here to give me step by step instructions on how to make one (would be nice though ;). What I am asking is where should I even begin? I would like to use the split view controller, and Ive been trying to get those to work. Thanks in advance,
Tate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从高层次来看......这里有一些我会考虑的项目......
你将在哪里存储图像?服务器,本地?
如果是本地的,您将在哪里存储图像? IOS 照片库或您的应用程序目录?
接下来,您将如何显示图像?
iphone没有开箱即用的多列多行照片缩略图查看器(我知道)..因此你需要根据 UIScrollView 滚动你自己的
我也希望能够从图像分页到全屏模式下的图像,这也可以通过启用分页的 UIScrollView 来完成,每个页面都包含另一个包含图像视图的 UIScrollView(用于缩放和平移)。
我的清单上的下一个是内存管理。如果我在页面上显示多个图像,我无法渲染原始图像,也不会加载它们,因此每个图像都需要渲染和存储缩略图。关于调整图像大小有很好的代码。
接下来是捕获图像的问题。UIImagePickerController 将是您的控制器。
接下来是密码的问题。如果您半认真地想要保护它..将其存储在钥匙串中是您的选择。如果它只是一个简单的 pin 并且谁真正关心它是否被黑客攻击..那么只需将其存储在 NSUserDefaults 中即可。
这是读取 doc 目录图像的代码
,从这里开始,我确信您还可以做很多事情......但这至少是一个很好的起点。
from a high level.. here are some items I would think about...
where will you store the images? Server, Local?
if local, where you will you store the images? IOS Photo Library or your app directory?
next, how will you display the images?
iphone does not have a multi-column multi row photo thumbnail viewer out of the box (that Im aware of).. hence you will need to roll you own based on a UIScrollView
I would also want to have the ability to page from image to image in full screen mode, that too would be done with a UIScrollView, paging enabled,each page holding another UIScrollView (for zooming and panning) that holds the imageview.
next on my list would be memory management. if Im showing multiple images on page, there is no way I could render the original images, nor would I care to load them, so each image would need to have a thumbnail rendered and stored. there is good code out there on resizing an image.
next is the issue of capturing the image.. the UIImagePickerController will be your controller there.
next is the issue of the password. If you are semi serious about protecting it.. storing it in the keychain is your choice. If its just a simple pin and who really cares if its hacked.. then just store it in NSUserDefaults.
here is the code to read an image for your doc directory
and from here, Im sure there is a ton more you could do.. but its at least a good starting point.
与任何较大的项目一样,我建议您从较小的示例开始,然后逐步完善。例如,尝试构建以下小型应用程序:
一旦您在迷你应用程序上尝试了所有这些想法,您将对如何构建更大的 [pr0n-storing ;)] 图像有更好的想法应用程序...
Like any bigger project, I'd suggest you start with smaller examples and then work up. For example, try building small apps that:
Once you have tried out all these ideas on mini-apps, you'll have a much better idea on how to build your larger [pr0n-storing ;)] image app...