An image picker that mimics iMessage in iOS8

An image picker that mimics iMessage in iOS8

Supported platforms: iOS

Operating environment: iOS

Development language: Swift

Development tools: Xcode

Source code size: 61.43KB

Source code introduction

This demo is an image picker that imitates iMessage in iOS 8. The images to be selected can be scrolled in the option list view.

Source code running screenshot

Source code snippet

    override func viewDidLoad() {

    super .viewDidLoad()

              

    let tapRecognizer = UITapGestureRecognizer(target: self, action: "presentImagePickerSheet:" )

    self.view.addGestureRecognizer(tapRecognizer)

    }

          

    // MARK: Other Methods  

          

    func presentImagePickerSheet(gestureRecognizer: UITapGestureRecognizer) {

    let authorization = PHPhotopbrary.authorizationStatus()

              

    if authorization == .NotDetermined {

    PHPhotopbrary.requestAuthorization({ (status) -> Void in

    dispatch_async(dispatch_get_main_queue(), { () -> Void in

    self.presentImagePickerSheet(gestureRecognizer)

    })

    })

                  

    return  

    }

              

    if authorization == .Authorized {

    var sheet = BRNImagePickerSheet()

    sheet.numberOfButtons = 3  

    sheet.delegate = self

    sheet.showInView(self.view)

    }

    else {

    let alertView = UIAlertView(title: NSLocapzedString( "An error occurred" , comment: "An error occurred" ), message: NSLocapzedString( "BRNImagePickerSheet needs access to the camera roll" , comment: "BRNImagePickerSheet needs access to the camera roll" ), delegate: nil, cancelButtonTitle: NSLocapzedString( "OK" , comment: "OK" ))

    alertView.show()

    }

    }

Source code download address: http://down..com/data/1968726

<<:  Traffic monitoring of Android application source code

>>:  QR code generation and scanning source code download

Recommend

If we want more people to stay in space, what problems need to be solved?

On May 30, 2023, the Long March 2F rocket lifted ...

Get the complete version of search engine (SEM) marketing promotion methodology!

Search engine marketing (SEM) may be a concept th...

The King of Snakes - King Cobra

King cobra is the largest venomous snake in China...

Today's headlines traffic diversion skills and advantages

A bird of prey, eating large chunks of meat. I ha...

If the sunroof was not closed, would the owners of Nanjing Civic be in trouble?

Recently, a Nanjing Civic owner said that he was ...

The wheelbase lengthening battle of luxury mid-size SUVs will be started by BBA

On September 6, 1999, the Audi A6L officially rol...

Northern Lights visible in 17 states of the U.S.? Thanks to solar storms!

Author: Duan Yuechu Your browser does not support...

Tips for placing advertising video content on Tik Tok!

This article takes the education industry as an e...

The Japanese have acquired ARM, so Apple can switch to MIPS

The biggest news in the technology circle these d...