iOS Select Photo Optimizer

Source: Internet
Author: User

1. Questions

Sometimes in iOS you need to select a local picture or take a photo, sometimes choose the photo when there will be multiple selection and a single, so you need to first package album selection, in the previous blog has also been written to the iOS multi-menu selection album Pictures. This is just the package for selecting pictures in the album. There are two ways in which we can select images in the app: one is through the photo album and one is through the camera. However, the problem arises again, each call to select a picture or to implement a single-select multiple selection and Uiimagepickercontroller, multiple calls will be implemented many times, so that the code is redundant, so it needs further optimization.

2. Analyzing problems

First, whether it is the package of single-choice multi-Select or the system to take pictures are to obtain the picture (function similar).

Second, the single-choice multi-choice and the system takes the photograph calls all is Viewcontroller

Three, are all through the page to obtain the picture system for the camera agent, single-choice multi-choice is block

3. Problem solving

Based on the above 3 points reminds me of a simple factory, can be further encapsulated, according to the parameters to generate a different Viewcontroller, page transfer is also a picture, the block and the agent to unify the same value method.

iOS Select Photo Optimizer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.