Home Blog Page 3900

Utilizing Xcode Previews in UIKit Growth


When SwiftUI was first launched, one of many nice options that piqued my curiosity was the moment preview operate. This function empowers builders to preview the person interface of any view inside Xcode, solely bypassing the necessity for a simulator.

Previous to Xcode 15, the preview function was unique to the SwiftUI framework. Nonetheless, with the newest launch of Xcode, Apple expanded the utility of this function to UIKit as effectively.

On this tutorial, let’s see how one can make use of this preview function when creating UIKit apps.

Utilizing #Preview to Preview View Controllers

To preview a UIKit view or view controller in Xcode, all you must do is about up a preview code block utilizing the #Preview macro. Right here is an instance:

#Preview {
    let vc = ViewController()
    return vc
}

For individuals who have expertise utilizing the #Preview function in SwiftUI, the syntax needs to be fairly acquainted. When you enter the preview code, Xcode exhibits a further pane, offering a preview of your view controller.

uikit-preview-xcode-view-controller

As you modify the code of ViewController, Xcode ought to show the change immediately. For instance, you’ll be able to attempt to modify the code like under:

class ViewController: UIViewController {

    lazy var helloButton: UIButton = {
        let button = UIButton(configuration: .borderedProminent())

        button.setTitle("Howdy", for: .regular)

        let motion = UIAction { motion in
            print("Howdy")

            let alertController = UIAlertController(title: "Howdy", message: "Howdy World", preferredStyle: .alert)
            let alertAction = UIAlertAction(title: "Okay", type: .default)

            alertController.addAction(alertAction)
            self.current(alertController, animated: true)
        }


        button.addAction(motion, for: .touchUpInside)

        button.translatesAutoresizingMaskIntoConstraints = false

        return button
    }()

    override func viewDidLoad() {
        tremendous.viewDidLoad()

        self.view.addSubview(helloButton)

        helloButton.centerXAnchor.constraint(equalTo: view.centerXAnchor, fixed: 0).isActive = true
        helloButton.centerYAnchor.constraint(equalTo: view.centerYAnchor, fixed: 0).isActive = true

    }

}

The preview pane will present a button that claims “Howdy”. Like in SwiftUI growth, you’ll be able to examine the person interface straight within the preview. Should you press the “Howdy” button, a warning or alert will pop up.

Xcode-uikit-preview-button-action

Previewing View Controllers in Interface Builder

The #Preview macro can be used to preview view controllers designed in Interface Builder (or Storyboard). Assuming you’ve created a view controller, configured with a storyboard ID, you’ll be able to write the next code to preview it in Xcode:

#Preview("LoginView") {
    let vc = UIStoryboard(title: "Principal", bundle: nil).instantiateViewController(withIdentifier: "LoginView") as UIViewController

    return vc
}

You employ the instantiateViewController methodology to instantiate the view controller and preview it in Xcode. Optionally, you can provide the preview a reputation (e.g. LoginView).

swiftui-uikit-preview-storyboard

Abstract

With the discharge of Xcode 15, Apple has expanded the moment preview function, beforehand unique to SwiftUI, to UIKit as effectively. Builders can now preview the person interface of any UIKit view or view controller inside Xcode utilizing the #Preview macro, eliminating the necessity for a simulator. This function additionally extends to view controllers designed in Interface Builder or Storyboard. Going ahead, profit from this preview function to expedite your UIKit growth course of.

AppleCare+: Find out how to lengthen your Apple guarantee

0


Google’s AI software helped us add disasters and corpses to our images

0


Because it seems, a rabbit carrying an AI-generated prime hat was simply the tip of the iceberg.

Google is the newest telephone firm this 12 months to announce AI picture enhancing instruments, following Samsung’s considerably troubling, principally pleasant sketch-to-image function and Apple’s rather more seemingly tame Picture Playground coming this fall. The Pixel 9’s reply is a brand new software referred to as “Reimagine,” and after utilizing it for every week with a couple of of my colleagues, I’m extra satisfied than ever that none of us are prepared for what’s coming.

