Let's take a look at the effect chart.
The following words not much, we directly on the code:
#import "ViewController.h" @interface Viewcontroller () <uinavigationcontrollerdelegate,
Uiimagepickercontrollerdelegate> @property (Weak, nonatomic) Iboutlet Uiimageview *iconview; @end @implementation Viewcontroller-(ibaction) Chooseimage {//pop-up system albums Uiimagepickercontroller *PICKVC = [[Uiimagep
Ickercontroller alloc] init];
Set Photo source Pickvc.sourcetype = Uiimagepickercontrollersourcetypesavedphotosalbum;
Pickvc.delegate = self;
[Self PRESENTVIEWCONTROLLER:PICKVC animated:yes completion:nil]; } #pragma mark-uiimagepickercontrollerdelegate-(void) Imagepickercontroller: (Uiimagepickercontroller *) picker Didfinishpickingmediawithinfo: (nsdictionary<nsstring *,id> *) info{uiimage *photo = info[
Uiimagepickercontrolleroriginalimage];
Uiimageview *imagev = [[Uiimageview alloc] init]; Imagev.frame = self.
Iconview.frame;
Imagev.image = photo;
imagev.userinteractionenabled = YES;
[Self.view Addsubview:imagev]; [Self Dismissviewcontrolleranimated:yesCompletion:nil]; } @end
Summarize
Above is how iOS get system photo of the sample code, the need for friends can be used directly, the development of everyone is still very helpful, if you have questions can be exchanged message.