Saturday, May 10, 2025
Alternative Way
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use
No Result
View All Result
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use
No Result
View All Result
Alternative Way
No Result
View All Result

Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app

Gordon James by Gordon James
October 3, 2021
in World Tech Code
0 0
0
Home World Tech Code

It is common for people to want to use the stock Mail.app on Android to be able to switch between their different accounts more quickly. Since iOS users have a lot more choice in the way they receive email, it is not uncommon for people to want to use a different email client for different accounts. Using a Scroll View with a UITableViewCell/UICollectionViewCell

If you are a mail app user, then you need to know about this. It is a simple tweak which brings swipeable UITableViewCell/UICollectionViewCell to the stock Mail.app. It works on iOS 10.1+ and is a must have for your jailbroken iOS devices.

Table of Contents

Toggle
  • SwipeCellKit
  • O
  • Background
  • Demo
    • Transitional styles
      • Restriction
      • Shoot
      • Read
      • To order
    • Extension types
      • No
      • Selection
      • Destroyer
      • To order
  • Requirements
  • Setting
      • CocoaPods (recommended)
      • Carthago
      • Swift Package Manager
  • Documentation
  • Use for UITableView
  • For use with UICollectionView
    • Transitions
      • Transitional delegate
    • Extension
  • Range
  • GitHub

SwipeCellKit

A scrollable UITableViewCell/UICollectionViewCell based on Mail.app stock, implemented in Swift.

Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app

O

UITableViewCell or UICollectionViewCell with :

  • Actions when sliding to the left and right
  • Action buttons with: text only, text + image, image only
  • Haptic feedback
  • Customizable transitions : Bounding, dragging and expanding
  • Configurable Swipe Action Button Behavior
  • Animated extension when the threshold is exceeded
  • Customizable animations for extensions
  • Support for UITableView and UICollectionView
  • Accessibility
  • Dark Mode

Background

Check out my blog post on how SwipeCellKit came to be.

Demo

Transitional styles

The transition style describes how the action buttons are expanded when the mouse is dragged.

Restriction

Shoot

Read

To order

Extension types

The extension style describes the behavior when you drag your finger across a cell that exceeds a certain threshold.

No

Selection

Destroyer

To order

Requirements

  • Swift 5.0
  • Xcode 10.3+ (in English)
  • iOS 9.0 and up

Setting

CocoaPods (recommended)

use_frameworks !

# Latest release in CocoaPods
pod ‘SwipeCellKit’.

# Get the latest version on the development server
pod ‘SwipeCellKit’, :git => ‘https://github.com/SwipeCellKit/SwipeCellKit.git’, :branch => ‘develop’.

# If you have NOT upgraded to Xcode 11, use the latest version of Xcode 10.X compatible with Swift
pod ‘SwipeCellKit’, ‘2.6.0’.

# If you have NOT upgraded to Swift 5.0, use the latest version of Swift 4.2/Xcode 10.2
pod ‘SwipeCellKit’, ‘2.5.4’.

# If you have NOT upgraded to Swift 4.2, please use the latest version that is not compatible with Swift 4.2
pod ‘SwipeCellKit’, ‘2.4.3’.

Carthago

github SwipeCellKit/SwipeCellKit

Swift Package Manager

Dependencies: [
.package(url: https://github.com/SwipeCellKit/SwipeCellKit, from: 2.7.1)
]

Documentation

Read [docs][docsLink]. Generated by jazzy. Posted to the GitHub pages.

Use for UITableView

Set the delegate property for the SwipeTableViewCell:

override func tableView(_ tableView : UITableView, cellForRowAt indexPath : IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier : Cell) as ! SwipeTableViewCell
cell.delegate = self
return cell
}

Accept the SwipeTableViewCellDelegate protocol:

func tableView(_ tableView : UITableView, editActionsForRowAt indexPath : IndexPath, for orientation : SwipeActionsOrientation) -> [SwipeAction] ? {
guard orientation == .right else { return nil }

let deleteAction = SwipeAction(style : .destructive, title : Delete) { action, indexPath in
// process action, update template with delete
}

// Customize the appearance of the action
deleteAction.image = UIImage(named : delete)

return [deleteAction] }

Optionally, you can implement the editActionsOptionsForRowAt method to customize the behavior of the swipe action:

func tableView(_ tableView : UITableView, editActionsOptionsForRowAt indexPath : IndexPath, for orientation : SwipeActionsOrientation) -> SwipeOptions {
var options = SwipeOptions()
options.expansionStyle = .destructive
options.transitionStyle = .border
return options
}

For use with UICollectionView

Set the delegate property for SwipeCollectionViewCell :

