Skip to content
Permalink
Browse files

πŸš€

  • Loading branch information...
wkiefer committed Feb 17, 2017
0 parents commit f11b23b37612567b93fdd6c3de942e280ccec250
Showing with 11,112 additions and 0 deletions.
  1. +35 βˆ’0 .gitignore
  2. +74 βˆ’0 CODE_OF_CONDUCT.md
  3. +25 βˆ’0 CONTRIBUTING.md
  4. +3 βˆ’0 Configuration/Pilot-Project-Debug.xcconfig
  5. +3 βˆ’0 Configuration/Pilot-Project-Release.xcconfig
  6. +3 βˆ’0 Configuration/Pilot-Project-Test.xcconfig
  7. +8 βˆ’0 Configuration/Pilot-Target.xcconfig
  8. +190 βˆ’0 Configuration/xcconfigs/Base/Common.xcconfig
  9. +43 βˆ’0 Configuration/xcconfigs/Base/Configurations/Debug.xcconfig
  10. +27 βˆ’0 Configuration/xcconfigs/Base/Configurations/Profile.xcconfig
  11. +34 βˆ’0 Configuration/xcconfigs/Base/Configurations/Release.xcconfig
  12. +10 βˆ’0 Configuration/xcconfigs/Base/Configurations/Test.xcconfig
  13. +12 βˆ’0 Configuration/xcconfigs/Base/Targets/Application.xcconfig
  14. +37 βˆ’0 Configuration/xcconfigs/Base/Targets/Framework.xcconfig
  15. +32 βˆ’0 Configuration/xcconfigs/Base/Targets/StaticLibrary.xcconfig
  16. +15 βˆ’0 Configuration/xcconfigs/Mac OS X/Mac-Application.xcconfig
  17. +19 βˆ’0 Configuration/xcconfigs/Mac OS X/Mac-Base.xcconfig
  18. +18 βˆ’0 Configuration/xcconfigs/Mac OS X/Mac-DynamicLibrary.xcconfig
  19. +11 βˆ’0 Configuration/xcconfigs/Mac OS X/Mac-Framework.xcconfig
  20. +11 βˆ’0 Configuration/xcconfigs/Mac OS X/Mac-StaticLibrary.xcconfig
  21. +17 βˆ’0 Configuration/xcconfigs/README.md
  22. +11 βˆ’0 Configuration/xcconfigs/iOS/iOS-Application.xcconfig
  23. +18 βˆ’0 Configuration/xcconfigs/iOS/iOS-Base.xcconfig
  24. +11 βˆ’0 Configuration/xcconfigs/iOS/iOS-Framework.xcconfig
  25. +11 βˆ’0 Configuration/xcconfigs/iOS/iOS-StaticLibrary.xcconfig
  26. +11 βˆ’0 Configuration/xcconfigs/tvOS/tvOS-Application.xcconfig
  27. +15 βˆ’0 Configuration/xcconfigs/tvOS/tvOS-Base.xcconfig
  28. +11 βˆ’0 Configuration/xcconfigs/tvOS/tvOS-Framework.xcconfig
  29. +11 βˆ’0 Configuration/xcconfigs/tvOS/tvOS-StaticLibrary.xcconfig
  30. +11 βˆ’0 Configuration/xcconfigs/watchOS/watchOS-Application.xcconfig
  31. +15 βˆ’0 Configuration/xcconfigs/watchOS/watchOS-Base.xcconfig
  32. +11 βˆ’0 Configuration/xcconfigs/watchOS/watchOS-Framework.xcconfig
  33. +11 βˆ’0 Configuration/xcconfigs/watchOS/watchOS-StaticLibrary.xcconfig
  34. +294 βˆ’0 Core/Source/Async.swift
  35. +21 βˆ’0 Core/Source/Downcast.swift
  36. +46 βˆ’0 Core/Source/Hash/Hash.cpp
  37. +40 βˆ’0 Core/Source/Hash/Hash.h
  38. +351 βˆ’0 Core/Source/Hash/SpookyV2.cpp
  39. +302 βˆ’0 Core/Source/Hash/SpookyV2.h
  40. +29 βˆ’0 Core/Source/Logging/ConsoleLogger.swift
  41. +87 βˆ’0 Core/Source/Logging/FileLogger.swift
  42. +182 βˆ’0 Core/Source/Logging/Logger.swift
  43. +48 βˆ’0 Core/Source/MVVM/Action.swift
  44. +27 βˆ’0 Core/Source/MVVM/AsyncModelCollection.swift
  45. +181 βˆ’0 Core/Source/MVVM/Context.swift
  46. +282 βˆ’0 Core/Source/MVVM/DiffEngine.swift
  47. +23 βˆ’0 Core/Source/MVVM/EmptyModelCollection.swift
  48. +208 βˆ’0 Core/Source/MVVM/FilteredModelCollection.swift
  49. +91 βˆ’0 Core/Source/MVVM/MappedModelCollection.swift
  50. +158 βˆ’0 Core/Source/MVVM/Model.swift
  51. +292 βˆ’0 Core/Source/MVVM/ModelCollection.swift
  52. +193 βˆ’0 Core/Source/MVVM/MultiplexModelCollection.swift
  53. +95 βˆ’0 Core/Source/MVVM/ScoredModelCollection.swift
  54. +43 βˆ’0 Core/Source/MVVM/SimpleModelCollection.swift
  55. +60 βˆ’0 Core/Source/MVVM/StaticModel.swift
  56. +33 βˆ’0 Core/Source/MVVM/StaticModelCollection.swift
  57. +50 βˆ’0 Core/Source/MVVM/StaticViewBindingProvider.swift
  58. +43 βˆ’0 Core/Source/MVVM/SwitchableModelCollection.swift
  59. +265 βˆ’0 Core/Source/MVVM/View.swift
  60. +18 βˆ’0 Core/Source/MVVM/ViewLayout.swift
  61. +145 βˆ’0 Core/Source/MVVM/ViewModel.swift
  62. +28 βˆ’0 Core/Source/Mac-Info.plist
  63. +132 βˆ’0 Core/Source/Observable/Observable.swift
  64. +226 βˆ’0 Core/Source/Observable/ObservableData.swift
  65. +13 βˆ’0 Core/Source/Pilot.h
  66. +46 βˆ’0 Core/Source/Token.swift
  67. +26 βˆ’0 Core/Source/iOS-Info.plist
  68. +24 βˆ’0 Core/Tests/Info.plist
  69. +69 βˆ’0 Core/Tests/Logging/LoggingTests.swift
  70. +41 βˆ’0 Core/Tests/MVVM/AsyncModelCollectionTests.swift
  71. +233 βˆ’0 Core/Tests/MVVM/DiffEngineTests.swift
  72. +30 βˆ’0 Core/Tests/MVVM/EmptyModelCollectionTests.swift
  73. +63 βˆ’0 Core/Tests/MVVM/FilteredModelCollectionTests.swift
  74. +93 βˆ’0 Core/Tests/MVVM/MappedModelCollectionTests.swift
  75. +35 βˆ’0 Core/Tests/MVVM/SimpleModelCollection.swift
  76. +22 βˆ’0 Core/Tests/MVVM/TestModel.swift
  77. +44 βˆ’0 Core/Tests/Observable/ObservableTests.swift
  78. +13 βˆ’0 Documentation/FAQ.md
  79. +45 βˆ’0 Documentation/Flight Plan.md
  80. +3 βˆ’0 Documentation/Getting Started.md
  81. +13 βˆ’0 LICENSE
  82. +1,808 βˆ’0 Pilot.xcodeproj/project.pbxproj
  83. +7 βˆ’0 Pilot.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  84. +99 βˆ’0 Pilot.xcodeproj/xcshareddata/xcschemes/Pilot iOS.xcscheme
  85. +99 βˆ’0 Pilot.xcodeproj/xcshareddata/xcschemes/Pilot macOS.xcscheme
  86. +99 βˆ’0 Pilot.xcodeproj/xcshareddata/xcschemes/PilotUI iOS.xcscheme
  87. +99 βˆ’0 Pilot.xcodeproj/xcshareddata/xcschemes/PilotUI macOS.xcscheme
  88. +42 βˆ’0 README.md
  89. +136 βˆ’0 UI/Source/AppKitExtensions/NSCollectionView+Selection.swift
  90. +67 βˆ’0 UI/Source/AppKitExtensions/NSEvent+Keys.swift
  91. +73 βˆ’0 UI/Source/AppKitExtensions/NSMenu+Action.swift
  92. +30 βˆ’0 UI/Source/CollectionViews/CollectionHostedView.swift
  93. +41 βˆ’0 UI/Source/CollectionViews/CollectionViewInternals.swift
  94. +1,285 βˆ’0 UI/Source/CollectionViews/CollectionViewModelDataSource.swift
  95. +322 βˆ’0 UI/Source/CollectionViews/ios/CollectionViewController.swift
  96. +85 βˆ’0 UI/Source/CollectionViews/ios/CollectionViewHostCell.swift
  97. +64 βˆ’0 UI/Source/CollectionViews/ios/CollectionViewHostReusableView.swift
  98. +83 βˆ’0 UI/Source/CollectionViews/ios/Nested/NestedModelCollectionView.swift
  99. +134 βˆ’0 UI/Source/CollectionViews/mac/CollectionView.swift
  100. +576 βˆ’0 UI/Source/CollectionViews/mac/CollectionViewController.swift
  101. +111 βˆ’0 UI/Source/CollectionViews/mac/CollectionViewHostItem.swift
  102. +53 βˆ’0 UI/Source/Extensions/AssociatedObjects.swift
  103. +7 βˆ’0 UI/Source/Extensions/Collection.swift
  104. +26 βˆ’0 UI/Source/Info-iOS.plist
  105. +28 βˆ’0 UI/Source/Info-macOS.plist
  106. +62 βˆ’0 UI/Source/Layout/LayoutConstraints.swift
  107. +16 βˆ’0 UI/Source/PilotUI.h
  108. +32 βˆ’0 UI/Source/PlatformAliases.swift
  109. +24 βˆ’0 UI/Tests/Info-iOS.plist
  110. +24 βˆ’0 UI/Tests/Info-macOS.plist
