Skip to content

Commit

Permalink
Added compatibility header
Browse files Browse the repository at this point in the history
Summary:
- Added IGListCompatibility.h file, and imported it in the files where we need the target check.
- Ordered the project by type

In "IGListKit.h" we still have the conditional check for `#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR` - Did we want to make a macro or something for this check?

This is the most Obj-C I've ever done... just felt that was a worthy comment.

Closes #364

- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes #369

Differential Revision: D4366344

Pulled By: jessesquires

fbshipit-source-id: f0a6168b8965ded22a641814797fbdec92ca1c36
  • Loading branch information
Sherlock authored and Facebook Github Bot committed Dec 24, 2016
1 parent c6b65cf commit 19d4f9d
Show file tree
Hide file tree
Showing 11 changed files with 947 additions and 928 deletions.
696 changes: 350 additions & 346 deletions Examples/Examples-iOS/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

330 changes: 167 additions & 163 deletions Examples/Examples-macOS/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

762 changes: 383 additions & 379 deletions Examples/Examples-tvOS/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 25 additions & 17 deletions IGListKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@
88DF89881E010F5C00B1B9B4 /* IGListDiffResultTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 294AC6311DDE4C19002FCE5D /* IGListDiffResultTests.m */; };
88DF89891E010F6500B1B9B4 /* IGListDiffSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88144EE61D870EDC007C7F66 /* IGListDiffSwiftTests.swift */; };
88DF898A1E010F7000B1B9B4 /* IGListDiffTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 88144EE81D870EDC007C7F66 /* IGListDiffTests.m */; };
989317631E0ED45900DB93B3 /* IGListCompatibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 989317621E0ED45900DB93B3 /* IGListCompatibility.h */; settings = {ATTRIBUTES = (Public, ); }; };
989317641E0ED45900DB93B3 /* IGListCompatibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 989317621E0ED45900DB93B3 /* IGListCompatibility.h */; settings = {ATTRIBUTES = (Public, ); }; };
989317651E0ED45900DB93B3 /* IGListCompatibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 989317621E0ED45900DB93B3 /* IGListCompatibility.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -430,6 +433,7 @@
887D0B3F1D870D7F009E01F7 /* IGListKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IGListKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
887D0B571D870E1E009E01F7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
88DF897C1E010E6A00B1B9B4 /* IGListKit-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IGListKit-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
989317621E0ED45900DB93B3 /* IGListCompatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IGListCompatibility.h; sourceTree = "<group>"; };
C4A16046BECFD57B7EB75259 /* Pods-IGListKitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IGListKitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-IGListKitTests/Pods-IGListKitTests.debug.xcconfig"; sourceTree = "<group>"; };
DD3152AC1DE227FA00AC9D2C /* IGListKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IGListKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FD40284889DE182FFC7F471E /* Pods_IGListKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_IGListKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -489,34 +493,34 @@
0B3B927E1E08D7F5008390ED /* Source */ = {
isa = PBXGroup;
children = (
0B3B927F1E08D7F5008390ED /* Common */,
0B3B929A1E08D7F5008390ED /* IGListAdapter.h */,
0B3B929B1E08D7F5008390ED /* IGListAdapter.m */,
0B3B929C1E08D7F5008390ED /* IGListAdapterDataSource.h */,
0B3B929D1E08D7F5008390ED /* IGListAdapterDelegate.h */,
0B3B929E1E08D7F5008390ED /* IGListAdapterUpdater.h */,
0B3B929F1E08D7F5008390ED /* IGListAdapterUpdater.m */,
0B3B92A01E08D7F5008390ED /* IGListAdapterUpdaterDelegate.h */,
0B3B92A11E08D7F5008390ED /* IGListCollectionContext.h */,
0B3B92A21E08D7F5008390ED /* IGListCollectionView.h */,
0B3B92A31E08D7F5008390ED /* IGListCollectionView.m */,
0B3B92A41E08D7F5008390ED /* IGListDisplayDelegate.h */,
0B3B92A51E08D7F5008390ED /* IGListGridCollectionViewLayout.h */,
0B3B92A61E08D7F5008390ED /* IGListGridCollectionViewLayout.m */,
0B3B92A71E08D7F5008390ED /* IGListReloadDataUpdater.h */,
0B3B92A81E08D7F5008390ED /* IGListReloadDataUpdater.m */,
0B3B92A91E08D7F5008390ED /* IGListScrollDelegate.h */,
0B3B92AA1E08D7F5008390ED /* IGListSectionController.h */,
0B3B92AB1E08D7F5008390ED /* IGListSectionController.m */,
0B3B92AC1E08D7F5008390ED /* IGListSectionType.h */,
0B3B92AD1E08D7F5008390ED /* IGListSingleSectionController.h */,
0B3B92AE1E08D7F5008390ED /* IGListSingleSectionController.m */,
0B3B92AF1E08D7F5008390ED /* IGListStackedSectionController.h */,
0B3B92B01E08D7F5008390ED /* IGListStackedSectionController.m */,
0B3B92B11E08D7F5008390ED /* IGListSupplementaryViewSource.h */,
0B3B92B21E08D7F5008390ED /* IGListUpdatingDelegate.h */,
0B3B92B31E08D7F5008390ED /* IGListWorkingRangeDelegate.h */,
0B3B929B1E08D7F5008390ED /* IGListAdapter.m */,
0B3B929F1E08D7F5008390ED /* IGListAdapterUpdater.m */,
0B3B92A31E08D7F5008390ED /* IGListCollectionView.m */,
0B3B92A61E08D7F5008390ED /* IGListGridCollectionViewLayout.m */,
0B3B92A81E08D7F5008390ED /* IGListReloadDataUpdater.m */,
0B3B92AB1E08D7F5008390ED /* IGListSectionController.m */,
0B3B92AE1E08D7F5008390ED /* IGListSingleSectionController.m */,
0B3B92B01E08D7F5008390ED /* IGListStackedSectionController.m */,
0B3B92B41E08D7F5008390ED /* Info.plist */,
0B3B927F1E08D7F5008390ED /* Common */,
0B3B92B51E08D7F5008390ED /* Internal */,
);
path = Source;
Expand All @@ -527,26 +531,27 @@
children = (
0B3B92801E08D7F5008390ED /* IGListAssert.h */,
0B3B92811E08D7F5008390ED /* IGListBatchUpdateData.h */,
0B3B92821E08D7F5008390ED /* IGListBatchUpdateData.mm */,
989317621E0ED45900DB93B3 /* IGListCompatibility.h */,
0B3B92831E08D7F5008390ED /* IGListDiff.h */,
0B3B92841E08D7F5008390ED /* IGListDiff.mm */,
0B3B92851E08D7F5008390ED /* IGListDiffable.h */,
0B3B92861E08D7F5008390ED /* IGListExperiments.h */,
0B3B92871E08D7F5008390ED /* IGListIndexPathResult.h */,
0B3B92881E08D7F5008390ED /* IGListIndexPathResult.m */,
0B3B92891E08D7F5008390ED /* IGListIndexSetResult.h */,
0B3B928A1E08D7F5008390ED /* IGListIndexSetResult.m */,
0B3B928B1E08D7F5008390ED /* IGListKit.h */,
0B3B928C1E08D7F5008390ED /* IGListMacros.h */,
0B3B928D1E08D7F5008390ED /* IGListMoveIndex.h */,
0B3B928E1E08D7F5008390ED /* IGListMoveIndex.m */,
0B3B928F1E08D7F5008390ED /* IGListMoveIndexPath.h */,
0B3B92901E08D7F5008390ED /* IGListMoveIndexPath.m */,
0B3B92911E08D7F5008390ED /* Internal */,
0B3B92961E08D7F5008390ED /* NSNumber+IGListDiffable.h */,
0B3B92971E08D7F5008390ED /* NSNumber+IGListDiffable.m */,
0B3B92981E08D7F5008390ED /* NSString+IGListDiffable.h */,
0B3B92881E08D7F5008390ED /* IGListIndexPathResult.m */,
0B3B928A1E08D7F5008390ED /* IGListIndexSetResult.m */,
0B3B928E1E08D7F5008390ED /* IGListMoveIndex.m */,
0B3B92901E08D7F5008390ED /* IGListMoveIndexPath.m */,
0B3B92971E08D7F5008390ED /* NSNumber+IGListDiffable.m */,
0B3B92991E08D7F5008390ED /* NSString+IGListDiffable.m */,
0B3B92821E08D7F5008390ED /* IGListBatchUpdateData.mm */,
0B3B92841E08D7F5008390ED /* IGListDiff.mm */,
0B3B92911E08D7F5008390ED /* Internal */,
);
path = Common;
sourceTree = "<group>";
Expand Down Expand Up @@ -725,6 +730,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
989317641E0ED45900DB93B3 /* IGListCompatibility.h in Headers */,
0B3B92FB1E08D7F5008390ED /* IGListAdapterDataSource.h in Headers */,
0B3B92E91E08D7F5008390ED /* IGListIndexSetResultInternal.h in Headers */,
0B3B930B1E08D7F5008390ED /* IGListDisplayDelegate.h in Headers */,
Expand Down Expand Up @@ -776,6 +782,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
989317631E0ED45900DB93B3 /* IGListCompatibility.h in Headers */,
0B3B92FA1E08D7F5008390ED /* IGListAdapterDataSource.h in Headers */,
0B3B92E81E08D7F5008390ED /* IGListIndexSetResultInternal.h in Headers */,
0B3B930A1E08D7F5008390ED /* IGListDisplayDelegate.h in Headers */,
Expand Down Expand Up @@ -827,6 +834,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
989317651E0ED45900DB93B3 /* IGListCompatibility.h in Headers */,
0B3B934D1E08D839008390ED /* IGListBatchUpdateData.h in Headers */,
0B3B934B1E08D82E008390ED /* IGListMoveIndexPathInternal.h in Headers */,
0B3B93521E08D839008390ED /* IGListIndexSetResult.h in Headers */,
Expand Down
9 changes: 1 addition & 8 deletions Source/Common/IGListBatchUpdateData.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@
*/

#import "IGListBatchUpdateData.h"

#import <TargetConditionals.h>

#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#import <IGListKit/IGListCompatibility.h>

#import <unordered_map>

Expand Down
16 changes: 16 additions & 0 deletions Source/Common/IGListCompatibility.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import <TargetConditionals.h>

#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
9 changes: 1 addition & 8 deletions Source/Common/IGListDiff.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
#import <unordered_map>
#import <vector>

#import <TargetConditionals.h>

#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif

#import <IGListKit/IGListCompatibility.h>
#import <IGListKit/IGListMacros.h>
#import <IGListKit/IGListExperiments.h>

Expand Down
8 changes: 1 addition & 7 deletions Source/Common/IGListKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import <TargetConditionals.h>

#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#import <IGListKit/IGListCompatibility.h>

/**
* Project version number for IGListKit.
Expand Down

0 comments on commit 19d4f9d

Please sign in to comment.