Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Added SPM support#1928

Closed
3a4oT wants to merge 23 commits intoTextureGroup:master from
3a4oT:spm
Closed

Added SPM support #1928
3a4oT wants to merge 23 commits intoTextureGroup:master from
3a4oT:spm

Conversation

@3a4oT
Copy link

@3a4oT 3a4oT commented Oct 6, 2020
edited
Loading

  • implemented SPM layout generator swift scripts/generate_spm_sources_layout.swift which use symlinks technics.

  • introduced the AsyncDisplayKitIGListKit library which is an umbrella for IG+Texture. To deal with SPM restrictions I did some kind of hack:)) I've symlinked the spm/Sources/AsyncDisplayKit (generated by a script) and created the AsyncDisplayKitIGListKit folder. It should be available ONLY for Package.swift. (TODO: upstream changes to Instagram)

  • refactored #include by dropping AsyncDisplayKit/

  • added a small tweak to be able to assemble for macCatalyst via SPM

  • Xcode 12 required (SPM only)

  • added sh build.sh build_listkit_xcode_spm_integration to the build pipeline which can verify Xcode's SPM integration.

  • added CI steps to check SPM based BUILDS for iOS, tvOS, macCatalyst.

depends on pinterest/PINRemoteImage#586

  • experiment with IGListKit support and try to upstream changes to SPM number10 Instagram/IGListKit#1487
  • Update PINRemoteImage dependency and point it to official repository instead of fork
  • Figure out how to add the possibility for testing this integration.

denkeni, ay8s, ArtyomVasilyev, xezero, devxoul, ajanuar, MussaCharles, nickaroot, shimastripe, rogerluan, and 3 more reacted with thumbs up emoji
Copy link

CLAassistant commented Oct 6, 2020
edited
Loading

CLA assistant check
All committers have signed the CLA.

_flags.canClearContentsOfLayer = NO;
}
#endif
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable macCatalyst? :)

@3a4oT 3a4oT marked this pull request as draft October 7, 2020 14:50
Copy link
Author

3a4oT commented Oct 7, 2020

Still need to figure out how to test it

#define AS_PIN_REMOTE_IMAGE 1
#endif

#ifndef AS_IG_LIST_KIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intended? My project doesn't use IGListKit but does use ASPINRemoteImageDownloader which requires AS_PIN_REMOTE_IMAGE to be set.

Copy link
Contributor

@xezero xezero Oct 13, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I can't seem to be able to reference ASPINRemoteImageDownloader for some reason. I had to comment out the #if AS_PIN_REMOTE_IMAGE conditionals entirely in order for my project to even see the class. Not sure if it's an SPM package configuration issue or something else.

PatrikTheDev reacted with rocket emoji
Copy link

any updates on this PR?

Copy link
Author

3a4oT commented Nov 17, 2020

last commits should repair Xcode's SPM integration!

Copy link

Confirming, it compiles and works fine in my project. Let's get merge it.

Copy link

NoliNik commented Nov 18, 2020

Great job guys! Working for me!

Copy link
Contributor

xezero commented Nov 21, 2020

For some reason I still can't access ASPINRemoteImageDownloader despite AS_PIN_REMOTE_IMAGE being defined in Package.swift. Is there something I'm missing?

Copy link
Contributor

MussaCharles commented Nov 23, 2020
edited
Loading

Hi, @3a4oT I tried using AsyncDisplayKitIGListKit from your fork on Xcode 12.2.
Unfortunately I am getting the following errors

  1. on IGListKitUpdatingDelegate.h file: -

IGListUpdatingDelegate' has different definitions in different modules; first difference is definition in module 'IGListKit' found method 'performUpdateWithCollectionViewBlock:fromObjects:toObjectsBlock:animated:objectTransitionBlock:completion:' with 1st parameter of type 'IGListCollectionViewBlock _Nonnull __strong' (aka 'UICollectionView * _Nullable (^__strong)(void)')

Screen Shot 2020年11月23日 at 12 24 54 PM

  1. Also similar error on IGListAdapter.h file
    Screen Shot 2020年11月23日 at 12 47 07 PM

based on the error messages it seems like there is a namespace conflicts (I searched related issues, where the work around is renaming one of the module classname/function etc.. and this issue happens in Xcode 12, even though things worked well on Xcode 11.
Are you also using Xcode 12.2 on your current working version?

Copy link
Author

3a4oT commented Dec 2, 2020

@MussaCharles thanks for the detailed feedback. Should be OK now. I've added the sample project (examples/ASIGListKitSPM/) which should verify that it won't break again. Would you mind giving it another shot?

@xezero PINRemoteImage should be available now :) so you can access ASPINRemoteImageDownloader.