Reimagine is a logical extension of final 12 months’s Magic Editor instruments, which let you choose and erase components of a scene or change the sky to appear like a sundown. It was nothing stunning. However Reimagine doesn’t simply take it a step additional — it kicks the entire door down. You’ll be able to choose any nonhuman object or portion of a scene and kind in a textual content immediate to generate one thing in that house. The outcomes are sometimes very convincing and even uncanny. The lighting, shadows, and perspective often match the unique picture. You’ll be able to add enjoyable stuff, positive, like wildflowers or rainbows or no matter. However that’s not the issue.

A few my colleagues helped me check the boundaries of Reimagine with their Pixel 9 and 9 Professional overview items, and we acquired it to generate some very disturbing issues. A few of this required some inventive prompting to work across the apparent guardrails; in the event you select your phrases rigorously, you will get it to create a fairly convincing physique underneath a blood-stained sheet.

It took little or no effort to show the unique picture on the left into the one on the proper.

In our week of testing, we added automobile wrecks, smoking bombs in public locations, sheets that seem to cowl bloody corpses, and drug paraphernalia to pictures. That appears unhealthy. As a reminder, this isn’t some piece of specialised software program we went out of our method to make use of — it’s all constructed right into a telephone that my dad might stroll into Verizon and purchase.

After we requested Google for touch upon the difficulty, firm spokesperson Alex Moriconi responded with the next assertion:

Pixel Studio and Magic Editor are useful instruments meant to unlock your creativity with textual content to picture era and superior picture enhancing on Pixel 9 gadgets. We design our Generative AI instruments to respect the intent of person prompts and meaning they might create content material which will offend when instructed by the person to take action. That stated, it’s not something goes. We have now clear insurance policies and Phrases of Service on what sorts of content material we enable and don’t enable, and construct guardrails to stop abuse. At occasions, some prompts can problem these instruments’ guardrails and we stay dedicated to repeatedly enhancing and refining the safeguards now we have in place.

To make certain, our inventive prompting to work round filters is a transparent violation of those insurance policies. It’s additionally a violation of Safeway’s insurance policies to ring up your natural peaches as conventionally grown on the self-checkout, not that I do know anybody who would try this. And somebody with the worst intentions isn’t involved with Google’s phrases and situations, both. What’s most troubling about all of that is the dearth of sturdy instruments to establish this sort of content material on the net. Our potential to make problematic pictures is operating method forward of our potential to establish them.

If you edit a picture with Reimagine, there’s no watermark or every other apparent approach to inform that the picture is AI-generated — there’s only a tag within the metadata. That’s all nicely and good, however normal metadata is definitely stripped from a picture just by taking a screenshot. Moriconi tells us that Google makes use of a extra sturdy tagging system referred to as SynthID for pictures created by Pixel Studio since they’re 100% artificial. However pictures edited with Magic Editor don’t get these tags.

To make certain, tampering with images is nothing new. Individuals have been including bizarre and misleading stuff to pictures for the reason that starting of pictures. However the distinction now could be that it has by no means been this straightforward so as to add this stuff realistically to your images. A 12 months or two in the past, including a convincing automobile crash to a picture would have taken time, experience, an understanding of Photoshop layers, and entry to costly software program. These boundaries are gone; all it now takes is a little bit of textual content, a couple of moments, and a brand new Pixel telephone.

It’s additionally by no means been simpler to flow into deceptive images rapidly. The instruments to convincingly manipulate your images exist proper inside the identical gadget you utilize to seize it and publish it for all of the world to see. We uploaded one among our “Reimagined” pictures to an Instagram story as a check (and rapidly took it down). Meta didn’t tag it mechanically as AI-generated, and I’m positive no person would have been the wiser in the event that they’d seen it.

Who is aware of, perhaps everybody will learn and abide by Google’s AI insurance policies and use Reimagine to place wildflowers and rainbows of their images. That will be beautiful! However simply in case they don’t, it is likely to be finest to use slightly further skepticism to images you see on-line.

Most Tech Leaders Fear About SaaS Safety Threats


Software program-as-a-Service functions have lengthy been targets of cyberthreats. A brand new research finds that these threats stay high of thoughts for 78% of U.S. know-how leaders as extra SaaS apps discover their approach into the enterprise.

Though enterprises have been prioritizing knowledge privateness and safety, their continued reliance on SaaS and cloud choices means they continue to be in danger, in response to the The SaaS Disruption Report: Safety & Information by Onymos and Enterprise Technique Group.

