There is less information on the current location record on the web, so record the pit.
Get album Pictures
1: var iPC = Uiimagepickercontroller ()
2: ipc.sourcetype = uiimagepickercontrollersourcetype.savedphotosalbum
3: IPC. Delegate = Self
4: true in
5: Print ("complete")
6: }
1: func imagepickercontroller (Picker:uiimagepickercontroller, Didfinishpickingmediawithinfo Info: [Nsobject:anyobject]) {
2: // println (info)
3:
4: let img = info["uiimagepickercontrolleroriginalimage"as! UIImage
5: let PV = PhotoView (Frame:paintView.frame, img:img)
6: View.addsubview (PV)
7: PV. Delegate = Self
8: photoView = PV
9: dismissviewcontrolleranimated (true, Completion:nil)
Ten: }
Save to System album
1: func Save () {
2: false, 0.0)
3: var ctx = Uigraphicsgetcurrentcontext ()
4: layer.renderincontext (CTX)
5: let img = Uigraphicsgetimagefromcurrentimagecontext ()
6: Uigraphicsendimagecontext ()
7: "Image:didFinishSavingWithError:contextInfo:", nil)
8: }
1: func image (Image:uiimage, Didfinishsavingwitherror error:nserror, Contextinfo:unsafepointer <Void>) {
2: // if let R = Error {
3: // print (R)
4: // }else{
5: //Let e:nserror? = Error
6: if as Nserror? {
7: print (EE)
8: }else{
9: "Save success!" "delegate"). Show ()
Ten: }
One : }
REF:
Http://stackoverflow.com/questions/25108888/strugglig-to-convert-objective-c-selector-and-target-signature-to-swift
Http://stackoverflow.com/questions/24101468/checking-optionals-for-nil-in-swift
Get album pictures and save to albums in Swift