Building Telegram (Swift)
Sergey
Installing Dependences
Xcode 9.0+ (xcode commandline tools and etc.)
git https://git-scm.com/download/mac
brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
ffmpeg (+dependences) https://github.com/kewlbear/FFmpeg-iOS-build-script
Cloning Repo
Somehow, you need to clone repo recursively, without loosing submodules.
Command 1: git clone https://github.com/peter-iakovlev/Telegram-iOS.git --recursive
Submodules with url = git@github.com:peter-iakovlev/... threw me an error fatal: transport 'git+https' not allowed , so i tried
Command 2: git clone git://github.com/peter-iakovlev/Telegram-iOS.git --recursive
threw me an error fatal: unable to find remote helper for 'git+https'
Solution (for me):
- Fork repo to your account
- Change .gitmodules file to this one (NOTE: it's already got outdated commit hashes) (simply rewritten git:// scheme to https:// scheme, added full paths to peter-iakovlev dependences)
- Clone your repo
git clone --recursive https://github.com/USERNAME/Telegram-iOS.git
Xcode
- Finally, open
Telegram-iOS.xcworkspace - Choose Telegram-iOS-Fork and Device/Simulator at top left corner (instead of AsyncDisplayKit)
- Choose Telegram-iOS project at Project Navigator
- Configure Signing: tick "Automatically manage signing" and confirm. Then setup your Personal Team certificate or Developer Account (if you paid for it), you can google about this. Remember to choose "Team" in Signing dropdown.
- Probably, you should change API_ID and API_HASH. But it works fine with default values. You can find them in Build Settings tab at GLOBAL_CONSTANTS section. If you want to handle
tg://links, or even handle custommy_super_tg://links, editAPP_SPECIFIC_URL_SCHEMEparameter, which defaults totg_fork:// - UPD: Version 5.5 got new style of Build environment (file is encrypted somehow), but there's no example. Probably, you should use this type of config.


- Build and Run, this would take a while and a huge amount of warnings (not errors!) :)

[!] First app start in fresh simulator (not including simulator load with apple logo) is a bit slow (around 30 seconds), log says that Postbox module initialisation consuming most of the time (~25 seconds). Next starts should be faster, but Postbox still initialising for about 5-10 seconds.
By the way, check out Nicegram - it's modification of Telegram-iOS with public source code!