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

Why is physics so powerful in creating new mathematics?

The development of physics in the 20th century be...

Product operation: overall operation framework ideas for content marketing!

Content marketing is divided into three aspects 1...

Why has Google failed to get Android development on track?

Introduction It's 2015 now, mobile is the new...

How to capture users from the new Internet model

The Internet model from 2012 to 2015 mainly consi...

Case Study: 12 Gamification Strategies for User Growth

This article uses a case study to introduce how t...

"Space Express", set off! China's space station construction phase begins

In the early morning of the 10th, my country succ...

Summary of the latest information flow advertising platforms in 2017

Feed ads are a form of advertising that is inters...

Super practical! 36 tips for new live streaming sales

When you enter the live broadcast room of Li Jiaq...

How to do search engine bidding promotion?

Internet website building and marketing has been ...

How much does it cost to rent a 300g defense server in China?

A high-defense server is like putting a layer of ...