Shiva Nathan, founder and CEO of Onymos, informed TechRepublic {that a} important threat to this reliance is that when firms buy a SaaS system to expedite utility improvement, they need to grant knowledge entry to the third-party SaaS supplier in return.

Granting this entry might result in cyberattacks and unintended knowledge leakage. This may very well be notably problematic in the present day, as the typical enterprise depends on over 130 SaaS functions in contrast with simply 80 in 2020, Nathan defined.

“That’s a 62% enhance,’’ he stated. “Every of these [SaaS apps] is a brand new assault floor for state and non-state unhealthy actors to use. And they’re exploiting it. The variety of software program provide chain assaults is rising, particularly towards the healthcare business, which needed to pivot to a digital care mannequin throughout COVID-19.”

Well being care entities have lengthy relied on third-party distributors to make that transition occur, Nathan added. In line with the report, different sectors that rely closely on SaaS functions embrace:

  • Authorities.
  • Logistics and provide chain.
  • Manufacturing.
  • Retail.
  • Banking and monetary companies.
  • Training.

Gartner predicted that 45% of organizations globally could have skilled assaults on their software program provide chains by 2025. The report reinforces this projection, with practically half (45%) of tech leaders reporting that they skilled a cybersecurity incident by way of a third-party SaaS utility up to now yr.

The significance of information retention

The survey — which drew insights from 300 app improvement, IT, and safety leaders — additionally revealed that 91% of survey respondents emphasised the important significance of information retention for custom-built inner functions, reflecting its prominence of their utility improvement priorities.

Nathan stated this statistic was shocking to him as a result of these “know-how leaders acknowledge how essential it’s to retain their knowledge however they’re nonetheless so reliant on SaaS. There may be clearly stress inside these organizations between speed-to-production and knowledge possession,’’ he famous. “That stress has at all times existed, however it’s ratcheting up.”

IT leaders’ priorities

Practically three-quarters (72%) of surveyed leaders highlighted “safety” as a high precedence, adopted carefully by 65% who cited “knowledge privateness.”

These priorities are additionally mirrored in mission assignments, tasks, and duties in organizations’ utility and software program improvement initiatives, the report stated. Three of the highest 5 priorities had been:

  • Making certain knowledge privateness (60% reported it was excessive or highest precedence).
  • Constructing safe functions (49% reported it was excessive or highest precedence).
  • Sustaining full management over knowledge possession (42% reported it was excessive or highest precedence).

The survey additionally revealed that 65% of internally developed functions are business-critical, and solely 36% of tech leaders run all of their functions on-premise or on personal clouds.

SaaS apps require larger consideration to your safety posture

With considerations about knowledge safety at such excessive ranges, organizations must reassess their present enterprise mannequin for leveraging SaaS and cloud choices, the Onymos/ESG report stated.

“At present, it’s quite common to listen to know-how leaders discuss their ‘safety posture‘ — having a ‘knowledge posture’ is simply as vital,’’ Nathan pressured. “This contains asking what knowledge you might be sharing together with your SaaS distributors to obtain their service; do they actually need that knowledge; what are they doing with it; and the place is it going.

“The rise of AI services and products solely makes answering these questions extra vital,’’ he stated.

The report made some suggestions, together with a big change to the present SaaS and cloud frequent practices by adopting “no-data” structure ideas, which prioritize knowledge privateness and safety.

“Such a structure permits enterprises to retain full possession and management over their knowledge, eliminating the necessity for sharing or granting entry to third-party SaaS and cloud distributors and decreasing the related threat,’’ the report stated. “Enterprises must also be allowed to personal and modify the code related to the SaaS options they use for his or her utility and software program improvement.”

This permits enterprise engineering groups to confirm and check the code as in the event that they created it themselves, the Onymos/ESG report stated. “With this strategy, organizations can have full confidence within the code’s validity, reliability, and safety,” the report maintained.

Moreover, IT ought to prioritize and commonly conduct rigorous third-party safety audits and penetration checks. “This testing ought to embrace understanding how the group’s knowledge flows by way of completely different functions and SaaS options in order that unintended knowledge entry and sharing points may be mitigated,’’ the report acknowledged.

Telefónica Tech: An Energetic Metadata Pioneer

0


Launching an Inner Knowledge Market with Atlan

