Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS UI Competition 2023 #1185

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Telegram/Telegram-iOS/Application.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
import UIKit
import Foundation
import UIKit
import Display
import AsyncDisplayKit
import TelegramCore
import SwiftSignalKit
import TelegramPresentationData
import ItemListUI
import PresentationDataUtils
import AccountContext
import AlertUI
import AppBundle
import LocalizedPeerData
import ContextUI
import TelegramBaseController

@objc(Application) class Application: UIApplication {
override func sendEvent(_ event: UIEvent) {
super.sendEvent(event)
if let str = viewType(of: event) {
// print(str)
}
}
}

private func viewType(of event: UIEvent) -> Any? {
var result = "\n" + "COMPONENT" + "\n"
var superview = event.allTouches?.compactMap{ $0.view }.first
for i in 1...5 {
guard let s = superview?.superview else {
return result
}
superview = s
let space = String(repeating: "==", count: i)
let coder = String(describing: s)
let nodeCoder = findNodeText(coder)
result = (result) + (space + (nodeCoder ?? "") + "\(s.frame)" + "\n")
}
return result
}

private func findNodeText(_ str: String) -> String? {
let range = NSRange(location: 0, length: str.count)
let regex1 = try? NSRegularExpression(pattern: "node[A-Za-z0-9=<>;:. ]*>")
let regex2 = try? NSRegularExpression(pattern: "<[A-Za-z0-9=<>;:. ]*:")

if let match = regex1?.firstMatch(in: str, range: range),
let r = Range(match.range, in: str) {
return String(String(str[r]).dropFirst(7))
}
if let match = regex2?.firstMatch(in: str, range: range),
let r = Range(match.range, in: str) {
return String(String(str[r]).dropFirst(7))
}
return nil
}
10 changes: 5 additions & 5 deletions build-system/template_minimal_development_configuration.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"bundle_id": "org.{! a random string !}.Telegram",
"api_id": "{! get one at https://my.telegram.org/apps !}",
"api_hash": "{! get one at https://my.telegram.org/apps !}",
"team_id": "{! check README.md !}",
"bundle_id": "org.432518f24f7720b2.Telegram",
"api_id": "24525369",
"api_hash": "6c5b2ca5da835082751a7ca923e4fc0e",
"team_id": "39N6P9RQWL",
"app_center_id": "0",
"is_internal_build": "true",
"is_appstore_build": "false",
Expand All @@ -11,4 +11,4 @@
"premium_iap_product_id": "",
"enable_siri": false,
"enable_icloud": false
}
}
5 changes: 3 additions & 2 deletions submodules/ChatListUI/Sources/ChatListControllerNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2423,6 +2423,7 @@ final class ChatListControllerNode: ASDisplayNode, UIGestureRecognizerDelegate {
guard let containerLayout = self.containerLayout else {
return
}

self.updateNavigationScrolling(navigationHeight: containerLayout.navigationBarHeight, transition: self.tempNavigationScrollingTransition ?? .immediate)

if listView.isDragging {
Expand Down Expand Up @@ -2488,9 +2489,9 @@ final class ChatListControllerNode: ASDisplayNode, UIGestureRecognizerDelegate {
self.allowOverscrollItemExpansion = false

if isPrimary {
self.mainContainerNode.currentItemNode.revealScrollHiddenItem()
// self.mainContainerNode.currentItemNode.revealScrollHiddenItem()
} else {
self.inlineStackContainerNode?.currentItemNode.revealScrollHiddenItem()
// self.inlineStackContainerNode?.currentItemNode.revealScrollHiddenItem()
}
}
}
Expand Down
Loading