November 15, 2024

Year: 2019

Swift: How to make a UIAlertController

All apps have to interact with a user at one time or another.  Ever since Swift 3, app developers must use the UIAlertController to accomplish this.  Here's an example of one that I use in my apps:

let title = “Pop-up Message Example”

let message = “This is an example of a pop-up message in Swift.”

let button = "Close"

let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert)

alert.addAction(UIAlertAction(title: button, style: UIAlertAction.Style.default, handler: {(action:UIAlertAction!) in

}))

self.present(alert, animated: true, completion: nil)

}

When I make an UIAlertController, I like to organize it so I can quickly look at a block of code.  This example will show a pop-up window with the title "Pop-up Message Example" and then show a message under it.

For more information about UIAlertController, click here.

Do you have questions?  Please ask them below.

Google luers senior MacOS Engineer away to Assist in Development of Fuchsia OS

“We learned in 2016 that Google was working on an entirely new operating system called Fuchsia. Development continues with new features and testing on a variety of form factors spotted regularly,” Abner Li reports for 9to5Google. “Google has since hired 14-year Apple engineer Bill Stevenson to work on its upcoming OS, and help bring it to market.”

“Stevenson started at Apple in 2004 as a Product Release Engineer for OS X,” Li reports. “In this role, he ‘triaged and diagnosed’ application and framework issues, while also working with third-party developers.”

“Since 2012, Stevenson has been a Senior Manager for Mac/Windows Program Management,” Li reports. “He has had a hand in every major release from Lion right up to Mojave last year; leading teams responsible for build, release, and technical program management.”

Read more in the full article here.

Apple to pay ‘Shot on iPhone’ winners

“Apple caused a bit of a stir in the artistic community this week when it announced a ‘Shot on iPhone Challenge’ that select works from ten iPhone photographers to plaster on marketing materials like billboards, all presumably without pay,” Mikey Campbell reports for AppleInsider. “The company has since updated terms of the contest to note winning artists will indeed be compensated for their work.”

“The original ‘Shot on iPhone Challenge’ announcement, posted to Apple’s dedicated news website was updated on Thursday to reflect the change,” Campbell reports. “Appended to the fine print anchoring the story, Apple says winners will receive licensing fees when their photos are used for marketing purposes. ‘Apple believes strongly that artists should be compensated for their work. Photographers who shoot the final 10 winning photos will receive a licensing fee for use of such photos on billboards and other Apple marketing channels.'”

Read more in the full article here.

You may have Missed:

Verified by MonsterInsights