The Energetic Metadata Pioneers sequence options Atlan clients who’ve not too long ago accomplished a radical analysis of the Energetic Metadata Administration market. Paying ahead what you’ve discovered to the subsequent information chief is the true spirit of the Atlan group! So, they’re right here to share their hard-earned perspective on an evolving market, what makes up their trendy information stack, revolutionary use instances for metadata, and extra.

On this installment of the sequence, we meet Cristina Perez Martinez, Knowledge Engineer and Architect, and Ezequiel Barbero, Market & Enterprise Intelligence Supervisor at Telefónica Tech, who share how a contemporary information cataloging expertise and column-level lineage will assist a broad imaginative and prescient for information democratization.

This interview has been edited for brevity and readability.


Might you inform us a bit about your self, your background, and what drew you to Knowledge & Analytics?

Ezequiel Barbero:

I’ve obtained a Masters in Huge Knowledge and have labored in Knowledge & Analytics since 2002. I began at Telefónica in Argentina with the BI Knowledge Staff engaged on ETLs based mostly in SQL. Then I labored in Knowledge Engineering serving to with Knowledge Science, working with the top of that staff in Argentina.

In 2019, I got here to Spain to work with their Knowledge Science staff on Advertising Intelligence, and in 2021 I joined Telefónica Tech to start out the BI Staff.

Cristina Perez Martinez:

I began working at Telefónica in 2019 as a Python developer, and I moved to Telefónica Tech in 2021. My staff has primarily been working as Knowledge Engineers and Knowledge Architects for the BI staff.

Would you thoughts describing Telefónica, and the way your information staff helps the group?

Cristina:

Telefónica is split into fairly a couple of totally different corporations, however as an entire, it’s a Telecommunications Enterprise. Right here, in Telefónica Tech, the digital enterprise unit, we’ve been targeted on digital applied sciences similar to AI & BD, connectivity and IoT, Cybersecurity, Cloud, and Blockchain.

Our staff is split into two, with a part of the staff targeted on structure and engineering, getting uncooked information, then standardizing and remodeling it till it goes into Snowflake, our Knowledge Warehouse. The remainder of the staff is concentrated on Knowledge Evaluation, based mostly in Snowflake and coding in SQL. From there, they develop dashboards in PowerBI.

Ezequiel:

Telefónica Tech has a staff engaged on IoT and Huge Knowledge for exterior use instances, however our staff is chargeable for inner use instances, supporting the corporate. We assist infrastructure, transformation, and for nearly a 12 months now, Knowledge Governance.

What does your information stack appear like?

Ezequiel:

Our stack relies on Microsoft Azure, and we use Knowledge Manufacturing unit for Orchestration. We use Databricks’ ETL instrument, blob storage, and information lake. Snowflake is Telefónica’s information warehouse.

Why seek for an Energetic Metadata Administration resolution? What was lacking?

Ezequiel:

Our firm has over 6,200 folks, however our staff is small relative to your complete group. So if it’s essential to enhance information democratization, then that wouldn’t be attainable with out self-service, and with out Knowledge Governance.

Why was Atlan a superb match? Did something stand out throughout your analysis course of?

Ezequiel:

We have been first searching for a cloud-based SaaS resolution that was straightforward to deploy and straightforward to arrange.

Cristina:

Our purpose was to have a spot the place we may create a catalog of information that was accessible sufficient to the remainder of the corporate. It was additionally essential to know the lineage between Snowflake and PowerBI. Our main purpose was to know the influence that modifying a supply would have on our information warehouse, so column-level lineage ensures end-to-end visibility and traceability. Moreover, we acknowledge the necessity for a sturdy instrument to strengthen safety of our information platform, permitting us to assign roles and permissions to make sure that solely approved folks have entry to particular data, in addition to the flexibility to carry out audits which is important to take care of the integrity and compliance of our information operations.

What do you propose on creating with Atlan? Do you have got an thought of what use instances you’ll construct, and the worth you’ll drive?

Cristina:

One of many necessities we had is to create considerably of a market for our information, with the whole lot based mostly on Atlan belongings, and we’re engaged on launching that to start with of this 12 months. From there, we’re wanting ahead to populating much more metadata in Atlan and Snowflake.

Sooner or later, we’re enthusiastic about the potential of utilizing Atlan AI. Our purpose is to make accessing information even simpler for folks, and with the ability to chat with Atlan about information would make it straightforward for folks to seek out what they want.

Photograph by Mario Caruso on Unsplash