@@ -0,0 +1,35 @@
# Forked from https://github.com/github/gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.xcscmblueprint

## Other
*.moved-aside
*.xcuserstate

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

## Swift Package Manager
Packages/
.build/
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting any project maintainer https://github.com/dropbox/pilot/graphs/contributors. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
@@ -0,0 +1,25 @@
# Contributing

Contributions and bug fixes are encouraged. In order to contribute, you'll need to sign a one time [Contributor License Agreement](https://opensource.dropbox.com/cla/).

## Bug Reports

Please use GitHub issues.

## Feedback and Communication

This project is young, so there is no official Discord server or email list yet. In the meantime, please reach out to [pilot-opensource@dropbox.com](mailto:pilot-opensource@dropbox.com) for any questions, feature ideas, or suggestions. [@wkiefer](https://twitter.com/wkiefer) and [@danielrhammond](https://twitter.com/danielrhammond) are available on Twitter as well.

Before implementing any major changes, please reach out to to discuss.

## Style

There is no published style guide (yet). In general, please match the surrounding code. Our style is similar to [GitHub style](https://github.com/github/swift-style-guide) with some extra principles:

- All top-level types should have access control specified.
- Group protocol implementations and subclass overrides with `// MARK:` statements.
- Column limit of 120.
- Method signatures either fit on one line, or should be broken at every param, with the closing parentheses and opening scope bracket shifted-left to match the `func` declaration. This helps Xcode.



@@ -0,0 +1,3 @@
#include "xcconfigs/Base/Configurations/Debug.xcconfig"

SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
@@ -0,0 +1,3 @@
#include "xcconfigs/Base/Configurations/Release.xcconfig"

SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
@@ -0,0 +1,3 @@
#include "xcconfigs/Base/Configurations/Test.xcconfig"

SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
@@ -0,0 +1,8 @@
#include "xcconfigs/iOS/iOS-Framework.xcconfig"

CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Core/Source/Hash";
CLANG_CXX_LANGUAGE_STANDARD = c++0x
CLANG_ENABLE_MODULES = YES

APPLICATION_EXTENSION_API_ONLY = YES
@@ -0,0 +1,190 @@
//
// This file defines common settings that should be enabled for every new
// project. Typically, you want to use Debug, Release, or a similar variant
// instead.
//

// Disable legacy-compatible header searching
ALWAYS_SEARCH_USER_PATHS = NO

// Architectures to build
ARCHS = $(ARCHS_STANDARD)

// Whether to warn when a floating-point value is used as a loop counter
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES

// Whether to warn about use of rand() and random() being used instead of arc4random()
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES

// Whether to warn about strcpy() and strcat()
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES

// Whether to enable module imports
CLANG_ENABLE_MODULES = YES

// Enable ARC
CLANG_ENABLE_OBJC_ARC = YES

// Warn about implicit conversions to boolean values that are suspicious.
// For example, writing 'if (foo)' with 'foo' being the name a function will trigger a warning.
CLANG_WARN_BOOL_CONVERSION = YES

// Warn about implicit conversions of constant values that cause the constant value to change,
// either through a loss of precision, or entirely in its meaning.
CLANG_WARN_CONSTANT_CONVERSION = YES

// Whether to warn when overriding deprecated methods
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES

// Warn about direct accesses to the Objective-C 'isa' pointer instead of using a runtime API.
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR

// Warn about declaring the same method more than once within the same @interface.
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES

// Warn about loop bodies that are suspiciously empty.
CLANG_WARN_EMPTY_BODY = YES

// Warn about implicit conversions between different kinds of enum values.
// For example, this can catch issues when using the wrong enum flag as an argument to a function or method.
CLANG_WARN_ENUM_CONVERSION = YES

// Whether to warn on implicit conversions between signed/unsigned types
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO

// Warn about implicit conversions between pointers and integers.
// For example, this can catch issues when one incorrectly intermixes using NSNumbers and raw integers.
CLANG_WARN_INT_CONVERSION = YES

// Warn about implicit capture of self (e.g. direct ivar access)
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES

// Don't warn about repeatedly using a weak reference without assigning the weak reference to a strong reference. Too many false positives.
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO

// Warn about classes that unintentionally do not subclass a root class (such as NSObject).
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR

// Whether to warn on suspicious implicit conversions
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES

// Warn about potentially unreachable code
CLANG_WARN_UNREACHABLE_CODE = YES

// The format of debugging symbols
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym

// Whether to compile assertions in
ENABLE_NS_ASSERTIONS = YES

// Whether to require objc_msgSend to be cast before invocation
ENABLE_STRICT_OBJC_MSGSEND = YES

// Which C variant to use
GCC_C_LANGUAGE_STANDARD = gnu99

// Whether to enable exceptions for Objective-C
GCC_ENABLE_OBJC_EXCEPTIONS = YES

// Whether to generate debugging symbols
GCC_GENERATE_DEBUGGING_SYMBOLS = YES

// Whether to precompile the prefix header (if one is specified)
GCC_PRECOMPILE_PREFIX_HEADER = YES

// Whether to enable strict aliasing, meaning that two pointers of different
// types (other than void * or any id type) cannot point to the same memory
// location
GCC_STRICT_ALIASING = YES

// Whether symbols not explicitly exported are hidden by default (this primarily
// only affects C++ code)
GCC_SYMBOLS_PRIVATE_EXTERN = NO

// Whether static variables are thread-safe by default
GCC_THREADSAFE_STATICS = NO

// Which compiler to use
GCC_VERSION = com.apple.compilers.llvm.clang.1_0

// Whether warnings are treated as errors
GCC_TREAT_WARNINGS_AS_ERRORS = YES

// Whether to warn about 64-bit values being implicitly shortened to 32 bits
GCC_WARN_64_TO_32_BIT_CONVERSION = YES

// Whether to warn about fields missing from structure initializers (only if
// designated initializers aren't used)
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES

// Whether to warn about missing function prototypes
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO

// Whether to warn about implicit conversions in the signedness of the type
// a pointer is pointing to (e.g., 'int *' getting converted to 'unsigned int *')
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES

// Whether to warn when the value returned from a function/method/block does not
// match its return type
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR

// Whether to warn on a class not implementing all the required methods of
// a protocol it declares conformance to
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES

// Whether to warn when switching on an enum value, and all possibilities are
// not accounted for
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES

// Whether to warn about the use of four-character constants
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES

// Whether to warn about an aggregate data type's initializer not being fully
// bracketed (e.g., array initializer syntax)
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES

// Whether to warn about missing braces or parentheses that make the meaning of
// the code ambiguous
GCC_WARN_MISSING_PARENTHESES = YES

// Whether to warn about unsafe comparisons between values of different
// signedness
GCC_WARN_SIGN_COMPARE = YES

// Whether to warn about the arguments to printf-style functions not matching
// the format specifiers
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES

// Warn if a "@selector(...)" expression referring to an undeclared selector is found
GCC_WARN_UNDECLARED_SELECTOR = YES

// Warn if a variable might be clobbered by a setjmp call or if an automatic variable is used without prior initialization.
GCC_WARN_UNINITIALIZED_AUTOS = YES

// Whether to warn about static functions that are unused
GCC_WARN_UNUSED_FUNCTION = YES

// Whether to warn about labels that are unused
GCC_WARN_UNUSED_LABEL = YES

// Whether to warn about variables that are never used
GCC_WARN_UNUSED_VARIABLE = YES

// Whether to run the static analyzer with every build
RUN_CLANG_STATIC_ANALYZER = YES

// Don't treat unknown warnings as errors, and disable GCC compatibility warnings and unused static const variable warnings
WARNING_CFLAGS = -Wno-error=unknown-warning-option -Wno-gcc-compat -Wno-unused-const-variable -Wno-nullability-completeness

// This setting is on for new projects as of Xcode ~6.3, though it is still not
// the default. It warns if the same variable is declared in two binaries that
// are linked together.
GCC_NO_COMMON_BLOCKS = YES

// This warnings detects when a function will recursively call itself on every
// code path though that function. More information can be found here:
// http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131216/096004.html
CLANG_WARN_INFINITE_RECURSION = YES

// This warning detects suspicious uses of std::move.
CLANG_WARN_SUSPICIOUS_MOVE = YES
@@ -0,0 +1,43 @@
//
// This file defines the base configuration for a Debug build of any project.
// This should be set at the project level for the Debug configuration.
//

#include "../Common.xcconfig"

// Whether to strip debugging symbols when copying resources (like included
// binaries)
COPY_PHASE_STRIP = NO

// The optimization level (0, 1, 2, 3, s) for the produced binary
GCC_OPTIMIZATION_LEVEL = 0

// Preproccessor definitions to apply to each file compiled
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1

// Whether to enable link-time optimizations (such as inlining across translation
// units)
LLVM_LTO = NO

// Whether to only build the active architecture
ONLY_ACTIVE_ARCH = YES

// Other compiler flags
//
// These settings catch some errors in integer arithmetic
OTHER_CFLAGS = -ftrapv

// Other flags to pass to the Swift compiler
//
// This enables conditional compilation with #if DEBUG
OTHER_SWIFT_FLAGS = -D DEBUG

// Whether to strip debugging symbols when copying the built product to its
// final installation location
STRIP_INSTALLED_PRODUCT = NO

// The optimization level (-Onone, -O, -Ofast) for the produced Swift binary
SWIFT_OPTIMIZATION_LEVEL = -Onone

// Disable Developer ID timestamping
OTHER_CODE_SIGN_FLAGS = --timestamp=none

0 comments on commit f11b23b

Please sign in to comment.
You can’t perform that action at this time.