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

New trends in ASO optimization in 2016!

The bell of 2016 has rung. Looking back on 2015, ...

How to quickly develop a marketing plan from 0 to 1

After years of development, with the emergence an...

The report says that Android will account for 82.6% of the market share in 2019

The competition between iOS and Android has enter...

Why can your activities attract fans but fail to retain them?

The purpose of organizing activities is not to co...

Efficient App offline activity method!

As an App promotion operator , event promotion is...

PPI April 2021 iPad Illustration Course [HD Quality] Course Catalog

01Introduction to Software Basics.mp4 02 Line dra...

This whale named "Little Guagua" died, probably because humans were too noisy

Do you remember the animal events that frequently...

How to find accurate seed users? Attached with classic practical cases!

Analysis ideas for finding seed users : The follo...

The hidden champion of short video track

In the era of attention economy, where eyeballs a...