Houston  Sipes

Houston Sipes

1600912800

Scroll to Different Positions in a ScrollView With ScrollViewReader in SwiftUI 2

In the recent WWDC 2020, Apple introduced ScrollViewReader. This is one of the features that a lot of us have been looking forward to due to the lack of support that was found for scrolling in SwiftUI 1.

As many of us are aware, there wasn’t any built-in support to scroll to a specific row in SwiftUI 1. There’s probably multiple different hacky ways of doing it with a bunch of code written by different people on Stack Overflow, but isn’t it a lot better if it can be done with just a line of code?

With ScrollViewReader, you’ll now be able to scroll to any row with the use of index.

Note: The same behavior doesn’t work for List. Jumping to an element in a List doesn’t seem to be supported at the time of publication.

#swift #ios #programming #mobile #swiftui

What is GEEK

Buddha Community

Scroll to Different Positions in a ScrollView With ScrollViewReader in SwiftUI 2
Houston  Sipes

Houston Sipes

1600912800

Scroll to Different Positions in a ScrollView With ScrollViewReader in SwiftUI 2

In the recent WWDC 2020, Apple introduced ScrollViewReader. This is one of the features that a lot of us have been looking forward to due to the lack of support that was found for scrolling in SwiftUI 1.

As many of us are aware, there wasn’t any built-in support to scroll to a specific row in SwiftUI 1. There’s probably multiple different hacky ways of doing it with a bunch of code written by different people on Stack Overflow, but isn’t it a lot better if it can be done with just a line of code?

With ScrollViewReader, you’ll now be able to scroll to any row with the use of index.

Note: The same behavior doesn’t work for List. Jumping to an element in a List doesn’t seem to be supported at the time of publication.

#swift #ios #programming #mobile #swiftui

SwiftUI 2.0 URL Session Download Task With Document Interaction Controller - Tutorials

In this Video i’m going to show how to download files from website using URL Session Download Task And Previewing the files using UIDocument Interaction Controller Using SwiftUI 2.0 | SwiftUI 2.0 URL Session Download Task | SwiftUI 2.0 Download Task | SwiftUI 2.0 Downloading Files | SwiftUI 2.0 Saving Files Using FileManager | SwiftUI Custom Progress View | SwiftUI Opening Documents Using UIDocument Interaction Controller | Xcode 12 SwiftUI.

Source Code 👇
https://kavsoft.dev/SwiftUI_2.0/Download_Task

Support Us By Patreon : https://www.patreon.com/kavsoft
Support Us By Contributions : https://donorbox.org/kavsoft

Support Us By Visiting the Link Given Below.

⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. It’s gives a great experience and I think you should give it a try too https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=kavsoft&utm_content=description-only

My Xcode Version is 12.4
My macOS Version is 11.2.3 Big Sur

For Any Queries And Any Request For Videos Use The Given Link

https://kavsoft.dev/#contact

For More

https://kavsoft.dev

Instagram

https://www.instagram.com/_kavsoft/

Twitter

https://twitter.com/_Kavsoft

#swiftui #swiftui 2.0 url #swiftui tutorials

Ahebwe  Oscar

Ahebwe Oscar

1624194540

Django security releases issued: 3.2.4, 3.1.12, and 2.2.24 | Weblog | Django

Django security releases issued: 3.2.4, 3.1.12, and 2.2.24

Posted by Carlton Gibson  on Tháng 6 2, 2021

In accordance with our security release policy, the Django team is issuing Django 3.2.4Django 3.1.12, and Django 2.2.24. These release addresses the security issue detailed below. We encourage all users of Django to upgrade as soon as possible.

CVE-2021-33203: Potential directory traversal via admindocs

Staff members could use the admindocs TemplateDetailView view to check the existence of arbitrary files. Additionally, if (and only if) the default admindocs templates have been customized by the developers to also expose the file contents, then not only the existence but also the file contents would have been exposed.

As a mitigation, path sanitation is now applied and only files within the template root directories can be loaded.

This issue has low severity, according to the Django security policy.

Thanks to Rasmus Lerchedahl Petersen and Rasmus Wriedt Larsen from the CodeQL Python team for the report.

CVE-2021-33571: Possible indeterminate SSRF, RFI, and LFI attacks since validators accepted leading zeros in IPv4 addresses

URLValidatorvalidate_ipv4_address(), and validate_ipv46_address() didn’t prohibit leading zeros in octal literals. If you used such values you could suffer from indeterminate SSRF, RFI, and LFI attacks.

validate_ipv4_address() and validate_ipv46_address() validators were not affected on Python 3.9.5+.

This issue has medium severity, according to the Django security policy.

Affected supported versions

  • Django main branch
  • Django 3.2
  • Django 3.1
  • Django 2.2

#django #weblog #django security releases issued: 3.2.4, 3.1.12, and 2.2.24 #3.2.4 #3.1.12 #2.2.24

Seamus  Quitzon

Seamus Quitzon

1596759503

Custom scroll controls in iOS 14 and SwiftUI 2

With the release of SwiftUI 2 and iOS 14, we now have access to a new view called ScrollViewReader that exposes an object called ScrollViewProxy. What this allows us to do is programmatically control where a user is scrolled to in a view — and send users to a specific spot in your long view.

To test this out, I wanted to create a custom scroll control using a slider to determine where the user was in the ScrollView. The user would be able to drag the slider, which controls where the user is.

Fortunately, the new views in SwiftUI 2 allow us to do this.

Image for post

The scroll view controlled by a slider

To get this to work, we first need to create some state that can be our source of truth for the current scroll position. Both scroll position and the slider value use CGFloat.

@State var scrollPosition: CGFloat = 0.0

We will use this to keep the slider and the scroll position in sync.

