Summarize code for the three presentation experiments

Image Picker Controller

@IBAction func experiment() {
    let controller = UIImagePickerController()
    self.presentViewController(controller, animated: true, completion: nil)
}

Activity View Controller

@IBAction func experiment() {
    let image = UIImage()
    let controller = UIActivityViewController(activityItems: [image], applicationActivities: nil)
    self.presentViewController(controller, animated: true, completion: nil)
}

Alert View Controller

@IBAction func experiment() {
    let controller = UIAlertController()
    controller.title = "Test alert"
    controller.message = "This is a test"

    // Dismiss the view controller after the user taps “ok”
    let okAction = UIAlertAction (title:"ok", style: UIAlertActionStyle.Default) {
        action in self.dismissViewControllerAnimated(true, completion: nil)
    }
    controller.addAction(okAction)
    self.presentViewController(controller, animated: true, completion:nil)
}
时间: 2024-11-10 04:40:12

Summarize code for the three presentation experiments的相关文章

keynote代码高亮【转】

码农即使做ppt,也离不开代码,在keynote下,如果要粘贴代码,如何做到语法高亮呢? 补充1,该功能由pygments提供支持,所以支持的语言见:http://pygments.org/languages/ 补充2,下文中的直接转化剪贴板里的内容,设置语言为-S py,其中py的意思是如果这段代码存成文件的话,应该是.py,所以,如果你想要贴一段objective-c的代码,显然就是-s m了. 原文和出处转载如下,不另行翻译了: http://www.peterbe.com/plog/hi

11月9日 Meetup and talk about JS

Dear JS-Ninjas, We hope you enjoyed your October Holiday. We are happy to announce that the next JS Meetup will be on November 9th at 7pm at Agora Space. Our speakers for the November 9th meetup are:  1. Chen Yong from Teambition Topic: Hot Code Repl

Microsoft .NET Pet Shop 4: Migrating an ASP.NET 1.1 Application to 2.0

249 out of 297 rated this helpful - Rate this topic Gregory LeakeMicrosoft Corporation Alan Le, Alex Arkhipov, Mike Hanley, and Steve NyholmVertigo Software, Inc. February 2006 Applies to:    Microsoft .NET Framework 2.0     Microsoft Visual Studio 2

Model-View-ViewModel (MVVM) Explained 转摘自:http://www.wintellect.com/blogs/jlikness/model-view-viewmodel-mvvm-explained

The purpose of this post is to provide an introduction to the Model-View-ViewModel (MVVM) pattern. While I've participated in lots of discussions online about MVVM, it occurred to me that beginners who are learning the pattern have very little to go

用Cython编译写出更快的Python代码

原文地址: http://www.behnel.de/cython200910/talk.html以下为原文 About myself Passionate Python developer since 2002 after Basic, Logo, Pascal, Prolog, Scheme, Java, C, ... CS studies in Germany, Ireland, France PhD in distributed systems in 2007 Language desi

Microsoft .NET Pet Shop 4

https://msdn.microsoft.com/en-us/library/aa479070.aspx Executive Overview The .NET Pet Shop application is designed to show the best practices for building enterprise, n-tier .NET 2.0 applications that may need to support a variety of database platfo

A Look Inside Presentation Controllers

A Look Inside Presentation Controllers Session 228WWDC 2014 iOS 8 brings you powerful new means of presenting content within your apps. Hear how presentation controllers were leveraged by UIKit to give you fine grain control using new alert and searc

Exploring Python Code Objects

Exploring Python Code Objects https://late.am/post/2012/03/26/exploring-python-code-objects.html Inspired by David Beazley's Keynote at PyCon, I've been digging around in code objects in Python lately. I don't have a particular axe to grind, nor some

Code is not literature

http://www.gigamonkeys.com/code-reading/ I have started code reading groups at the last two companies I’ve worked at, Etsy and Twitter, and some folks have asked for my advice about code reading and running code reading groups. Tl;dr: don’t start a c