xezero, MussaCharles, and GeekTree0101 reacted with hooray emoji

Copy link
Contributor

xezero commented Dec 2, 2020

@3a4oT Wow, great work on figuring those headers out! Looks intense 😅

Copy link
Contributor

@MussaCharles thanks for the detailed feedback. Should be OK now. I've added the sample project (examples/ASIGListKitSPM/) which should verify that it won't break again. Would you mind giving it another shot?

@xezero PINRemoteImage should be available now :) so you can access ASPINRemoteImageDownloader.

@3a4oT Thanks for the updates, I will give it another shot later today or tomorrow and get back to you.

Copy link

iosg1sw commented Dec 11, 2020

Hi everyone! Is there any updates? I noticed that only Carthage build is not successful. This may be caused by that issue. Please check it out!

Copy link
Author

3a4oT commented Dec 13, 2020

@MussaCharles Today I've integrated into another codebase which was using Carthage. I faced the same errors as you reported, to resolve issues make sure you delete any cached pods or Carthage artifacts (.framework) from your project. settings.

Copy link
Contributor

@MussaCharles Today I've integrated into another codebase which was using Carthage. I faced the same errors as you reported, to resolve issues make sure you delete any cached pods or Carthage artifacts (.framework) from your project. settings.

Hi, @3a4oT Okay, I will double check to see if it was caused by the same files.
Also Sorry for the late. I was a bit occupied with work so I didn't get some time to test your last changes. I will have a look again soon and get back to you.
Happy Coding!!

Copy link

Just wondering what the status is on this currently. I've had to do quite a few of these integrations, would be more than happy to jump in.

@3a4oT 3a4oT marked this pull request as ready for review March 11, 2021 12:09
Copy link
Member

Thank you for putting in all this work!

I would like to avoid using a fork if possible on IGListKit... And since SPM currently doesn’t support running scripts there’s probably no way to add the spm directory to .gitignore is there? I wonder if we could use https://github.com/apple/swift-evolution/blob/main/proposals/0303-swiftpm-extensible-build-tools.md ?

@@ -1,2 +1,2 @@
github "pinterest/PINRemoteImage" "3.0.0-beta.14"
github "pinterest/PINCache" "3.0.1-beta.7"
github "pinterest/PINRemoteImage" "3.0.1"
Copy link

@stareque-atlassian stareque-atlassian Mar 16, 2021
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PINRemoteImage needs to be updated to point to master (or atleast wait for next release), to include PINRemoteImage bugfixes related to SPM. And this should also transitively updated PINCache and PINOperation

Copy link
Contributor

rogerluan commented Jun 10, 2021
edited
Loading

Any update to this? 🙏

Copy link

grangej commented Jun 16, 2021

Updates please?!


let sharedDefines: [CSetting] = [
// Disable "old" textnode by default for SPM
.define("AS_ENABLE_TEXTNODE", to: "0"),
Copy link

@benniebotha benniebotha Aug 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this disabled?
It seems to be enabled in ASAvailability.h does this not cause a mismatch between the Project version and the SPM version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for mention that, I guess the main reason was - I need that to be a default since ASTextNode2 is a future I just enabled it by default :)

benniebotha reacted with thumbs up emoji
Copy link

@elesahich elesahich Dec 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.define("AS_ENABLE_TEXTNODE", to: "0"),
.define("AS_ENABLE_TEXTNODE", to: "1"),

This option leads undefined symbol: _OBJC_CLASS_$_ ASTEXTNODE2- error when using ASTextNode2. If you can check, or if someone else meets this error, try changing it from 0 to 1.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option makes usage of ASTextNode2 a default. So in your code, you should reference it just like ASTextNode

Copy link
Author

3a4oT commented Sep 9, 2021

