Ios8 notification in swift

Source: Internet
Author: User

Ios8 notification in swift

AppDelegate. swift


ViewController. swift


Run and press command + L/command + H to bring the simulator to the screen lock/main screen. The effect is as follows:


The following processes the click events of First Action and Second Action: <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + u7nkx9rjxbwrgvszwdhdguuc3dpzntw0kospc9wpgo8cd48aw1nihnyyz0 = "http://www.2cto.com/uploadfile/Collfiles/20140912/20140912090559134.png" alt = "\">

Then, receive and process the notification in ViewController. swift,


You can see the specific effect by running it yourself. It will not be posted here.

In addition, in the simulator Settings-> Notifications-> you can set the notification pop-up style, you can select three styles (run the program first and then you can see the Notifications option in Settings)


.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.