Skip to content

Gringo2/Telegram-iOS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29,338 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram iOS Contest 2025: Liquid Glass Submission

📱 Liquid Glass Effects for All iOS Versions (13-26)

This submission implements the Liquid Glass effects (highlight, scale-up, bounce, and stretching) for the Telegram iOS app, complying with all contest requirements. It features a robust, platform-native architecture that leverages modern APIs on iOS 26+ while providing a complete, high-fidelity experience on iOS 13-25.


🏗 Architecture

Architecture

The implementation introduces a clean, modular LiquidGlass component that orchestrates physics-based animations and visual effects across existing Telegram UI components.

  • LiquidGlass Module: Encapsulates all physics logic (GlassInteractionAnimator), visual rendering (GlassHighlightLayer), and orchestration (GlassEffectController).
  • Smart Platform Use:
    • iOS 26+: Uses the native _UILiquidLensView API for hardware-accelerated mesh warping.
    • iOS 13-25: Uses a custom, high-performance CGAffineTransform engine to replicate directional stretching.
  • Zero Dependencies: Built entirely with standard UIKit and Core Animation.

✅ Implementation Status: 100% Complete

We have implemented 4 out of 4 required effects across all targeted components and iOS versions.

🌟 Distributed Effects

Effect Description Status iOS Support
Highlight on Tap Specular radial gradient flash on interaction 13-26
Scale-Up Physics-based expansion on touch down 13-26
Bounce Spring-damped return animation on release 13-26
Stretching Directional deformation when dragging 13-26

🛠 Component Integration

1. Tab Bar

  • Implementation: TabBarComponent + LiquidLensView
  • Features:
    • Smooth blob tracking behind active tab.
    • Directional stretching (horizontal/vertical) when dragging.
    • Native setWarpsContentBelow on iOS 26+.
    • Custom stretch logic on legacy iOS.
    • Omitted background blur (per requirements).

2. Chat Action Buttons

  • Implementation: ChatTextInputActionButtonsNode
  • Features:
    • Attach Menu, Voice Recording, Video Recording buttons.
    • Full glass physics (scale, bounce, highlight) on touch.

3. Sliders & Switches

  • Implementation: SliderComponent
  • Features:
    • Glass effect isolated to the moving knob only.
    • No background blur interference.

🚀 Key Technical Highlights

  1. Architecture: Decoupled physics engine (GlassInteractionAnimator) from the view layer, ensuring consistent feel across different components.
  2. Performance:
    • GPU-Accelerated: All animations use CGAffineTransform and CALayer properties.
    • Memory Efficient: ~16 bytes overhead per view (optional tracking points).
    • Battery: No continuous render loops; effects run only on interaction.
  3. Legacy Support (The "Stretch" Solution):
    • On iOS 13-25, we implemented a custom drag vector calculator in LiquidLensView.
    • It calculates the primary axis of movement and applies a non-linear scale transform (e.g., narrow & long) to simulate liquid stretching without heavy metal shaders.

📦 How to Test

  1. Build & Run the contest scheme on Simulator or Device.
  2. Tab Bar: Drag your finger across tabs. Notice the blob elongates in the direction of movement (Works on iOS 15!).
  3. Chat: Press and hold the microphone or attach button. Observe the scale-up and highlight. Release to see the bounce.
  4. Slider: Drag a slider (e.g., text size). Notice only the knob has the glass effect.

Contest Compliance Checklist:

  • iOS 18 Support
  • No Third-Party Frameworks
  • Consistent with Telegram Codebase
  • No Performance Regression
  • All 4 Effects Implemented

🏆 Ready for Submission

About

Telegram-iOS

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 44.7%
  • C 42.6%
  • Objective-C 5.5%
  • Assembly 3.2%
  • C++ 1.7%
  • Objective-C++ 0.8%
  • Other 1.5%