Just an small update:

  • So I was manage to upstream my SPM changes to Instagram. (SPM number10 Instagram/IGListKit#1487 ). This mean that technically we can drop my fork from the dependencies. However, this may be tricky since IGListKit on current master doesn't work well with Texture. More investigation required.

  • I'm waiting until SE-0303 will be available (probably Swift 5.6) to continue my work and implement code generation as a plugin.

MussaCharles, denkeni, and alex1704 reacted with thumbs up emoji

Copy link

I'm waiting until SE-0303 will be available (probably Swift 5.6) to continue my work and implement code generation as a plugin.

Hai @3a4oT it's available now in Xcode 13.3 beta, perhaps you can continue this MR if you're available, thanks in advance 🙏

denkeni reacted with rocket emoji

Copy link

dehrom commented Mar 11, 2022

Any updates please? 😥

Copy link
Author

3a4oT commented Mar 11, 2022

As you may know, my country (Ukraine) was attacked by russian invaders, I'm on military service now and don't have time at the moment to support this fork. Invaders Must Die!

dehrom, rogerluan, bejeri4, annomusa, and ccomsi reacted with heart emoji

Copy link

nickaroot commented Mar 11, 2022
edited
Loading

Please, don't mess up P. and russians...

So, on my fork SPM is working, if you need that

Package.swift example:
https://github.com/nickaroot/TextureUI/blob/master/Package.swift

Copy link

bejeri4 commented Mar 16, 2022

Слава Украине! Героям слава! 🇺🇦

hostisru reacted with thumbs down emoji 3a4oT reacted with rocket emoji

// Cast to NSObject will be removed after https://github.com/Instagram/IGListKit/pull/435
if ([(id<NSObject>)updater isKindOfClass:[IGListAdapterUpdater class]]) {
[(IGListAdapterUpdater *)updater setAllowsBackgroundReloading:NO];
// [(IGListAdapterUpdater *)updater setAllowsBackgroundReloading:NO];
Copy link

@vadimvitvickiy vadimvitvickiy Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be commented, bug is still relevant, dataSource won't update properly using Texture+IGListKit when self.setAllowsBackgroundReloading == true, collectionView.window == nil

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like no longer valid on the latest IGListKit

Copy link
Contributor

muukii commented Jun 30, 2022

What other tasks do we have to accomplish this PR? I might help

Copy link

please merge - need SPM integration urgently.

bejeri4, ccomsi, ofournier-nuglif, and 98prabowo reacted with thumbs up emoji rogerluan reacted with laugh emoji

Copy link
Contributor

muukii commented Aug 31, 2022

and I found a situation that break-points are not working when installed as swift-package.
I filed it on FB11418698

@muukii muukii mentioned this pull request Jan 5, 2023
Copy link
Author

3a4oT commented Aug 5, 2023
edited
Loading

Hey all. No commitments, but I did some work this morning to synchronize the latest IGListKit and Texture. For now, it will live under my fork branch - 3a4oT#1. In a time of my absence, Xcode 14.3 arrives, which add one more challenge to make it work. We need to land new versions of PINOperation, PINRemoteImage, PINCache to be compatible with Xcode 14.3. Also, we need to make Instagram finally tag a new release on GitHub. For PIN-related repositories I saw that community started to submit PRs, but it seems like there are no active maintainers. For Instagram related task, I started a conversation . If you want to contribute and don't know how, please leave a comment/issue on those repositories so you may be heard.

shimastripe and bejeri4 reacted with thumbs up emoji

Copy link
Contributor

rcancro commented Sep 26, 2023

Apologies that this has sat for so long. I have a couple questions about this PR.

Why did you change all of the imports? Is this required for Package.swift to work? If it isn't required, splitting up these diffs would make it much easier for us to move forward with landing.

Is the "hack" for AsyncDisplayKitIGListKit still required? I see that IGListKit has a Package.swift file. Is it possible to use this instead?

Copy link

The imports change is required for SPM to work, yes.

Copy link

It this cannot be merged, can we please close this PR?

Copy link

Any update on this? Honestly, SPM support should be top priority in 2025.

Copy link
Author

3a4oT commented Oct 17, 2025

Apologies that this has sat for so long. I have a couple questions about this PR.

Why did you change all of the imports? Is this required for Package.swift to work? If it isn't required, splitting up these diffs would make it much easier for us to move forward with landing.

Is the "hack" for AsyncDisplayKitIGListKit still required? I see that IGListKit has a Package.swift file. Is it possible to use this instead?

Hey, when I started this work, SPM was very limited, and all those tricks with local style imports "" vs framework style imports <> were necessary to build. The same thing with the hack for AsyncDisplayKitIGListKit. I will validate Swift 6.2 capabilities and package traits to see whether it will help us.

Copy link
Author

3a4oT commented Oct 19, 2025

My latest attempt is under a new PR #2128. Testers are welcome :)

@3a4oT 3a4oT closed this Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

5 more reviewers

@xezero xezero xezero left review comments

@vadimvitvickiy vadimvitvickiy vadimvitvickiy left review comments

@benniebotha benniebotha benniebotha left review comments

@elesahich elesahich elesahich left review comments

@stareque-atlassian stareque-atlassian stareque-atlassian left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /