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

Several strategies for good news marketing

In the increasingly competitive Internet, it is c...

Android tracking technology analysis

1. Tracking is a method of collecting data from w...

New version of Microsoft Launcher released: improved UI and battery life

Microsoft Launcher 6.2.201202.9334 for Android wa...

Where can I make a 400 number and what are the ways to do so?

In daily life, you must have seen a ten-digit 400...

Is advanced precise matching important in Baidu bidding?

Everyone knows that Baidu bidding has a matching ...

Chevrolet Equinox overseas price starts at 168,000

Recently, Chevrolet announced the price of the 20...

App fission promotion: N kinds of techniques are fully analyzed!

In an era where traffic is king, social platforms...

Analysis of member activity promotion techniques!

This article once again focuses on a membership a...

Reflections and Prospects of iOS Developers from 2016 to 2018

[[222173]] Preface I have been working in iOS dev...

Apple releases iOS 9.0.1, fixes multiple bugs

Today, Apple released iOS 9.0.1, a minor update t...