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

Comprehensive insight into explosive user growth!

Fission growth? AARRR model? These familiar conce...

Sharing practical experience in operating and promoting Xiaohongshu

As of January this year, Xiaohongshu has more tha...

Java Journey: A Traveler's Map

[[163802]] Some time ago, I sorted out my Java kn...

Eleven Trends Predicted for New Consumer Brands in 2022

The collective rise of new consumer brands is und...

Is it cheap to rent a BGP server room?

Is it cheap to rent a BGP server room? The BGP co...

Deloitte: Global Healthcare Outlook Report 2022

In 2022, two years into the COVID-19 pandemic, th...

The core of Double Eleven marketing event promotion planning!

Since 2014, November 11th of every year has becom...

How to design a B-side button? Check out this expert summary!

In the B-side interface, buttons are the most bas...

2022 Latest Kaochong Wanci Winter Vacation Class

Introduction to the latest 2022 Kaochong Wanci wi...

6 steps to successful copywriting: There are routines for writing good copy

Copywriting is a sword that can pierce the hearts...

iOS componentization is not just the architect's job

iOS componentization was once a hot topic in the ...

Rogue software uses "obsessive compulsive disorder avatar"

Recently, a group of WeChat avatars that claim to...