Next, let’s add the views we need to replicate the example.

VStack {
	    Slider(value: $scrollPosition)
	    ScrollView {
	        ScrollViewReader { scrollProxy in
	            Text(text)
	                .id("text")
	                .padding()
	                .onChange(of: scrollPosition) { newScrollPosition in
	                    scrollProxy.scrollTo("text", anchor: UnitPoint(x: 0, y: newScrollPosition))
	                }
	        }
	    }
	}

Let’s unpack this:

  1. On line 2, pass our scrollPosition binding to our Slider value.
  2. On line 3, add our ScrollView and embed the rest of our content within this.
  3. On line 4, add our ScrollViewReader. This is a new view in SwiftUI 2 (coming in iOS 14) which allows us to programmatically scroll to a particular position within the ScrollView. This allows us to define a callback function with a ScrollViewProxy, which gives us access to the scrollTo method. More on that in a second…
  4. On lines 5 and 6, we’re defining the text view, and then giving it an id. We need this id to be able to identify the view later on when we use scrollTo .
  5. On line 8 we’re using the new onChange method, also introduced in SwiftUI 2. This allows us to listen for changes, and define a callback to be ran everytime this value changes. We’re listening for changes of scrollPosition , as defined on line 2 and is set by our slider, which then gives us access to the new value within the callback. I’ve defined this as newScrollPosition .
  6. On line 9 we actually use the scrollTo method. scrollTo takes two arguments, the first one is the id of the item we want to scroll to. In this case, I’m passing it the id “text”, which is the same id we gave to our text view on line 6. If you have multiple items within your scroll view (for example a list), you can scroll to a particular item using this argument. The second argument is optional, and allows you to scroll to a particular position within the item itself.
  7. This is defined in the type UnitPoint() , which has two values, x and y. Both of these values take a CGFloat , with a number between 0.0 and 1.0 determining how far along we want to scroll to. In this case, we’re going to leave x as 0 because we don’t want to scroll horizontally. We’re then going to set y to the value of newScrollPosition .

So, every time scrollPosition is updated, the onChange callback is called where newScrollPosition contains the new value. scrollTo is then called with this new value, causing the text view scroll position to move. The newScrollPosition will be a value of between 0.0 and 1.0 from the slider, and UnitPoint() also describes where the view is scrolled to relative to the length of the view between 0.0 and 1.0, so they match up perfectly.

#ios #scrollview #swift #swiftui #ios-app-development

Marcel S

Marcel S

1621334524

Magento 2 Push Notification Extension Send Unlimited Browser Notification to Your Customer

Push Notifications Magento 2 Extension is a powerful and reliable extension to send push web notifications to customers directly from your online store. With web push notifications taking over traditional email marketing campaigns, this extension will help you stay ahead of your competition.

Personalization is key for higher conversion rates which works always for a better result. When people get a personal message, they are more likely to act.

In a popular survey manage by Conversant Media, 94% of marketers from diverse industries stated that personalization was extremely important to exceed their goals

When you choose a custom mobile app, it takes a longer time and depends primarily on the development team. With Magento Mobile eCommerce will benefit you with 100 % unique.The eCommerce Magento platform will come with advanced features and functionality, high performance, complete customized with less time to market.

Push Notifications Magento 2 extension

With Magento 2 Push Notifications, increase your revenue by strengthening your customer engagement strategy. Send attractive push notifications with attractive offers to stimulate sales.

  • Trigger recurring purchases of your existing customers.
  • Add logos, images and eye-catching links to get people’s attention.
  • Make decisions based on data based on statistical information.
  • Allow customers to sign up with a single click (no customer information required)
  • Organize a real-time interaction: notifications are sent directly and instantly visible.

Magento Push Notifications can be used to target and stimulate good customers to make purchases. Send eye-catching notifications with advantageous offers to clients to increase your retention and conversion rates.

Send Personalized Updates:

With the Push Notifications Magento 2 extension, you can send highly customized browser notifications to all your followers in just a single click. When designing notifications, you can use dynamic tags for global and customer-specific attributes such as customer first name, email, store name, etc. Such customized notifications will earn more conversions all around.

Send Order-related Updates:

Web push notifications are the best method to keeping your customers informed up-to-date when their order status changes. With the browser notification Magento 2 module, you can send personalized notifications to all your subscribers as soon as their order status is updated.

With these notifications, you can also boost engagement and conversions by redirecting users to intelligently designed order pages.

For instance, order confirmation notifications can send to your customers to a page where they can review orders and view other product recommendations based on their purchase. In the end, it will help you to increase/sell your products without investing in an additional cost!

Recover Abandoned Carts:

Most of the abandoned carts were done due to the customer was not ready to place the order or purchase at the right in time, they will save the cart for later.

In terms of eCommerce, abandoned shopping carts are a real issue for most businesses. Traditionally discarded shopping cart e-mails are the thing of yesterday. Because most of them end up in spam and of those that come in very few are open.

Which way out of here? Push notifications are the best way to combat abandoned carts! By sending personalized browser notifications, you can find the abandoned cart and dramatically increase conversions. With this extension, anything is possible!

Web Push Notification Magento 2 Extension will help you create notifications using dynamic tags for customers’ first and last names and total items in the cart. On top of this, you can add an image to the notification and preset a delay (in minutes) after which the notification should be triggered.

Wrapping Up

There are many other features like Magento 2 Checkout Page Optimization extension package at minimum efforts and time. These extension are more reliable and scalable solution that will help you increase customer engagement in your store. With browser notification trends, now would be the best time to outfit your store with Magento 2 Push Notifications extension.

#magento 2 extension #push notifications #magento 2 marketplace extension #magento 2 multi vendor #magento 2 marketplace module #magento 2 marketplace development