Convert Figma logo to code with AI

Yalantis logoPull-to-Refresh.Rentals-iOS

This project aims to provide a simple and customizable pull to refresh implementation. Made in Yalantis

2,137
263
2,137
8

Top Related Projects

BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting

:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion

:octocat: ExpandingCollection is an animated material design UI card peek/pop controller. iOS library made by @Ramotion

:octocat: ⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion

Quick Overview

Pull-to-Refresh.Rentals-iOS is a custom pull-to-refresh control for iOS applications, specifically designed with a rental or real estate theme. It features an animated house icon that transforms as the user pulls down to refresh, providing a visually appealing and engaging user experience.

Pros

  • Unique and visually appealing animation that enhances user engagement
  • Customizable to fit different app themes and styles
  • Easy to integrate into existing iOS projects
  • Smooth and responsive performance

Cons

  • Specific to rental/real estate theme, which may limit its use in other types of apps
  • Requires custom implementation, which may be more complex than using standard UIRefreshControl
  • May not be actively maintained (last update was several years ago)
  • Limited documentation and examples available

Code Examples

  1. Initializing the custom refresh control:
let refreshControl = RentalsPullToRefresh(frame: view.bounds)
scrollView.addSubview(refreshControl)
  1. Setting up the refresh action:
refreshControl.pullToRefreshHandler = { [weak self] in
    // Perform refresh action here
    DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
        self?.refreshControl.endRefreshing()
    }
}
  1. Customizing the control's appearance:
refreshControl.tintColor = .blue
refreshControl.pullDistance = 100
refreshControl.scaleIconTo = 0.7

Getting Started

To use Pull-to-Refresh.Rentals-iOS in your project:

  1. Add the library to your project (e.g., using CocoaPods or manually)
  2. Import the module in your view controller:
    import PullToRefreshRentals
    
  3. Initialize and add the refresh control to your scroll view:
    let refreshControl = RentalsPullToRefresh(frame: view.bounds)
    scrollView.addSubview(refreshControl)
    
  4. Set up the refresh action:
    refreshControl.pullToRefreshHandler = {
        // Perform refresh action here
        // Call refreshControl.endRefreshing() when done
    }
    

Competitor Comparisons

BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.

Pros of BFKit-Swift

  • Comprehensive utility library with a wide range of functions and extensions
  • Regularly updated and maintained, with active community support
  • Supports multiple platforms (iOS, macOS, watchOS, tvOS)

Cons of BFKit-Swift

  • Larger codebase and potential overhead for projects that only need specific features
  • May require more time to learn and integrate due to its extensive functionality
  • Less focused on specific UI components compared to Pull-to-Refresh.Rentals-iOS

Code Comparison

Pull-to-Refresh.Rentals-iOS (Custom pull-to-refresh animation):

let refreshView = CustomRefreshView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
tableView.addSubview(refreshView)
refreshView.animationView.play()

BFKit-Swift (String extension example):

let string = "Hello, World!"
let reversed = string.reversed()
let capitalized = string.capitalized()

While Pull-to-Refresh.Rentals-iOS focuses on a specific UI component with custom animations, BFKit-Swift provides a broader set of utilities and extensions for various Swift development needs. The choice between the two depends on the project requirements and the specific functionality needed.

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting

Pros of SkeletonView

  • More versatile, providing skeleton loading animations for various UI elements
  • Actively maintained with regular updates and bug fixes
  • Extensive documentation and examples for easy implementation

Cons of SkeletonView

  • Larger codebase and potentially higher complexity
  • May require more setup and configuration for specific use cases

Code Comparison

SkeletonView:

import SkeletonView

override func viewDidLoad() {
    super.viewDidLoad()
    view.isSkeletonable = true
    view.showAnimatedGradientSkeleton()
}

Pull-to-Refresh.Rentals-iOS:

import PullToRefresh

override func viewDidLoad() {
    super.viewDidLoad()
    tableView.addPullToRefresh(PullToRefresh()) { [weak self] in
        self?.refreshData()
    }
}

SkeletonView offers a more comprehensive solution for creating loading animations across various UI elements, while Pull-to-Refresh.Rentals-iOS focuses specifically on pull-to-refresh functionality. SkeletonView is actively maintained and has extensive documentation, but it may require more setup and have a larger codebase. Pull-to-Refresh.Rentals-iOS is simpler to implement for its specific use case but has limited functionality compared to SkeletonView.

:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

Pros of animated-tab-bar

  • More versatile, offering customizable animations for tab bar items
  • Actively maintained with recent updates and Swift support
  • Extensive documentation and usage examples

Cons of animated-tab-bar

  • Focused solely on tab bar animations, less versatile than Pull-to-Refresh.Rentals-iOS
  • May require more setup and configuration for basic use cases
  • Potentially higher performance overhead due to animations

Code Comparison

Pull-to-Refresh.Rentals-iOS:

let refreshControl = RentalsPullToRefresh(frame: frame)
scrollView.addSubview(refreshControl)
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)

animated-tab-bar:

let tabBarController = RAMAnimatedTabBarController()
let item1 = RAMAnimatedTabBarItem(title: "Home", image: UIImage(named: "home"), tag: 1)
item1.animation = RAMBounceAnimation()
tabBarController.viewControllers = [vc1, vc2, vc3]

Both repositories offer unique UI enhancements for iOS applications. Pull-to-Refresh.Rentals-iOS provides a specialized pull-to-refresh animation, while animated-tab-bar focuses on customizable tab bar animations. The choice between the two depends on the specific UI requirements of your project. animated-tab-bar is more actively maintained and offers more customization options, but it's limited to tab bar functionality. Pull-to-Refresh.Rentals-iOS, while less recently updated, provides a unique and visually appealing pull-to-refresh implementation that can enhance the user experience in specific scenarios.

:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion

Pros of folding-cell

  • More versatile UI component, applicable to various scenarios beyond pull-to-refresh
  • Offers a unique and visually appealing folding animation effect
  • Provides more customization options for cell content and appearance

Cons of folding-cell

  • More complex implementation compared to the simpler pull-to-refresh mechanism
  • May require more processing power, potentially impacting performance on older devices
  • Less intuitive for users who are accustomed to standard pull-to-refresh interactions

Code Comparison

folding-cell:

let cell = FoldingCell()
cell.itemCount = 4
cell.backgroundColor = .clear

cell.foregroundView.backgroundColor = .white
cell.foregroundView.layer.cornerRadius = 10
cell.foregroundView.layer.masksToBounds = true

Pull-to-Refresh.Rentals-iOS:

let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
tableView.addSubview(refreshControl)

@objc func refresh() {
    // Refresh logic here
    refreshControl.endRefreshing()
}

The code snippets demonstrate the difference in implementation complexity. folding-cell requires more setup and customization, while Pull-to-Refresh.Rentals-iOS uses a simpler, more standard approach to adding refresh functionality to a table view.

:octocat: ExpandingCollection is an animated material design UI card peek/pop controller. iOS library made by @Ramotion

Pros of expanding-collection

  • More visually appealing and interactive UI with expanding cards
  • Supports both portrait and landscape orientations
  • Customizable animation parameters for a tailored user experience

Cons of expanding-collection

  • More complex implementation compared to Pull-to-Refresh.Rentals-iOS
  • Potentially higher performance overhead due to animations
  • Less focused on a specific functionality (pull-to-refresh)

Code Comparison

expanding-collection:

let viewController = ExpandingViewController(style: .fill)
viewController.itemSize = CGSize(width: 256, height: 335)
viewController.collectionView?.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)

Pull-to-Refresh.Rentals-iOS:

let refreshView = PullToRefreshView()
refreshView.delegate = self
tableView.addSubview(refreshView)

The code snippets demonstrate the different focus of each library. expanding-collection emphasizes customizing the expanding card view, while Pull-to-Refresh.Rentals-iOS focuses on implementing a pull-to-refresh functionality.

expanding-collection offers more visual customization options but requires more setup code. Pull-to-Refresh.Rentals-iOS provides a simpler implementation for its specific use case.

Both libraries enhance the user experience in iOS apps, but they serve different purposes. expanding-collection is ideal for creating visually rich, interactive card-based interfaces, while Pull-to-Refresh.Rentals-iOS excels at providing a smooth, customizable pull-to-refresh experience.

:octocat: ⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion

Pros of circle-menu

  • More versatile UI component, suitable for various app types
  • Animated circular menu provides a unique and engaging user experience
  • Customizable appearance with options for icons, colors, and animations

Cons of circle-menu

  • May not be as intuitive for users as a standard pull-to-refresh mechanism
  • Potentially less suitable for apps that require frequent content refreshing
  • More complex implementation compared to a simple pull-to-refresh control

Code Comparison

Pull-to-Refresh.Rentals-iOS:

func animateRefreshView() {
    refreshView?.animating = true
    carLayer?.animating = true
}

circle-menu:

open func buttonsCount() -> Int {
    return buttons.count
}

open func menuButtonSize() -> CGSize {
    return CGSize(width: 50, height: 50)
}

The Pull-to-Refresh.Rentals-iOS code focuses on animating the refresh view, while circle-menu's code deals with managing the circular menu's buttons and their sizes. circle-menu's implementation is more complex due to its nature as a customizable UI component.

Both libraries offer unique UI experiences, with Pull-to-Refresh.Rentals-iOS providing a specialized refresh animation and circle-menu offering a versatile circular menu system. The choice between them depends on the specific needs of the app and the desired user interaction style.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Pull-to-Refresh.Rentals-IOS

This project aims to provide a simple and customizable pull to refresh implementation.

Yalantis

Check this [project on Dribbble] (https://dribbble.com/shots/1650317-Pull-to-Refresh-Rentals)
Check this [project on Behance] (https://www.behance.net/gallery/20411445/Mobile-Animations-Interactions)

alt text

#Installing with CocoaPods

pod 'Pull-to-Refresh.Rentals-IOS', '~> 1.0'

#Usage

For a working implementation, Have a look at the Sample Project - sample

  1. Add folder YALSunnyRefreshControll to your project.
  2. Implement header and setup YALSunnyRefreshControl as a property.
  3. Init and associate YALSunnyRefreshControl with your UITableView or UICollectionView.
  4. Add images from Images.xcassets folder in Sample Project.
#import "YALSunnyRefreshControl.h"

@property (nonatomic,strong) YALSunnyRefreshControl *sunnyRefreshControl;

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupRefreshControl];
}

- (void)setupRefreshControl{
    self.sunnyRefreshControl = [YALSunnyRefreshControl new];
    [self.sunnyRefreshControl addTarget:self
                                 action:@selector(sunnyControlDidStartAnimation)
                       forControlEvents:UIControlEventValueChanged];
    [self.sunnyRefreshControl attachToScrollView:self.tableView];
}

- (void)sunnyControlDidStartAnimation{
    // start loading something
}

- (IBAction)endAnimationHandle{
    [self.sunnyRefreshControl endRefreshing];
}

#Customization

To customize drawables you can change:

  • sun.png - Sun image
  • sky.png - background image
  • buildings.png - foreground image

#Compatibility

  • IOS 7-9

Changelog

Version: 1.0

  • Initial Build

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email to github@yalantis.com And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

License

Copyright 2017, Yalantis

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.