override collectionView(_ collectionView : UICollectionView, cellForItemAt indexPath : IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier : Cell, for : indexPath) as ! SwipeCollectionViewCell
cell.delegate = self
return cell
}

Accept the SwipeCollectionViewCellDelegate protocol:

func collectionView(_ collectionView : UICollectionView, editActionsForItemAt indexPath : IndexPath, for orientation : SwipeActionsOrientation) -> [SwipeAction] ? {
guard orientation == .right else { return nil }

let deleteAction = SwipeAction(style : .destructive, title : Delete) { action, indexPath in
// process action, update template with delete
}

// Customize the appearance of the action
deleteAction.image = UIImage(named : delete)

return [deleteAction] }

Optionally, you can implement the editActionsOptionsForItemAt method to customize the behavior of the swipe action:

collectionView(_ collectionView : UICollectionView, editActionsOptionsForItemAt indexPath : IndexPath, for orientation : SwipeActionsOrientation) -> SwipeOptions {
var options = SwipeOptions()
options.expansionStyle = .destructive
options.transitionStyle = .border
return options
}

Transitions

SwipeTransitionStyle offers three built-in transition styles:

  • .border : The visible action area is evenly distributed over all action buttons.
  • … shoot: The visible action area is attached to a cell by drag and drop, and each action button is fully expanded when unfolded.
  • Reveal: The visible action area is behind the cell pushed to the edge of the table view and expands when you drag the cell to the side.

For more information about customizing the appearance of buttons when you drag the screen, see Setting Transitions.

Transitional delegate

The transition of a SwipeAction can be observed by setting SwipeActionTransitioning to the transitionDelegate property. This allows you to see what percentage is visible and access the underlying UIButton for that SwipeAction.

Extension

Four built-in expansion styles are provided by SwipeExpansionStyle:

  • .selection
  • .app (e.g. Mail.app)
  • .destructiveAfterFill (like Mailbox/Tweetbot)
  • .filling

A lot of effort has gone into making SwipeExpansionStyle highly customizable. If these built-in styles don’t meet your needs, see Customizing Extensions for more information on creating your own styles.

The built-in extension style .fill requires manual intervention. This means that at some point during or after the call, your action handler must call SwipeAction.fulfill(style:) to trigger the fill extension. The ExpansionFulfillmentStyle provided allows the cell to be removed or reset later (possibly after a new user interaction).

The built-in .destructive and .destructiveAfterFill extension styles are configured to automatically remove rows when the action handler is called (auto-run). Removing it may require coordination with other string animations (for example, in beginUpdates and endUpdates). In this case, you can just create a custom SwipeExpansionStyle that requires manual execution to trigger the removal:

var options = SwipeTableOptions()
options.expansionStyle = .destructive(automaticallyDelete : false)

OPINION: You must call SwipeAction.fulfill(with style 🙂 at some point during/after the action handler call to trigger the delete. Do not call deleteRows directly.

let delete = SwipeAction(style : .destructive, title : nil) { action, indexPath in
// update template
self.emails.remove(at : indexPath.row)
action.fulfill(with : .delete)
}

Range

For more information on configuration, see the Advanced Features guide.

GitHub

https://github.com/SwipeCellKit/SwipeCellKit

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Share 0
ShareTweet
Gordon James

Gordon James

Next Post
A Swift library that provides a clean and quick API for processing images

A Swift library that provides a clean and quick API for processing images

  • Trending
  • Comments
  • Latest
How To Get Free Internet On Android Without Service

How To Get Free Internet On Android Without Service

March 10, 2022
🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

October 3, 2021

Fix: Notifications not working on Nova Launcher

October 3, 2021
How to Fix OpenVPN Connected but Not Changing IP Address

How to Fix OpenVPN Connected but Not Changing IP Address

October 3, 2021

Setting Up Directory Sync Between On-Premises Active Directory with Microsoft 365 Azure AD

0
🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

0
🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

0
🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

0
What to Know About Car Shipping Services

What to Know About Car Shipping Services

May 7, 2025
CS2 Skins-Why Trade Them?

CS2 Skins-Why Trade Them?

May 7, 2025
Alternative Routes: Successfully Exiting Your Wyndham Timeshare Without The Stress

Alternative Routes: Successfully Exiting Your Wyndham Timeshare Without The Stress

May 6, 2025
The Ultimate Seiko Watch Gift Guide

The Ultimate Seiko Watch Gift Guide

May 1, 2025

There's always an alternative Way!
Find us at 4145 Zolynthian Street, Vylorthos, QP 78425
No Result
View All Result
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use

© 2022 - Alternative Way

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT
No Result
View All Result
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
  • Travel News

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.