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

I need tutorial for custom new module #566

Closed
lexuanquynh opened this issue Jul 1, 2021 · 9 comments
Closed

I need tutorial for custom new module #566

lexuanquynh opened this issue Jul 1, 2021 · 9 comments

Comments

@lexuanquynh
Copy link

lexuanquynh commented Jul 1, 2021

I create a my submodule, and I want to add into exist telegram source code.
The forder is:
Telegram-iOS/submodules/QModule
contains:

  • QViewController.xib
  • QViewController.swift
    My script in BUILD file is:
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")

swift_library(
    name = "QModule",
    module_name = "QModule",
    srcs = glob([
	"Sources/**/*.swift",
   	"Sources/**/*.xib",
    ]),    
    visibility = [
        "//visibility:public",
    ],
)

When I run generate with script:

python3 build-system/Make/Make.py \
    --bazel="$HOME/bazel-dist/bazel" \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath="$HOME/telegram-configuration" \
    --disableExtensions \
    --disableProvisioningProfiles

It build success. But I can't find my module. What step am I missed?

@ghost
Copy link

ghost commented Jul 2, 2021

X

@ali-fareed
Copy link

How are you planning to use this module?

@lexuanquynh
Copy link
Author

lexuanquynh commented Jul 2, 2021

@ali-fareed I want to add the UIViewcontroller into the Telegram Tabbar. I try to custom a new viewcontroller. I naively thought that adding was simply creating a directory in submodules, and writing Bazel scripts. It built successfully, but it's not contain in the Xcode project. What step was I missing? Can you help me? give me a keyword, I will research for it.

@ali-fareed
Copy link

I'm afraid it would take a lot of effort to describe the general architecture of the app.

I would recommend reading https://hubo.dev/tags/#Telegram

@lexuanquynh
Copy link
Author

@ali-fareed thank you very much. I think having this source code for research is the best thing a dev has.

@Kylmakalle
Copy link

Kylmakalle commented Jul 4, 2021

.xib

Unfortunately you will not be able to use Storyboards due to AsyncDisplayKit restrictions which is (partially) used in Telegram sources.

I've made some attempts to integrate some basic UIViewControllers and additional tab bar icons in app, but unfortunately whole project is based on custom ViewControllers (mostly based on AsyncDisplayKit stuff) and it requires a lot of work to adapt them (edges, colors, swipes, navigation and etc.)

So I assume it's really better to integrate something based on AsyncDisplayKit

NB: Check this post as well to make sure that you have enough framework modules to create your Views.

@Kylmakalle
Copy link

But I can't find my module.

Try to declare your module as a dependency for other module (eg. submodules/TelegramUI/BUILD) or in main app file (Telegram-iOS/BUILD)

Also, take a look at Nicegram example

@lexuanquynh
Copy link
Author

@Kylmakalle thank you very much. Can you give me your telegram or twitter?

@Kylmakalle
Copy link

Telegram Is the same as on github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants