Browse Source

update project

Marino Faggiana 6 years ago
parent
commit
eb406506a9
100 changed files with 1995 additions and 150 deletions
  1. 1 0
      Cartfile
  2. 1 0
      Cartfile.resolved
  3. 64 0
      Carthage/Checkouts/Sheeeeeeeeet/.gitignore
  4. 1 0
      Carthage/Checkouts/Sheeeeeeeeet/.swift-version
  5. 26 0
      Carthage/Checkouts/Sheeeeeeeeet/.swiftlint.yml
  6. 15 0
      Carthage/Checkouts/Sheeeeeeeeet/.travis.yml
  7. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Cartfile
  8. 2 0
      Carthage/Checkouts/Sheeeeeeeeet/Cartfile.private
  9. 2 0
      Carthage/Checkouts/Sheeeeeeeeet/Cartfile.resolved
  10. 44 0
      Carthage/Checkouts/Sheeeeeeeeet/Fastlane/Fastfile
  11. 21 0
      Carthage/Checkouts/Sheeeeeeeeet/LICENSE
  12. 321 0
      Carthage/Checkouts/Sheeeeeeeeet/RELEASE_NOTES.md
  13. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Demo.gif
  14. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Goofy Icon.sketch
  15. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Group.png
  16. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Logo.png
  17. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Logo.sketch
  18. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Title.png
  19. BIN
      Carthage/Checkouts/Sheeeeeeeeet/Resources/Web Icon.sketch
  20. 24 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet.podspec
  21. 27 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheet+Presenter.swift
  22. 323 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheet.swift
  23. 81 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheet.xib
  24. 13 11
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheetItemHandler.swift
  25. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheetMargin.swift
  26. 6 6
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/ActionSheetAppearance.swift
  27. 1 1
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/ActionSheetItemAppearance.swift
  28. 3 3
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/ActionSheetPopoverAppearance.swift
  29. 1 1
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetButtonAppearance.swift
  30. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetCancelButtonAppearance.swift
  31. 12 1
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetDangerButtonAppearance.swift
  32. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetOkButtonAppearance.swift
  33. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetCollectionItemAppearance.swift
  34. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetCustomItemAppearance.swift
  35. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetLinkItemAppearance.swift
  36. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetMultiSelectItemAppearance.swift
  37. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetMultiSelectToggleItemAppearance.swift
  38. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetSelectItemAppearance.swift
  39. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetSingleSelectItemAppearance.swift
  40. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Titles/ActionSheetSectionMarginAppearance.swift
  41. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Titles/ActionSheetSectionTitleAppearance.swift
  42. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Titles/ActionSheetTitleAppearance.swift
  43. 4 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/NSObject+ClassName.swift
  44. 16 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/UIView+Nib.swift
  45. 21 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/UIView+Subviews.swift
  46. 1 2
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/UIViewController+RootViewController.swift
  47. 24 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Info.plist
  48. 20 26
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/ActionSheetItem.swift
  49. 25 5
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetButton.swift
  50. 4 3
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetCancelButton.swift
  51. 4 10
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetDangerButton.swift
  52. 3 3
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetOkButton.swift
  53. 3 4
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetCollectionItem.swift
  54. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetCustomItem.swift
  55. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetLinkItem.swift
  56. 2 2
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetMultiSelectItem.swift
  57. 1 1
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetMultiSelectToggleItem.swift
  58. 3 3
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetSelectItem.swift
  59. 2 19
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetSingleSelectItem.swift
  60. 0 5
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Titles/ActionSheetSectionMargin.swift
  61. 0 5
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Titles/ActionSheetSectionTitle.swift
  62. 0 5
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Titles/ActionSheetTitle.swift
  63. 38 27
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Presenters/ActionSheetPopoverPresenter.swift
  64. 3 4
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Presenters/ActionSheetPresenter.swift
  65. 133 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Presenters/ActionSheetStandardPresenter.swift
  66. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Sheeeeeeeeet.h
  67. 2 2
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCollectionItemCell.swift
  68. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCollectionItemCell.xib
  69. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCollectionItemContentCell.swift
  70. 0 0
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCustomItemCell.swift
  71. 1 1
      Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetItemCell.swift
  72. 35 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/ActionSheet+Items.swift
  73. 81 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/CollectionActionSheet.swift
  74. 41 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/CustomActionSheet.swift
  75. 46 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/DestructiveActionSheet.swift
  76. 37 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/HeaderActionSheet.swift
  77. 34 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/LinkActionSheet.swift
  78. 50 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/MultiSelectActionSheet.swift
  79. 41 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/SectionActionSheet.swift
  80. 49 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/SingleSelectActionSheet.swift
  81. 34 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/StandardActionSheet.swift
  82. 80 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/AppDelegate+Appearance.swift
  83. 20 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/AppDelegate.swift
  84. 116 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json
  85. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-1024.png
  86. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-120.png
  87. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-152.png
  88. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-167.png
  89. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-180.png
  90. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-20.png
  91. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-29.png
  92. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-40.png
  93. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-58.png
  94. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-60.png
  95. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-76.png
  96. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-80.png
  97. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-87.png
  98. 6 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/Contents.json
  99. 26 0
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/ic_account.imageset/Contents.json
  100. BIN
      Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/ic_account.imageset/ic_account_circle.png

+ 1 - 0
Cartfile

@@ -1,2 +1,3 @@
 github "tilltue/TLPhotoPicker"
 github "tilltue/TLPhotoPicker"
 github "kishikawakatsumi/UICKeyChainStore"
 github "kishikawakatsumi/UICKeyChainStore"
+github "danielsaidi/Sheeeeeeeeet"

+ 1 - 0
Cartfile.resolved

@@ -1,2 +1,3 @@
+github "danielsaidi/Sheeeeeeeeet" "1.0.1"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "tilltue/TLPhotoPicker" "1.7.7"
 github "tilltue/TLPhotoPicker" "1.7.7"

+ 64 - 0
Carthage/Checkouts/Sheeeeeeeeet/.gitignore

@@ -0,0 +1,64 @@
+# Xcode
+#
+# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
+
+# OS X
+.DS_Store
+
+## Build generated
+build/
+DerivedData/
+
+## Various settings
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata/
+
+## Other
+*.moved-aside
+*.xccheckout
+*.xcscmblueprint
+
+## Obj-C/Swift specific
+*.hmap
+*.ipa
+*.dSYM.zip
+*.dSYM
+
+# Bundler
+.bundle
+
+## Playgrounds
+timeline.xctimeline
+playground.xcworkspace
+
+# Swift Package Manager
+#
+# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
+# Packages/
+# Package.pins
+.build/
+
+# CocoaPods
+# Pods/
+
+# Carthage
+Carthage
+
+# fastlane
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://docs.fastlane.tools/best-practices/source-control/#source-control
+
+Fastlane/report.xml
+Fastlane/Preview.html
+Fastlane/screenshots
+Fastlane/test_output
+Fastlane/README.md

+ 1 - 0
Carthage/Checkouts/Sheeeeeeeeet/.swift-version

@@ -0,0 +1 @@
+4.2

+ 26 - 0
Carthage/Checkouts/Sheeeeeeeeet/.swiftlint.yml

@@ -0,0 +1,26 @@
+disabled_rules:
+  - cyclomatic_complexity
+  - file_length
+  - function_body_length
+  - identifier_name
+  - line_length
+  - shorthand_operator
+  - trailing_whitespace
+  - type_body_length
+  - type_name
+  - vertical_whitespace
+  - void_return
+
+excluded:
+  - Pods
+  - Carthage
+
+# This is a strange one, since it also includes init functions
+function_parameter_count:
+  warning: 8
+  error: 8
+
+variable_name:
+  excluded:
+    - ok
+    - vc

+ 15 - 0
Carthage/Checkouts/Sheeeeeeeeet/.travis.yml

@@ -0,0 +1,15 @@
+# references:
+# * http://www.objc.io/issue-6/travis-ci.html
+# * https://github.com/supermarin/xcpretty#usage
+
+osx_image: xcode10
+language: swift
+
+before_install:
+  - brew outdated xctool || brew upgrade xctool
+  - carthage update
+
+script:
+  - set -o pipefail && xcodebuild -project "Sheeeeeeeeet.xcodeproj" -scheme "Sheeeeeeeeet" -sdk "iphonesimulator" | xcpretty -c
+  - pod lib lint
+  - fastlane test

+ 0 - 0
Carthage/Checkouts/Sheeeeeeeeet/Cartfile


+ 2 - 0
Carthage/Checkouts/Sheeeeeeeeet/Cartfile.private

@@ -0,0 +1,2 @@
+github "Quick/Quick"
+github "Quick/Nimble"

+ 2 - 0
Carthage/Checkouts/Sheeeeeeeeet/Cartfile.resolved

@@ -0,0 +1,2 @@
+github "Quick/Nimble" "v7.3.1"
+github "Quick/Quick" "v1.3.2"

+ 44 - 0
Carthage/Checkouts/Sheeeeeeeeet/Fastlane/Fastfile

@@ -0,0 +1,44 @@
+fastlane_version "2.30.2"
+
+default_platform :ios
+
+platform :ios do
+
+
+  # Version ================
+
+  desc "Create a new version"
+  lane :version do |options|
+    ensure_git_status_clean
+    ensure_git_branch(branch: 'master')
+    test
+    version = version_bump_podspec(path: "Sheeeeeeeeet.podspec", version_number: options[:name])
+    increment_version_number(version_number: version)
+    increment_build_number(build_number: version)
+
+    git_commit(
+      path: [
+        "Sheeeeeeeeet.podspec",
+        "*/Info.plist",
+        "*/*.pbxproj",
+        "Fastlane/"],
+      message: "Bump to #{version}"
+    )
+
+    add_git_tag(tag: version)
+    push_git_tags()
+    push_to_git_remote()
+    pod_push()
+  end
+
+  
+  # Test =======================
+
+  desc "Run unit tests"
+  lane :test do
+    scan(
+      project: "Sheeeeeeeeet.xcodeproj",
+      scheme: "Sheeeeeeeeet"
+    )    
+  end
+end

+ 21 - 0
Carthage/Checkouts/Sheeeeeeeeet/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Daniel Saidi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 321 - 0
Carthage/Checkouts/Sheeeeeeeeet/RELEASE_NOTES.md

@@ -0,0 +1,321 @@
+# Release Notes
+
+## 1.0.0
+
+Sheeeeeeeeet 1.0.0 is finally here, with many internal changes and some external.
+
+This version decouples action sheets from their presentation to great extent. An
+action sheet still styles its items and components, but the presenters now takes
+care of a lot more than before. The sheet setup is now also based on constraints
+instead of manual calculations, which means that popover scrolling etc. works by
+how the constraints are setup, instead of relying on manual calculations.
+
+This should result in much more robust action sheets, but it requires testing on
+a wide range of devices and orientations before it can be released as a 1.0.
+
+`IMPORTANT` The button item values have changed. Insted of `true` and `nil` they
+now have a strong `ButtonType` value. You can still create custom buttons with a
+custom value, though. You can also use the new `isOkButton` and `isCancelButton`
+extensions to quickly see if a user tapped "OK" or "Cancel".
+
+
+### Breaking changes
+
+Since the presentation logic has been rewritten from scratch, you have to adjust
+your code to fit the new structure, if you have subclassed any presenter or made
+presentation tweaks in your sheets. The changes are too many and extensive to be
+listed here, so please have a look at the new structure. There is much less code,
+so changing your code to the new standard should be easy.
+
+* `ActionSheetButton` and its sublasses has new values.
+* `ActionSheet.itemTapAction` has been removed
+* `ActionSheet.handleTap(on:)` is now called when an item is tapped
+* `ActionSheetAppearance.viewMargins` is renamed to `groupMargins`
+* `ActionSheetItem.itemType` has been removed; just check the raw type
+* `ActionSheetItem.handleTap(in:)` no longer has a `cell` parameter
+* `ActionSheetStandardPresenter` is renamed to `ActionSheetStandardPresenter`
+
+
+### New features
+
+* `ActionSheetAppearance` has new properties, which adds new way to style sheets.
+* `ActionSheetButton` adds `isOkButton` and `isCancelButton` extension functions
+to `ActionSheetItem`. They can be used to quickly check if a cancel or ok button
+was tapped, instead of having to check if the item can be cast to a button type. 
+
+
+### Bug fixes
+
+* The big presentation adjustments solves the scrolling issues that occured with
+popovers and many items.
+* The `hideSeparator()` function is adjusted to behave correctly when the device
+is rotated.
+
+
+### Deprecated logic
+
+Instead of deprecating presentation-related properties and functions that are no
+longer used or available, I removed them completely. Let me know if you used any
+properties that are no longer available.
+
+* `ActionSheetItem.setupItemsAndButtons(with:)` is renamed to `setup(items:)`
+* `ActionSheetItem.itemSelectAction` is renamed to `selectAction`
+
+Perform the deprecation warnings, and you should be all good. Deprecated members
+will be removed in the next minor version.
+
+
+
+## 0.11.0
+
+This version adds a `customAppearance` property to `ActionSheetItem` and fixes a
+few appearance glitches. Overall, it makes the appearance setup more consistent.
+
+* I use early returns in every appearance class and have optimized imports. Many
+appearance classes have also been made `open` instead of `public`.
+
+* The `ActionSheetItemAppearance` now has extensions for `noSeparator`, that can
+be used to hide the separator for certain item types.
+
+* The `ActionSheetCollectionItemAppearance` and `ActionSheetCustomItemAppearance`
+and `ActionSheetSectionMarginAppearance` classes have no overridden initializers
+anymore. This makes the work as expected when you use the same appearance tweaks
+as everywhere else.
+
+* The `ActionSheetPopoverAppearance` class doesn't inherit any appearance classes
+and has thus been moved out to the appearance root.
+
+
+
+## 0.10.1
+
+This revision fixes a project config that caused Carthage installations to fail.
+
+
+
+## 0.10.0
+
+`Sheeeeeeeeet` has a new item type: `ActionSheetCustomItem`. You can use it when
+you want to use a completely custom view in your action sheet. Just tell it what
+view you want to use and make sure that the view class inherits `ActionSheetItem`
+and implements `ActionSheetCustomItemCell`. Have a look at the example app for a
+simple example.
+
+`ActionSheetCollectionItem` `cellType` has been renamed to `itemCellType`, which
+makes it clearer that the type regards the collection view items.
+
+`ActionSheetItem` now has a `cellReuseIdentifier` and `className` property, that
+can be useful when sublassing various item classes. It also makes it much easier
+to register custom cell types. See `ActionSheetCollectionItem` `cell(for: ...)`.
+
+The collection item `CollectionItemCellAction` has been renamed to `CellAction`.
+
+
+
+## 0.9.9
+
+Let's all party like it's 0.9.9! 
+
+I've done some refactoring and will introduce a few breaking changes that can be
+easily fixed. They will hopefully not affect you at all.
+
+`ActionSheetItem` has an `itemType` property, that can be used to e.g. check the
+type of item that is tapped. For now, the enum has `item`, `button` and `title`.
+
+The `ActionSheetMargin` `fallback` function param has been renamed to `minimum`.
+
+`ActionSheetItemSelectAction` has been renamed to `ActionSheetItem.SelectAction`
+and `ActionSheetItemTapAction` has been renamed to `ActionSheetItemTapAction`.
+
+`ActionSheetItemHandler.CollectionType` has been renamed to `ItemType`.
+
+The two `ActionSheetItem` `handleTap` functions have been combined to one single
+function.
+
+
+
+## 0.9.8
+
+`ActionSheetPresenter` now has an `events` property, which contains presentation
+event actions that you can assign to get callbacks when certain events happen. A
+first `didDismissWithBackgroundTap` event has been added, which helps you detect
+if an action sheet is dismissed because a user tapped on the background, outside
+the actin sheet bounds. This works for both the standard and popover presenters.
+
+
+
+## 0.9.7
+
+`ActionSheetItem` now has `tapBehavior` as part of the constructor.
+
+`ActionSheetCollectionItem` now uses `open` instead of `public` for `collection`
+and `layout` related functions as well, which means that you can override them.
+
+
+
+## 0.9.6
+
+This version migrates Sheeeeeeeeeet to Swift 4.2. You will need Xcode 10 to work
+with the source code from now on.
+
+
+
+## 0.9.5
+
+This version adds a `backgroundColor` property to `ActionSheetItemAppearance`. I
+however want to emphasize that many appearance properties that can be controlled
+with the appearance classes, can also be setup using standard appearance proxies.
+
+
+
+## 0.9.4
+
+This version fixes a bug where all items with tap behavior `.none` did not get a
+highlight effect when they were tapped. Instead, title items set `selectionStyle`
+to `.none` for their cell.
+
+We have also added an index check in the item handler. We have seen some strange
+crashes in the logs, that hints at that the item handler sheet property could be
+deallocated but that users can still tap at an item...which then tries to access
+a deallocated item array. Hopefully, this helps.
+
+
+
+## [0.9.3](https://github.com/danielsaidi/Sheeeeeeeeet/milestone/8?closed=1)
+
+This fixes a crash that occured if the library was installed with CocoaPods. The
+podspec didn't include xibs, which caused the collection item to crash.
+
+
+
+## [0.9.2]
+
+In this version, the `ActionSheetStandardPresenter` initializer is finally public.
+I have forgot to do this for a couple of versions, which means that you have not
+been able to create custom instances of this class from within an app.
+
+This means that you can set the presenter to a `ActionSheetStandardPresenter` for
+any action sheet, which means that even iPads can now get iPhone-styled sheets.
+
+
+
+## [0.9.1](https://github.com/danielsaidi/Sheeeeeeeeet/milestone/7?closed=1)
+
+This version contains minor updates and minor breaking changes in internal logic.
+
+* The `ActionSheet` `appearance` and `presenter` properties are not lazy anymore.
+  Their initial values are set in a different way as well. `itemSelectAction` is
+  now set differently by the two initializers.
+
+* Popover action sheets on iPad caused a strange flickering effect, if they were
+  presented when the app was awaken from the background. @ullstrm found out that
+  it was caused by setting the separator inset to .greatestFiniteMagnitude in an
+  iPad popover. Really strange, but fixed by setting it to a laaaarge value.
+
+* Sheeeeeeeeet did handle the flickering bug by dismissing the popover sheets as
+  the app was sent to the background. This is no longer needed.
+
+
+
+## [0.9.0](https://github.com/danielsaidi/Sheeeeeeeeet/milestone/6?closed=1)
+
+`ActionSheetStandardPresenter` used to contain an embedded iPad presenter. I have
+never been happy with this design, and have now redesigned this setup. I removed
+the embedded presenter, merged `ActionSheetStandardPresenter` with the base class
+and now let the action sheet initializer resolve which default presenter to use.
+
+I have felt a little lost in how to use the various select items, especially now
+when Sheeeeeeeeet has select items, single-select items and multiselect items. I
+initially designed the select item to be a regular item, that could indicate its
+selected state. However, this behaved strange when another item became selected, 
+since the initially selected item was not deselected. After introducing this new
+item set, with single-select items and multiselect items, I have come to realize
+that the base class is probably not a good stand-alone class and have decided to
+make it private, to enforce using either of the two subclasses.
+
+The new `isDismissableWithTapOnBackground` presenter property can be used to set
+whether or not an action sheet can be dismissed by tapping on the background. It
+is true by default for all presenters.
+
+### Improvements:
+
+* The demo app presents action sheets from the tapped cells. However, this means
+  that on iPad, the popover will not use the full available screen height, since
+  it will be displayed above or below the cell. I have changed this, so that the
+  action sheet is presented from the cell's text label instead, which causes the
+  action sheet to float above the cell and make use of the entire screen size.
+
+### Bug fixes:
+
+* `ActionSheetPopoverPresenter` did not release its action sheet whenever a user
+  tapped on the background, causing a memory leak. This is fixed.
+
+### Breaking changes:
+
+* `ActionSheetStandardPresenter` no longer have an embedded `iPadPresenter`. This
+  is no longer needed, since the action sheet resolves the default presenter for
+  the current device.
+
+* `ActionSheetPresenterBase` has been removed and is now fully incorporated with
+  the `ActionSheetStandardPresenter` class.
+
+* `ActionSheetSelectItem`s initializer has been made library internal to enforce
+  using single and multi select items instead. This makes the api much clearer.
+
+* I have chosen to remove the `peek & pop` features, since the implementation is
+  so-so and it feels strange to peek and pop an action sheet. I hope that no one
+  actually used this feature (since it looked horrible from 0.8, for some reason).
+  You can still use Sheeeeeeeeeet with peek and pop, since the action sheets are
+  regular view controllers, but you have to write the logic yourself.
+
+
+
+## [0.8.4](https://github.com/danielsaidi/Sheeeeeeeeet/milestone/5?closed=1)
+
+Sheeeeeeeeet now has a new `ActionSheetMultiSelectToggleItem` item, which can be
+used to select and deselect all multiselect items in the same group.
+
+
+
+## [0.8.3](https://github.com/danielsaidi/Sheeeeeeeeet/milestone/4?closed=1)
+
+In this version, no cancel buttons will be displayed in popover presented action
+sheets, since the convention is to dismiss a popover by tapping anywhere outside
+the popover callout view.
+
+
+
+## 0.8.1
+
+The color properties in `ActionSheetSelectItemAppearance` have been renamed. The
+change is small, but the change will be breaking if you have used the properties
+to customize your action sheet appearances.
+
+
+
+## [0.8.0](https://github.com/danielsaidi/Sheeeeeeeeet/milestone/3?closed=1)
+
+Breaking changes! The toggle item has been a strange part of Sheeeeeeeeet. It is
+basically a select item with individual styling, which is easy to customize with
+the built-in appearance. We have therefore decided to remove this item type from
+`Sheeeeeeeeet`, with hopes that it will make the api more obvious.
+
+The `ActionSheetSingleSelectItem` tap behavior has been changed to use `.dismiss`.
+This makes the behavior consistent with the standard select item. This means you
+have to manually set the tap behavior `.none` whenever you need that behavior.
+
+We have added a `ActionSheetSingleSelectItemAppearance` class to the library and
+added a new `singleSelectItem` property to the appearance class.
+
+
+
+## 0.7.1
+
+Select items can now have a separate select tint color for the left icon.
+
+
+
+## 0.7.0
+
+We have added a subtitle to the section title item and clarified the examples by
+moving action sheets into their own separate classes.

BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Demo.gif


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Goofy Icon.sketch


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Group.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Logo.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Logo.sketch


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Title.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/Resources/Web Icon.sketch


+ 24 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet.podspec

@@ -0,0 +1,24 @@
+# Run `pod lib lint Sheeeeeeeeet.podspec' to ensure this is a valid spec.
+
+Pod::Spec.new do |s|
+  s.name             = 'Sheeeeeeeeet'
+  s.version          = '1.0.1'
+  s.summary          = 'Sheeeeeeeeet is a Swift library for custom iOS action sheets.'
+
+  s.description      = <<-DESC
+Sheeeeeeeeet is a Swift library for adding custom action sheets to your iOS apps.
+It comes with many built-in item action sheet item types, and can be extended by
+custom types are more specific to your app or domain.
+                       DESC
+
+  s.homepage         = 'https://github.com/danielsaidi/Sheeeeeeeeet'
+  s.license          = { :type => 'MIT', :file => 'LICENSE' }
+  s.author           = { 'Daniel Saidi' => 'daniel.saidi@gmail.com' }
+  s.source           = { :git => 'https://github.com/danielsaidi/Sheeeeeeeeet.git', :tag => s.version.to_s }
+  s.social_media_url = 'https://twitter.com/danielsaidi'
+
+  s.ios.deployment_target = '9.0'
+
+  s.source_files = 'Sheeeeeeeeet/**/*.swift'
+  s.resources    = 'Sheeeeeeeeet/**/*.xib'
+end

+ 27 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheet+Presenter.swift

@@ -0,0 +1,27 @@
+//
+//  ActionSheet+Presenter.swift
+//  Sheeeeeeeeet
+//
+//  Created by Daniel Saidi on 2018-04-27.
+//  Copyright © 2018 Daniel Saidi. All rights reserved.
+//
+
+public extension ActionSheet {
+    
+    static var defaultPresenter: ActionSheetPresenter {
+        return UIDevice.current.userInterfaceIdiom.defaultPresenter
+    }
+}
+
+
+// MARK: - Internal Extensions
+
+extension UIUserInterfaceIdiom {
+    
+    var defaultPresenter: ActionSheetPresenter {
+        switch self {
+        case .pad: return ActionSheetPopoverPresenter()
+        default: return ActionSheetStandardPresenter()
+        }
+    }
+}

+ 323 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheet.swift

@@ -0,0 +1,323 @@
+//
+//  ActionSheet.swift
+//  Sheeeeeeeeet
+//
+//  Created by Daniel Saidi on 2017-11-26.
+//  Copyright © 2017 Daniel Saidi. All rights reserved.
+//
+
+/*
+ 
+ This is the main class in the Sheeeeeeeeet library. You can
+ use it to create action sheets and present them in any view
+ controller, from any source view or bar button item.
+ 
+ To create an action sheet, just call the initializer with a
+ list of items and buttons and a block that should be called
+ whenever an item is selected.
+ 
+ 
+ ## Items
+ 
+ You provide an action sheet with a collection of items when
+ you create it. The sheet will automatically split the items
+ into items and buttons. You can also create an action sheet
+ with an empty item collection, then call `setup(items:)` at
+ a later time. This is sometimes required if you must create
+ the action sheet before you can create the items.
+ 
+ 
+ ## Presentation
+ 
+ You can inject a custom presenter if you want to change how
+ the sheet is presented and dismissed. The default presenter
+ for iPhone devices is `ActionSheetStandardPresenter`, while
+ iPad devices get `ActionSheetPopoverPresenter` instead.
+ 
+ 
+ ## Subclassing
+ 
+ `ActionSheet` can be subclassed, which may be nice whenever
+ you want to use your own domain model. For instance, if you
+ want to present a list of `Food` items, you should create a
+ `FoodActionSheet` sheet, then populate it with `Food` items.
+ The selected value will then be of the type `Food`. You can
+ either override the initializers or the `setup` function to
+ change how you populate the sheet with items.
+ 
+ 
+ ## Appearance
+ 
+ Sheeeeeeeeet's action sheet appearance if easily customized.
+ To change the global appearance for every sheet in your app,
+ just modify `ActionSheetAppearance.standard`. To change the
+ appearance of a single action sheet, modify the `appearance`
+ property. To change the appearance of a single item, modify
+ its `customAppearance` property.
+ 
+ 
+ ## Handling item selections
+ 
+ The `selectAction` is triggered when a user taps an item in
+ the action sheet. It provides you with the action sheet and
+ the selected item. It is very important to use `[weak self]`
+ in this block to avoid memory leaks.
+ 
+ 
+ ## Handling item taps
+ 
+ Action sheets receive a call to `handleTap(on:)` every time
+ an item is tapped. You can override it when you create your
+ own action sheet subclasses, but you probably shouldn't.
+ 
+ */
+
+import UIKit
+
+open class ActionSheet: UIViewController {
+    
+    
+    // MARK: - Initialization
+    
+    public init(
+        items: [ActionSheetItem],
+        presenter: ActionSheetPresenter = ActionSheet.defaultPresenter,
+        action: @escaping SelectAction) {
+        self.presenter = presenter
+        selectAction = action
+        super.init(nibName: ActionSheet.className, bundle: Bundle(for: ActionSheet.self))
+        setup(items: items)
+        setup()
+    }
+    
+    public required init?(coder aDecoder: NSCoder) {
+        presenter = ActionSheet.defaultPresenter
+        selectAction = { _, _ in print("itemSelectAction is not set") }
+        super.init(coder: aDecoder)
+        setup()
+    }
+    
+    deinit { print("\(type(of: self)) deinit") }
+    
+    
+    // MARK: - Setup
+    
+    open func setup() {}
+    
+    open func setup(items: [ActionSheetItem]) {
+        self.items = items.filter { !($0 is ActionSheetButton) }
+        buttons = items.compactMap { $0 as? ActionSheetButton }
+        reloadData()
+    }
+    
+    @available(*, deprecated, message: "setupItemsAndButtons(with:) is deprecated. Use setup(items:) instead")
+    open func setupItemsAndButtons(with items: [ActionSheetItem]) {
+        setup(items: items)
+    }
+    
+    
+    // MARK: - View Controller Lifecycle
+    
+    open override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
+        refresh()
+    }
+    
+    
+    // MARK: - Typealiases
+    
+    public typealias SelectAction = (ActionSheet, ActionSheetItem) -> ()
+    
+    
+    // MARK: - Properties
+    
+    open var appearance = ActionSheetAppearance(copy: .standard)
+    
+    public let presenter: ActionSheetPresenter
+
+    public var selectAction: SelectAction
+    
+    @available(*, deprecated, message: "itemSelectAction is deprecated. Use selectAction instead")
+    open var itemSelectAction: SelectAction { return selectAction }
+    
+    
+    // MARK: - Margin Outlets
+    
+    @IBOutlet weak var topMargin: NSLayoutConstraint?
+    @IBOutlet weak var leftMargin: NSLayoutConstraint?
+    @IBOutlet weak var rightMargin: NSLayoutConstraint?
+    @IBOutlet weak var bottomMargin: NSLayoutConstraint?
+    
+    
+    // MARK: - View Outlets
+    
+    @IBOutlet weak var backgroundView: UIView?
+    @IBOutlet weak var stackView: UIStackView?
+    
+    
+    // MARK: - Header Properties
+    
+    open var headerView: UIView? {
+        didSet { refresh() }
+    }
+    
+    @IBOutlet weak var headerViewContainer: UIView? {
+        didSet {
+            headerViewContainer?.backgroundColor = .clear
+            refreshHeaderVisibility()
+        }
+    }
+    
+    @IBOutlet weak var headerViewContainerHeight: NSLayoutConstraint! {
+        didSet { refreshHeaderVisibility() }
+    }
+    
+    
+    // MARK: - Item Properties
+    
+    public var items = [ActionSheetItem]()
+    
+    public var itemsHeight: CGFloat { return totalHeight(for: items) }
+    
+    public lazy var itemHandler = ActionSheetItemHandler(actionSheet: self, itemType: .items)
+    
+    @IBOutlet weak var itemsTableView: UITableView? {
+        didSet { setup(itemsTableView, with: itemHandler) }
+    }
+    
+    @IBOutlet weak var itemsTableViewHeight: NSLayoutConstraint?
+    
+    
+    // MARK: - Button Properties
+    
+    public var buttons = [ActionSheetButton]()
+    
+    public var buttonsHeight: CGFloat { return totalHeight(for: buttons) }
+    
+    public lazy var buttonHandler = ActionSheetItemHandler(actionSheet: self, itemType: .buttons)
+    
+    @IBOutlet weak var buttonsTableView: UITableView? {
+        didSet {
+            setup(buttonsTableView, with: buttonHandler)
+            refreshButtonsVisibility()
+        }
+    }
+    
+    @IBOutlet weak var buttonsTableViewHeight: NSLayoutConstraint? {
+        didSet { refreshButtonsVisibility() }
+    }
+    
+    
+    // MARK: - Presentation Functions
+    
+    open func dismiss(completion: @escaping () -> () = {}) {
+        presenter.dismiss { completion() }
+    }
+
+    open func present(in vc: UIViewController, from view: UIView?, completion: @escaping () -> () = {}) {
+        refresh()
+        presenter.present(sheet: self, in: vc.rootViewController, from: view, completion: completion)
+    }
+
+    open func present(in vc: UIViewController, from barButtonItem: UIBarButtonItem, completion: @escaping () -> () = {}) {
+        refresh()
+        presenter.present(sheet: self, in: vc.rootViewController, from: barButtonItem, completion: completion)
+    }
+
+    
+    // MARK: - Refresh Functions
+    
+    open func refresh() {
+        applyRoundCorners()
+        refreshHeader()
+        refreshItems()
+        refreshButtons()
+        stackView?.spacing = appearance.groupMargins
+        presenter.refreshActionSheet()
+    }
+    
+    open func refreshHeader() {
+        refreshHeaderVisibility()
+        let height = headerView?.frame.height ?? 0
+        headerViewContainerHeight?.constant = height
+        guard let view = headerView else { return }
+        headerViewContainer?.addSubviewToFill(view)
+    }
+    
+    open func refreshHeaderVisibility() {
+        headerViewContainer?.isHidden = headerView == nil
+    }
+    
+    open func refreshItems() {
+        items.forEach { $0.applyAppearance(appearance) }
+        itemsTableView?.separatorColor = appearance.itemsSeparatorColor
+        itemsTableViewHeight?.constant = itemsHeight
+    }
+    
+    open func refreshButtons() {
+        refreshButtonsVisibility()
+        buttons.forEach { $0.applyAppearance(appearance) }
+        buttonsTableView?.separatorColor = appearance.buttonsSeparatorColor
+        buttonsTableViewHeight?.constant = buttonsHeight
+    }
+    
+    open func refreshButtonsVisibility() {
+        buttonsTableView?.isHidden = buttons.count == 0
+    }
+    
+    
+    // MARK: - Protected Functions
+    
+    open func handleTap(on item: ActionSheetItem) {
+        reloadData()
+        guard item.tapBehavior == .dismiss else { return selectAction(self, item) }
+        DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) {
+            self.dismiss { self.selectAction(self, item) }
+        }
+    }
+    
+    open func margin(at margin: ActionSheetMargin) -> CGFloat {
+        let minimum = appearance.contentInset
+        return margin.value(in: view.superview, minimum: minimum)
+    }
+
+    open func reloadData() {
+        itemsTableView?.reloadData()
+        buttonsTableView?.reloadData()
+    }
+}
+
+
+// MARK: - Private Functions
+
+private extension ActionSheet {
+    
+    func applyRoundCorners() {
+        applyRoundCorners(to: headerView)
+        applyRoundCorners(to: headerViewContainer)
+        applyRoundCorners(to: itemsTableView)
+        applyRoundCorners(to: buttonsTableView)
+    }
+
+    func applyRoundCorners(to view: UIView?) {
+        view?.clipsToBounds = true
+        view?.layer.cornerRadius = appearance.cornerRadius
+    }
+    
+    func setup(_ tableView: UITableView?, with handler: ActionSheetItemHandler) {
+        tableView?.delegate = handler
+        tableView?.dataSource = handler
+        tableView?.alwaysBounceVertical = false
+        setupAppearance(for: tableView)
+    }
+    
+    func setupAppearance(for tableView: UITableView?) {
+        tableView?.estimatedRowHeight = 44
+        tableView?.rowHeight = UITableView.automaticDimension
+        tableView?.cellLayoutMarginsFollowReadableWidth = false
+    }
+    
+    func totalHeight(for items: [ActionSheetItem]) -> CGFloat {
+        return items.reduce(0) { $0 + $1.appearance.height }
+    }
+}

+ 81 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheet.xib

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ActionSheet" customModule="Sheeeeeeeeet" customModuleProvider="target">
+            <connections>
+                <outlet property="backgroundView" destination="SY3-WL-g9a" id="kJl-sr-KSn"/>
+                <outlet property="bottomMargin" destination="0Ng-wM-pDU" id="e9x-Tl-lhM"/>
+                <outlet property="buttonsTableView" destination="4ww-lg-Kl7" id="ybX-2I-Py8"/>
+                <outlet property="buttonsTableViewHeight" destination="3xB-Am-CuT" id="irJ-Cj-nU5"/>
+                <outlet property="headerViewContainer" destination="Eio-5P-omJ" id="igG-tq-9G0"/>
+                <outlet property="headerViewContainerHeight" destination="ZKw-6e-7h3" id="Npd-by-wqQ"/>
+                <outlet property="itemsTableView" destination="iQT-dy-e7d" id="qVi-cs-nm6"/>
+                <outlet property="itemsTableViewHeight" destination="929-kf-L2B" id="Vn3-T3-wVr"/>
+                <outlet property="leftMargin" destination="am1-ek-BBj" id="Ixg-NB-46W"/>
+                <outlet property="rightMargin" destination="yS1-hl-lMK" id="Ztc-IM-42Q"/>
+                <outlet property="stackView" destination="a3t-st-aTv" id="JPA-a6-5tl"/>
+                <outlet property="topMargin" destination="HAP-aL-Tfx" id="Okk-TN-tDs"/>
+                <outlet property="view" destination="iN0-l3-epB" id="gl1-H2-KFe"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SY3-WL-g9a">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                    <color key="backgroundColor" white="0.0" alpha="0.40000000000000002" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                </view>
+                <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="a3t-st-aTv">
+                    <rect key="frame" x="0.0" y="277" width="375" height="390"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Eio-5P-omJ">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="150"/>
+                            <color key="backgroundColor" red="0.45104343879999997" green="1" blue="0.29922929650000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="150" id="ZKw-6e-7h3"/>
+                            </constraints>
+                        </view>
+                        <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="iQT-dy-e7d">
+                            <rect key="frame" x="0.0" y="170" width="375" height="100"/>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="height" priority="900" constant="100" id="929-kf-L2B"/>
+                            </constraints>
+                        </tableView>
+                        <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="4ww-lg-Kl7">
+                            <rect key="frame" x="0.0" y="290" width="375" height="100"/>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="100" id="3xB-Am-CuT"/>
+                            </constraints>
+                        </tableView>
+                    </subviews>
+                </stackView>
+            </subviews>
+            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <constraints>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="a3t-st-aTv" secondAttribute="bottom" id="0Ng-wM-pDU"/>
+                <constraint firstItem="a3t-st-aTv" firstAttribute="top" relation="greaterThanOrEqual" secondItem="vUN-kp-3ea" secondAttribute="top" id="HAP-aL-Tfx"/>
+                <constraint firstItem="SY3-WL-g9a" firstAttribute="bottom" secondItem="iN0-l3-epB" secondAttribute="bottom" id="QPw-j7-ds4"/>
+                <constraint firstItem="SY3-WL-g9a" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Qkx-K8-ysN"/>
+                <constraint firstItem="a3t-st-aTv" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="am1-ek-BBj"/>
+                <constraint firstItem="SY3-WL-g9a" firstAttribute="trailing" secondItem="iN0-l3-epB" secondAttribute="trailing" id="it1-TY-fQG"/>
+                <constraint firstItem="SY3-WL-g9a" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="txK-fC-hst"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="a3t-st-aTv" secondAttribute="trailing" id="yS1-hl-lMK"/>
+            </constraints>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <point key="canvasLocation" x="55.200000000000003" y="48.125937031484263"/>
+        </view>
+    </objects>
+</document>

+ 13 - 11
Libraries external/Sheeeeeeeeet/ActionSheet/ActionSheetItemHandler.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheetItemHandler.swift

@@ -13,7 +13,7 @@ open class ActionSheetItemHandler: NSObject {
     
     
     // MARK: - Initialization
     // MARK: - Initialization
     
     
-    init(actionSheet: ActionSheet, handles itemType: ItemType) {
+    public init(actionSheet: ActionSheet, itemType: ItemType) {
         self.actionSheet = actionSheet
         self.actionSheet = actionSheet
         self.itemType = itemType
         self.itemType = itemType
     }
     }
@@ -30,9 +30,9 @@ open class ActionSheetItemHandler: NSObject {
     
     
     private weak var actionSheet: ActionSheet?
     private weak var actionSheet: ActionSheet?
     
     
-    private var itemType: ItemType
+    let itemType: ItemType
     
     
-    private var items: [ActionSheetItem] {
+    var items: [ActionSheetItem] {
         switch itemType {
         switch itemType {
         case .buttons: return actionSheet?.buttons ?? []
         case .buttons: return actionSheet?.buttons ?? []
         case .items: return actionSheet?.items ?? []
         case .items: return actionSheet?.items ?? []
@@ -45,7 +45,9 @@ open class ActionSheetItemHandler: NSObject {
 
 
 extension ActionSheetItemHandler: UITableViewDataSource {
 extension ActionSheetItemHandler: UITableViewDataSource {
     
     
-    public func item(at indexPath: IndexPath) -> ActionSheetItem {
+    public func item(at indexPath: IndexPath) -> ActionSheetItem? {
+        guard indexPath.section == 0 else { return nil }
+        guard items.count > indexPath.row else { return nil }
         return items[indexPath.row]
         return items[indexPath.row]
     }
     }
     
     
@@ -58,11 +60,13 @@ extension ActionSheetItemHandler: UITableViewDataSource {
     }
     }
     
     
     public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
     public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        return item(at: indexPath).cell(for: tableView)
+        guard let item = self.item(at: indexPath) else { return UITableViewCell(frame: .zero) }
+        return item.cell(for: tableView)
     }
     }
     
     
     public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
     public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return CGFloat(item(at: indexPath).appearance.height)
+        guard let item = self.item(at: indexPath) else { return 0 }
+        return CGFloat(item.appearance.height)
     }
     }
 }
 }
 
 
@@ -72,12 +76,10 @@ extension ActionSheetItemHandler: UITableViewDataSource {
 extension ActionSheetItemHandler: UITableViewDelegate {
 extension ActionSheetItemHandler: UITableViewDelegate {
     
     
     public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
     public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        guard items.count > indexPath.row else { return }
-        let item = self.item(at: indexPath)
-        let cell = tableView.cellForRow(at: indexPath)
+        guard let item = self.item(at: indexPath) else { return }
         tableView.deselectRow(at: indexPath, animated: true)
         tableView.deselectRow(at: indexPath, animated: true)
         guard let sheet = actionSheet else { return }
         guard let sheet = actionSheet else { return }
-        item.handleTap(in: sheet, cell: cell)
-        sheet.itemTapAction(item)
+        item.handleTap(in: sheet)
+        sheet.handleTap(on: item)
     }
     }
 }
 }

+ 0 - 0
Libraries external/Sheeeeeeeeet/ActionSheet/ActionSheetMargin.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/ActionSheet/ActionSheetMargin.swift


+ 6 - 6
Libraries external/Sheeeeeeeeet/Appearance/ActionSheetAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/ActionSheetAppearance.swift

@@ -31,13 +31,14 @@ open class ActionSheetAppearance {
     public init(copy: ActionSheetAppearance) {
     public init(copy: ActionSheetAppearance) {
         cornerRadius = copy.cornerRadius
         cornerRadius = copy.cornerRadius
         contentInset = copy.contentInset
         contentInset = copy.contentInset
+        groupMargins = copy.groupMargins
         
         
         separatorColor = copy.separatorColor
         separatorColor = copy.separatorColor
         itemsSeparatorColor = copy.itemsSeparatorColor ?? separatorColor
         itemsSeparatorColor = copy.itemsSeparatorColor ?? separatorColor
         buttonsSeparatorColor = copy.buttonsSeparatorColor ?? separatorColor
         buttonsSeparatorColor = copy.buttonsSeparatorColor ?? separatorColor
         
         
         item = ActionSheetItemAppearance(copy: copy.item)
         item = ActionSheetItemAppearance(copy: copy.item)
-        popover = ActionSheetPopoverApperance(copy: copy.popover)
+        popover = ActionSheetPopoverAppearance(copy: copy.popover)
         
         
         cancelButton = ActionSheetCancelButtonAppearance(copy: copy.cancelButton)
         cancelButton = ActionSheetCancelButtonAppearance(copy: copy.cancelButton)
         dangerButton = ActionSheetDangerButtonAppearance(copy: copy.dangerButton)
         dangerButton = ActionSheetDangerButtonAppearance(copy: copy.dangerButton)
@@ -61,6 +62,7 @@ open class ActionSheetAppearance {
     
     
     public var cornerRadius: CGFloat = 10
     public var cornerRadius: CGFloat = 10
     public var contentInset: CGFloat = 15
     public var contentInset: CGFloat = 15
+    public var groupMargins: CGFloat = 15
     
     
     public var separatorColor: UIColor?
     public var separatorColor: UIColor?
     public var itemsSeparatorColor: UIColor?
     public var itemsSeparatorColor: UIColor?
@@ -75,8 +77,8 @@ open class ActionSheetAppearance {
         return ActionSheetItemAppearance()
         return ActionSheetItemAppearance()
     }()
     }()
     
     
-    public lazy var popover: ActionSheetPopoverApperance = {
-        return ActionSheetPopoverApperance(width: 300)
+    public lazy var popover: ActionSheetPopoverAppearance = {
+        return ActionSheetPopoverAppearance(width: 300)
     }()
     }()
     
     
     
     
@@ -87,9 +89,7 @@ open class ActionSheetAppearance {
     }()
     }()
     
     
     public lazy var dangerButton: ActionSheetDangerButtonAppearance = {
     public lazy var dangerButton: ActionSheetDangerButtonAppearance = {
-        let appearance = ActionSheetDangerButtonAppearance(copy: item)
-        appearance.textColor = .red
-        return appearance
+        return ActionSheetDangerButtonAppearance(copy: item)
     }()
     }()
     
     
     public lazy var okButton: ActionSheetOkButtonAppearance = {
     public lazy var okButton: ActionSheetOkButtonAppearance = {

+ 1 - 1
Libraries external/Sheeeeeeeeet/Appearance/ActionSheetItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/ActionSheetItemAppearance.swift

@@ -45,7 +45,7 @@ open class ActionSheetItemAppearance {
 public extension ActionSheetItemAppearance {
 public extension ActionSheetItemAppearance {
     
     
     public static var noSeparator: UIEdgeInsets {
     public static var noSeparator: UIEdgeInsets {
-        return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: UIScreen.main.bounds.width)
+        return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 100_000)
     }
     }
     
     
     public func hideSeparator() {
     public func hideSeparator() {

+ 3 - 3
Libraries external/Sheeeeeeeeet/Appearance/ActionSheetPopoverApperance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/ActionSheetPopoverAppearance.swift

@@ -1,5 +1,5 @@
 //
 //
-//  ActionSheetPopoverApperance.swift
+//  ActionSheetPopoverAppearance.swift
 //  Sheeeeeeeeet
 //  Sheeeeeeeeet
 //
 //
 //  Created by Daniel Saidi on 2017-11-24.
 //  Created by Daniel Saidi on 2017-11-24.
@@ -8,7 +8,7 @@
 
 
 import UIKit
 import UIKit
 
 
-open class ActionSheetPopoverApperance {
+open class ActionSheetPopoverAppearance {
     
     
     
     
     // MARK: - Initialization
     // MARK: - Initialization
@@ -17,7 +17,7 @@ open class ActionSheetPopoverApperance {
         self.width = width
         self.width = width
     }
     }
     
     
-    public init(copy: ActionSheetPopoverApperance) {
+    public init(copy: ActionSheetPopoverAppearance) {
         self.width = copy.width
         self.width = copy.width
     }
     }
     
     

+ 1 - 1
Libraries external/Sheeeeeeeeet/Appearance/Buttons/ActionSheetButtonItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetButtonAppearance.swift

@@ -1,5 +1,5 @@
 //
 //
-//  ActionSheetButtonItemAppearance.swift
+//  ActionSheetButtonAppearance.swift
 //  Sheeeeeeeeet
 //  Sheeeeeeeeet
 //
 //
 //  Created by Daniel Saidi on 2017-11-24.
 //  Created by Daniel Saidi on 2017-11-24.

+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Buttons/ActionSheetCancelButtonAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetCancelButtonAppearance.swift


+ 12 - 1
Libraries external/Sheeeeeeeeet/Appearance/Buttons/ActionSheetDangerButtonAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetDangerButtonAppearance.swift

@@ -8,4 +8,15 @@
 
 
 import UIKit
 import UIKit
 
 
-open class ActionSheetDangerButtonAppearance: ActionSheetButtonAppearance {}
+open class ActionSheetDangerButtonAppearance: ActionSheetButtonAppearance {
+    
+    public override init() {
+        super.init()
+        textColor = .red
+    }
+    
+    public override init(copy: ActionSheetItemAppearance) {
+        super.init(copy: copy)
+        textColor = .red
+    }
+}

+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Buttons/ActionSheetOkButtonAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Buttons/ActionSheetOkButtonAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetCollectionItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetCollectionItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetCustomItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetCustomItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetLinkItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetLinkItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetMultiSelectItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetMultiSelectItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetMultiSelectToggleItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetMultiSelectToggleItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetSelectItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetSelectItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Items/ActionSheetSingleSelectItemAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Items/ActionSheetSingleSelectItemAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Titles/ActionSheetSectionMarginAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Titles/ActionSheetSectionMarginAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Titles/ActionSheetSectionTitleAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Titles/ActionSheetSectionTitleAppearance.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Appearance/Titles/ActionSheetTitleAppearance.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Appearance/Titles/ActionSheetTitleAppearance.swift


+ 4 - 0
Libraries external/Sheeeeeeeeet/Extensions/NSObject+ClassName.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/NSObject+ClassName.swift

@@ -13,4 +13,8 @@ extension NSObject {
     static var className: String {
     static var className: String {
         return String(describing: self)
         return String(describing: self)
     }
     }
+    
+    var className: String {
+        return type(of: self).className
+    }
 }
 }

+ 16 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/UIView+Nib.swift

@@ -0,0 +1,16 @@
+//
+//  UIView+Nib.swift
+//  Sheeeeeeeeet
+//
+//  Created by Daniel Saidi on 2018-10-17.
+//  Copyright © 2018 Daniel Saidi. All rights reserved.
+//
+
+import UIKit
+
+extension UIView {
+    
+    static var defaultNib: UINib {
+        return UINib(nibName: className, bundle: Bundle(for: self))
+    }
+}

+ 21 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/UIView+Subviews.swift

@@ -0,0 +1,21 @@
+//
+//  UIView+Subviews.swift
+//  Sheeeeeeeeet
+//
+//  Created by Daniel Saidi on 2018-10-17.
+//  Copyright © 2018 Daniel Saidi. All rights reserved.
+//
+
+import UIKit
+
+extension UIView {
+    
+    func addSubviewToFill(_ subview: UIView) {
+        subview.translatesAutoresizingMaskIntoConstraints = false
+        addSubview(subview)
+        subview.topAnchor.constraint(equalTo: topAnchor).isActive = true
+        subview.leftAnchor.constraint(equalTo: leftAnchor).isActive = true
+        subview.rightAnchor.constraint(equalTo: rightAnchor).isActive = true
+        subview.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
+    }
+}

+ 1 - 2
Libraries external/Sheeeeeeeeet/Extensions/UIViewController+RootViewController.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Extensions/UIViewController+RootViewController.swift

@@ -11,7 +11,6 @@ import UIKit
 extension UIViewController {
 extension UIViewController {
 
 
     var rootViewController: UIViewController {
     var rootViewController: UIViewController {
-        guard let parent = self.parent else { return self }
-        return parent.rootViewController
+        return parent?.rootViewController ?? self
     }
     }
 }
 }

+ 24 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Info.plist

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0.1</string>
+	<key>CFBundleVersion</key>
+	<string>1.0.1</string>
+	<key>NSPrincipalClass</key>
+	<string></string>
+</dict>
+</plist>

+ 20 - 26
Libraries external/Sheeeeeeeeet/Items/ActionSheetItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/ActionSheetItem.swift

@@ -10,17 +10,18 @@
  
  
  This class represents a regular action sheet item, like the
  This class represents a regular action sheet item, like the
  ones used in UIAlertController. It has a title, an optional
  ones used in UIAlertController. It has a title, an optional
- value and an optional image. All other item classes inherit
- this class.
+ value and an optional image. All other items builds on this.
  
  
  The default tap behavior of action sheet items is "dismiss",
  The default tap behavior of action sheet items is "dismiss",
- which means that the action sheet is told that the item was
- tapped and is then dismissed. If you don't want the item to
- dismiss the action sheet, set `tapBehavior` to `.none`.
+ which means that the action sheet will dismiss itself after
+ handling the item tap. Set `tapBehavior` to `.none`, if you
+ don't want the action sheet to be dismissed when an item is
+ tapped. Some item types uses `.none` by default.
  
  
- An action sheet item's appearance is set by the sheet, when
- it is presented. To use custom appearances for single items,
- just modify the item's `appearance` property.
+ The item appearance is set by the sheet. It either uses the
+ global appearance or an individual instance. To use a fully
+ custom appearances for a single action sheet item, just set
+ the `customAppearance` property.
  
  
  */
  */
 
 
@@ -50,10 +51,6 @@ open class ActionSheetItem: NSObject {
     
     
     // MARK: - Enums
     // MARK: - Enums
     
     
-    public enum ItemType {
-        case item, button, title
-    }
-    
     public enum TapBehavior {
     public enum TapBehavior {
         case dismiss, none
         case dismiss, none
     }
     }
@@ -61,19 +58,16 @@ open class ActionSheetItem: NSObject {
 
 
     // MARK: - Properties
     // MARK: - Properties
     
     
-    public var cellReuseIdentifier: String { return className }
-    public var className: String { return type(of: self).className }
-    open var itemType: ItemType { return .item }
+    public internal(set) var appearance: ActionSheetItemAppearance
+    public var image: UIImage?
+    public var subtitle: String?
+    public var tapBehavior: TapBehavior
+    public var title: String
+    public var value: Any?
     
     
-    open var image: UIImage?
-    open var subtitle: String?
-    open var title: String
-    open var value: Any?
-
-    open var appearance: ActionSheetItemAppearance
-    open var cellStyle: UITableViewCell.CellStyle = .default
-    open var customAppearance: ActionSheetItemAppearance?
-    open var tapBehavior: TapBehavior
+    public var cellReuseIdentifier: String { return className }
+    public var cellStyle: UITableViewCell.CellStyle = .default
+    public var customAppearance: ActionSheetItemAppearance?
     
     
     
     
     // MARK: - Functions
     // MARK: - Functions
@@ -87,10 +81,10 @@ open class ActionSheetItem: NSObject {
             cell.backgroundColor = color
             cell.backgroundColor = color
         }
         }
         cell.imageView?.image = image
         cell.imageView?.image = image
-        cell.textLabel?.text = title
         cell.selectionStyle = .default
         cell.selectionStyle = .default
         cell.separatorInset = appearance.separatorInsets
         cell.separatorInset = appearance.separatorInsets
         cell.tintColor = appearance.tintColor
         cell.tintColor = appearance.tintColor
+        cell.textLabel?.text = title
         cell.textLabel?.textAlignment = .left
         cell.textLabel?.textAlignment = .left
         cell.textLabel?.textColor = appearance.textColor
         cell.textLabel?.textColor = appearance.textColor
         cell.textLabel?.font = appearance.font
         cell.textLabel?.font = appearance.font
@@ -107,5 +101,5 @@ open class ActionSheetItem: NSObject {
         return cell
         return cell
     }
     }
     
     
-    open func handleTap(in actionSheet: ActionSheet, cell: UITableViewCell? = nil) {}
+    open func handleTap(in actionSheet: ActionSheet) {}
 }
 }

+ 25 - 5
Libraries external/Sheeeeeeeeet/Items/Buttons/ActionSheetButton.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetButton.swift

@@ -10,7 +10,7 @@
  
  
  This class is a base class for all action sheet buttons. It
  This class is a base class for all action sheet buttons. It
  is not intended to be used directly. Instead, use the built
  is not intended to be used directly. Instead, use the built
- in buttons or subclass this class to create your own button.
+ in buttons or subclass it to create your own button type.
  
  
  */
  */
 
 
@@ -21,20 +21,26 @@ open class ActionSheetButton: ActionSheetItem {
     
     
     // MARK: - Initialization
     // MARK: - Initialization
     
     
-    public init(title: String, value: Bool?) {
+    public init(title: String, value: Any?) {
         super.init(title: title, value: value)
         super.init(title: title, value: value)
     }
     }
     
     
+    public init(title: String, type: ButtonType) {
+        super.init(title: title, value: type)
+    }
+    
     
     
-    // MARK: - Properties
+    // MARK: - Values
     
     
-    open override var itemType: ItemType { return .button }
+    public enum ButtonType {
+        case ok, cancel
+    }
     
     
     
     
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
-        self.appearance = ActionSheetButtonAppearance(copy: appearance.okButton)
+        self.appearance = customAppearance ?? ActionSheetButtonAppearance(copy: appearance.okButton)
     }
     }
     
     
     open override func applyAppearance(to cell: UITableViewCell) {
     open override func applyAppearance(to cell: UITableViewCell) {
@@ -42,3 +48,17 @@ open class ActionSheetButton: ActionSheetItem {
         cell.textLabel?.textAlignment = .center
         cell.textLabel?.textAlignment = .center
     }
     }
 }
 }
+
+
+// MARK: - ActionSheetItem Extensions
+
+public extension ActionSheetItem {
+    
+    var isOkButton: Bool {
+        return value as? ActionSheetButton.ButtonType == .ok
+    }
+    
+    var isCancelButton: Bool {
+        return value as? ActionSheetButton.ButtonType == .cancel
+    }
+}

+ 4 - 3
Libraries external/Sheeeeeeeeet/Items/Buttons/ActionSheetCancelButton.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetCancelButton.swift

@@ -10,7 +10,8 @@
  
  
  Cancel buttons have no special behavior, but can be used in
  Cancel buttons have no special behavior, but can be used in
  sheets where a user applies changes by tapping an OK button.
  sheets where a user applies changes by tapping an OK button.
- The default cancel button value is `nil`.
+ 
+ The value of a cancel button is `ButtonType.cancel`.
  
  
  */
  */
 
 
@@ -22,13 +23,13 @@ open class ActionSheetCancelButton: ActionSheetButton {
     // MARK: - Initialization
     // MARK: - Initialization
     
     
     public init(title: String) {
     public init(title: String) {
-        super.init(title: title, value: nil)
+        super.init(title: title, type: .cancel)
     }
     }
     
     
     
     
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
-        self.appearance = ActionSheetCancelButtonAppearance(copy: appearance.cancelButton)
+        self.appearance = customAppearance ?? ActionSheetCancelButtonAppearance(copy: appearance.cancelButton)
     }
     }
 }
 }

+ 4 - 10
Libraries external/Sheeeeeeeeet/Items/Buttons/ActionSheetDangerButton.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetDangerButton.swift

@@ -10,26 +10,20 @@
  
  
  Danger buttons have no special behavior, but can be used to
  Danger buttons have no special behavior, but can be used to
  indicate that the effect of the action sheet is destructive.
  indicate that the effect of the action sheet is destructive.
+ They are basically just OK buttons with a "red alert" style.
  
  
- The value of a danger button is `true` by default.
+ The value of a danger button is `ButtonType.ok`.
  
  
  */
  */
 
 
 import UIKit
 import UIKit
 
 
-open class ActionSheetDangerButton: ActionSheetButton {
-    
-    
-    // MARK: - Initialization
-    
-    public init(title: String) {
-        super.init(title: title, value: true)
-    }
+open class ActionSheetDangerButton: ActionSheetOkButton {
     
     
     
     
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
-        self.appearance = ActionSheetDangerButtonAppearance(copy: appearance.dangerButton)
+        self.appearance = customAppearance ?? ActionSheetDangerButtonAppearance(copy: appearance.dangerButton)
     }
     }
 }
 }

+ 3 - 3
Libraries external/Sheeeeeeeeet/Items/Buttons/ActionSheetOkButton.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Buttons/ActionSheetOkButton.swift

@@ -11,7 +11,7 @@
  OK buttons have no special behavior, but can be used when a
  OK buttons have no special behavior, but can be used when a
  user should apply action sheet changes by tapping an button.
  user should apply action sheet changes by tapping an button.
  
  
- The value of an OK button is `true` by default.
+ The value of an OK button is `ButtonType.ok`.
  
  
  */
  */
 
 
@@ -23,13 +23,13 @@ open class ActionSheetOkButton: ActionSheetButton {
     // MARK: - Initialization
     // MARK: - Initialization
     
     
     public init(title: String) {
     public init(title: String) {
-        super.init(title: title, value: true)
+        super.init(title: title, type: .ok)
     }
     }
     
     
     
     
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
-        self.appearance = ActionSheetOkButtonAppearance(copy: appearance.okButton)
+        self.appearance = customAppearance ?? ActionSheetOkButtonAppearance(copy: appearance.okButton)
     }
     }
 }
 }

+ 3 - 4
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetCollectionItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetCollectionItem.swift

@@ -72,10 +72,9 @@ open class ActionSheetCollectionItem<T>: ActionSheetItem, UICollectionViewDataSo
     }
     }
     
     
     open func extendSelectionAction(toReload actionSheet: ActionSheet) {
     open func extendSelectionAction(toReload actionSheet: ActionSheet) {
-        weak var sheet = actionSheet
-        extendSelectionAction(with: { _, _ in
-            sheet?.reloadData()
-        })
+        extendSelectionAction { _, _ in
+            actionSheet.reloadData()
+        }
     }
     }
     
     
     open func extendSelectionAction(with action: @escaping CellAction) {
     open func extendSelectionAction(with action: @escaping CellAction) {

+ 0 - 0
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetCustomItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetCustomItem.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetLinkItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetLinkItem.swift


+ 2 - 2
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetMultiSelectItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetMultiSelectItem.swift

@@ -53,8 +53,8 @@ open class ActionSheetMultiSelectItem: ActionSheetSelectItem {
         self.appearance = ActionSheetMultiSelectItemAppearance(copy: appearance.multiSelectItem)
         self.appearance = ActionSheetMultiSelectItemAppearance(copy: appearance.multiSelectItem)
     }
     }
     
     
-    open override func handleTap(in actionSheet: ActionSheet, cell: UITableViewCell? = nil) {
-        super.handleTap(in: actionSheet, cell: cell)
+    open override func handleTap(in actionSheet: ActionSheet) {
+        super.handleTap(in: actionSheet)
         let toggleItems = actionSheet.items.compactMap { $0 as? ActionSheetMultiSelectToggleItem }
         let toggleItems = actionSheet.items.compactMap { $0 as? ActionSheetMultiSelectToggleItem }
         let items = toggleItems.filter { $0.group == group }
         let items = toggleItems.filter { $0.group == group }
         items.forEach { $0.updateState(for: actionSheet) }
         items.forEach { $0.updateState(for: actionSheet) }

+ 1 - 1
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetMultiSelectToggleItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetMultiSelectToggleItem.swift

@@ -69,7 +69,7 @@ open class ActionSheetMultiSelectToggleItem: ActionSheetItem {
         super.applyAppearance(to: cell)
         super.applyAppearance(to: cell)
     }
     }
     
     
-    open override func handleTap(in actionSheet: ActionSheet, cell: UITableViewCell? = nil) {
+    open override func handleTap(in actionSheet: ActionSheet) {
         super.handleTap(in: actionSheet)
         super.handleTap(in: actionSheet)
         let selectItems = actionSheet.items.compactMap { $0 as? ActionSheetMultiSelectItem }
         let selectItems = actionSheet.items.compactMap { $0 as? ActionSheetMultiSelectItem }
         let items = selectItems.filter { $0.group == group }
         let items = selectItems.filter { $0.group == group }

+ 3 - 3
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetSelectItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetSelectItem.swift

@@ -31,7 +31,7 @@ open class ActionSheetSelectItem: ActionSheetItem {
     
     
     // MARK: - Initialization
     // MARK: - Initialization
     
     
-    init(
+    public init(
         title: String,
         title: String,
         isSelected: Bool,
         isSelected: Bool,
         group: String = "",
         group: String = "",
@@ -75,8 +75,8 @@ open class ActionSheetSelectItem: ActionSheetItem {
         cell.textLabel?.textColor = isSelected ? appearance.selectedTextColor : appearance.textColor
         cell.textLabel?.textColor = isSelected ? appearance.selectedTextColor : appearance.textColor
     }
     }
     
     
-    open override func handleTap(in actionSheet: ActionSheet, cell: UITableViewCell? = nil) {
-        super.handleTap(in: actionSheet, cell: cell)
+    open override func handleTap(in actionSheet: ActionSheet) {
+        super.handleTap(in: actionSheet)
         isSelected = !isSelected
         isSelected = !isSelected
     }
     }
 }
 }

+ 2 - 19
Libraries external/Sheeeeeeeeet/Items/Items/ActionSheetSingleSelectItem.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Items/ActionSheetSingleSelectItem.swift

@@ -23,23 +23,6 @@ import UIKit
 open class ActionSheetSingleSelectItem: ActionSheetSelectItem {
 open class ActionSheetSingleSelectItem: ActionSheetSelectItem {
     
     
     
     
-    // MARK: - Initialization
-    
-    public init(
-        title: String,
-        isSelected: Bool,
-        group: String = "",
-        value: Any? = nil,
-        image: UIImage? = nil) {
-        super.init(
-            title: title,
-            isSelected: isSelected,
-            group: group,
-            value: value,
-            image: image)
-    }
-    
-    
      // MARK: - Functions
      // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
@@ -47,8 +30,8 @@ open class ActionSheetSingleSelectItem: ActionSheetSelectItem {
         self.appearance = ActionSheetSingleSelectItemAppearance(copy: appearance.singleSelectItem)
         self.appearance = ActionSheetSingleSelectItemAppearance(copy: appearance.singleSelectItem)
     }
     }
     
     
-    open override func handleTap(in actionSheet: ActionSheet, cell: UITableViewCell? = nil) {
-        super.handleTap(in: actionSheet, cell: cell)
+    open override func handleTap(in actionSheet: ActionSheet) {
+        super.handleTap(in: actionSheet)
         let items = actionSheet.items.compactMap { $0 as? ActionSheetSingleSelectItem }
         let items = actionSheet.items.compactMap { $0 as? ActionSheetSingleSelectItem }
         let deselectItems = items.filter { $0.group == group }
         let deselectItems = items.filter { $0.group == group }
         deselectItems.forEach { $0.isSelected = false }
         deselectItems.forEach { $0.isSelected = false }

+ 0 - 5
Libraries external/Sheeeeeeeeet/Items/Titles/ActionSheetSectionMargin.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Titles/ActionSheetSectionMargin.swift

@@ -26,11 +26,6 @@ open class ActionSheetSectionMargin: ActionSheetItem {
     }
     }
     
     
     
     
-    // MARK: - Properties
-    
-    open override var itemType: ItemType { return .title }
-    
-    
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {

+ 0 - 5
Libraries external/Sheeeeeeeeet/Items/Titles/ActionSheetSectionTitle.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Titles/ActionSheetSectionTitle.swift

@@ -31,11 +31,6 @@ open class ActionSheetSectionTitle: ActionSheetItem {
     }
     }
     
     
     
     
-    // MARK: - Properties
-    
-    open override var itemType: ItemType { return .title }
-    
-    
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {

+ 0 - 5
Libraries external/Sheeeeeeeeet/Items/Titles/ActionSheetTitle.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Items/Titles/ActionSheetTitle.swift

@@ -26,11 +26,6 @@ open class ActionSheetTitle: ActionSheetItem {
     }
     }
     
     
     
     
-    // MARK: - Properties
-    
-    open override var itemType: ItemType { return .title }
-    
-    
     // MARK: - Functions
     // MARK: - Functions
     
     
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {
     open override func applyAppearance(_ appearance: ActionSheetAppearance) {

+ 38 - 27
Libraries external/Sheeeeeeeeet/Presenters/ActionSheetPopoverPresenter.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Presenters/ActionSheetPopoverPresenter.swift

@@ -9,13 +9,12 @@
 /*
 /*
  
  
  This presenter will present action sheets as popovers, just
  This presenter will present action sheets as popovers, just
- as regular UIAlertControllers are displayed on the iPad. It
- should only be used when a sheet is displayed on an iPad.
+ as a regular UIAlertController is displayed on the iPad.
  
  
  Since popovers have an arrow that should use the same color
  Since popovers have an arrow that should use the same color
  as the rest of the popover view, this presenter will remove
  as the rest of the popover view, this presenter will remove
- any header view as well as combine items and buttons into a
- single section.
+ any header view and combine items and buttons into a single
+ item section.
  
  
  */
  */
 
 
@@ -31,13 +30,10 @@ open class ActionSheetPopoverPresenter: NSObject, ActionSheetPresenter {
     
     
     // MARK: - Properties
     // MARK: - Properties
     
     
-    open var availablePresentationSize: CGSize { return popover?.frameOfPresentedViewInContainerView.size ?? .zero }
     open var events = ActionSheetPresenterEvents()
     open var events = ActionSheetPresenterEvents()
     open var isDismissableWithTapOnBackground = true
     open var isDismissableWithTapOnBackground = true
     
     
     private var actionSheet: ActionSheet?
     private var actionSheet: ActionSheet?
-    private var actionSheetView: UIView?
-    private var backgroundView: UIView?
     private weak var popover: UIPopoverPresentationController?
     private weak var popover: UIPopoverPresentationController?
     
     
     
     
@@ -49,22 +45,36 @@ open class ActionSheetPopoverPresenter: NSObject, ActionSheetPresenter {
         vc?.dismiss(animated: true) { dismissAction() } ?? dismissAction()
         vc?.dismiss(animated: true) { dismissAction() } ?? dismissAction()
     }
     }
     
     
-    open func present(sheet: ActionSheet, in vc: UIViewController, from view: UIView?) {
+    open func present(sheet: ActionSheet, in vc: UIViewController, from view: UIView?, completion: @escaping () -> ()) {
+        setupSheetForPresentation(sheet)
         popover = self.popover(for: sheet, in: vc)
         popover = self.popover(for: sheet, in: vc)
         popover?.sourceView = view
         popover?.sourceView = view
         popover?.sourceRect = view?.bounds ?? CGRect()
         popover?.sourceRect = view?.bounds ?? CGRect()
-        popover?.delegate = self
-        vc.present(sheet, animated: true, completion: nil)
+        vc.present(sheet, animated: true, completion: completion)
     }
     }
     
     
-    open func present(sheet: ActionSheet, in vc: UIViewController, from item: UIBarButtonItem) {
+    open func present(sheet: ActionSheet, in vc: UIViewController, from item: UIBarButtonItem, completion: @escaping () -> ()) {
+        setupSheetForPresentation(sheet)
         popover = self.popover(for: sheet, in: vc)
         popover = self.popover(for: sheet, in: vc)
         popover?.barButtonItem = item
         popover?.barButtonItem = item
-        vc.present(sheet, animated: true, completion: nil)
+        vc.present(sheet, animated: true, completion: completion)
     }
     }
     
     
-    public func presentationFrame(for sheet: ActionSheet, in view: UIView) -> CGRect? {
-        return nil
+    open func refreshActionSheet() {
+        guard let sheet = actionSheet else { return }
+        sheet.headerViewContainer?.isHidden = true
+        sheet.buttonsTableView?.isHidden = true
+        refreshPopoverAppearance(for: sheet)
+    }
+    
+    
+    // MARK: - Protected Functions
+    
+    open func refreshPopoverAppearance(for sheet: ActionSheet) {
+        let width = sheet.appearance.popover.width
+        let height = sheet.itemsHeight
+        sheet.preferredContentSize = CGSize(width: width, height: height)
+        popover?.backgroundColor = sheet.itemsTableView?.backgroundColor
     }
     }
 }
 }
 
 
@@ -82,31 +92,32 @@ extension ActionSheetPopoverPresenter: UIPopoverPresentationControllerDelegate {
 }
 }
 
 
 
 
-// MARK: - Private Functions
+// MARK: - Internal Functions
 
 
-private extension ActionSheetPopoverPresenter {
+extension ActionSheetPopoverPresenter {
     
     
     func popover(for sheet: ActionSheet, in vc: UIViewController) -> UIPopoverPresentationController? {
     func popover(for sheet: ActionSheet, in vc: UIViewController) -> UIPopoverPresentationController? {
-        guard sheet.contentHeight > 0 else { return nil }
-        setupSheetForPresentation(sheet)
         sheet.modalPresentationStyle = .popover
         sheet.modalPresentationStyle = .popover
         let popover = sheet.popoverPresentationController
         let popover = sheet.popoverPresentationController
-        popover?.backgroundColor = sheet.view.backgroundColor
-        popover?.delegate = vc as? UIPopoverPresentationControllerDelegate
+        popover?.delegate = self
         return popover
         return popover
     }
     }
     
     
-    func popoverItems(for sheet: ActionSheet) -> [ActionSheetItem] {
-        let items: [ActionSheetItem] = sheet.items + sheet.buttons
-        return items.filter { !($0 is ActionSheetCancelButton) }
-    }
-    
     func setupSheetForPresentation(_ sheet: ActionSheet) {
     func setupSheetForPresentation(_ sheet: ActionSheet) {
         self.actionSheet = sheet
         self.actionSheet = sheet
         sheet.headerView = nil
         sheet.headerView = nil
         sheet.items = popoverItems(for: sheet)
         sheet.items = popoverItems(for: sheet)
         sheet.buttons = []
         sheet.buttons = []
-        sheet.preferredContentSize = sheet.preferredPopoverSize
-        sheet.view.backgroundColor = sheet.itemsView.backgroundColor
+    }
+}
+
+
+// MARK: - Private Functions
+
+private extension ActionSheetPopoverPresenter {
+    
+    func popoverItems(for sheet: ActionSheet) -> [ActionSheetItem] {
+        let items: [ActionSheetItem] = sheet.items + sheet.buttons
+        return items.filter { !($0 is ActionSheetCancelButton) }
     }
     }
 }
 }

+ 3 - 4
Libraries external/Sheeeeeeeeet/Presenters/ActionSheetPresenter.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Presenters/ActionSheetPresenter.swift

@@ -32,12 +32,11 @@ public struct ActionSheetPresenterEvents {
 
 
 public protocol ActionSheetPresenter: AnyObject {
 public protocol ActionSheetPresenter: AnyObject {
     
     
-    var availablePresentationSize: CGSize { get }
     var events: ActionSheetPresenterEvents { get set }
     var events: ActionSheetPresenterEvents { get set }
     var isDismissableWithTapOnBackground: Bool { get set }
     var isDismissableWithTapOnBackground: Bool { get set }
     
     
     func dismiss(completion: @escaping () -> ())
     func dismiss(completion: @escaping () -> ())
-    func present(sheet: ActionSheet, in vc: UIViewController, from view: UIView?)
-    func present(sheet: ActionSheet, in vc: UIViewController, from item: UIBarButtonItem)
-    func presentationFrame(for sheet: ActionSheet, in view: UIView) -> CGRect?
+    func present(sheet: ActionSheet, in vc: UIViewController, from view: UIView?, completion: @escaping () -> ())
+    func present(sheet: ActionSheet, in vc: UIViewController, from item: UIBarButtonItem, completion: @escaping () -> ())
+    func refreshActionSheet()
 }
 }

+ 133 - 0
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Presenters/ActionSheetStandardPresenter.swift

@@ -0,0 +1,133 @@
+//
+//  ActionSheetStandardPresenter.swift
+//  Sheeeeeeeeet
+//
+//  Created by Daniel Saidi on 2017-11-27.
+//  Copyright © 2017 Daniel Saidi. All rights reserved.
+//
+
+/*
+ 
+ This presenter will present action sheets as regular iPhone
+ action sheets, from the bottom of the screen.
+ 
+ */
+
+import UIKit
+
+open class ActionSheetStandardPresenter: ActionSheetPresenter {
+    
+    
+    // MARK: - Initialization
+    
+    public init() {}
+    
+    deinit { print("\(type(of: self)) deinit") }
+    
+    
+    // MARK: - Properties
+    
+    public var events = ActionSheetPresenterEvents()
+    public var isDismissableWithTapOnBackground = true
+    
+    private var actionSheet: ActionSheet?
+    
+    
+    // MARK: - ActionSheetPresenter
+    
+    open func dismiss(completion: @escaping () -> ()) {
+        completion()
+        removeBackgroundView()
+        removeActionSheet {
+            self.actionSheet?.view.removeFromSuperview()
+            self.actionSheet = nil
+        }
+    }
+    
+    open func present(sheet: ActionSheet, in vc: UIViewController, from view: UIView?, completion: @escaping () -> ()) {
+        present(sheet: sheet, in: vc, completion: completion)
+    }
+    
+    open func present(sheet: ActionSheet, in vc: UIViewController, from item: UIBarButtonItem, completion: @escaping () -> ()) {
+        present(sheet: sheet, in: vc, completion: completion)
+    }
+    
+    open func present(sheet: ActionSheet, in vc: UIViewController, completion: @escaping () -> ()) {
+        actionSheet = sheet
+        addActionSheetView(from: sheet, to: vc.view)
+        presentBackgroundView()
+        presentActionSheet(completion: completion)
+    }
+    
+    open func refreshActionSheet() {
+        guard let sheet = actionSheet else { return }
+        sheet.topMargin?.constant = sheet.margin(at: .top)
+        sheet.leftMargin?.constant = sheet.margin(at: .left)
+        sheet.rightMargin?.constant = sheet.margin(at: .right)
+        sheet.bottomMargin?.constant = sheet.margin(at: .bottom)
+    }
+    
+    
+    // MARK: - Protected Functions
+    
+    open func addActionSheetView(from sheet: ActionSheet, to view: UIView) {
+        sheet.view.frame = view.frame
+        view.addSubview(sheet.view)
+        addBackgroundViewTapAction(to: sheet.backgroundView)
+    }
+
+    open func addBackgroundViewTapAction(to view: UIView?) {
+        view?.isUserInteractionEnabled = true
+        let action = #selector(backgroundViewTapAction)
+        let tap = UITapGestureRecognizer(target: self, action: action)
+        view?.addGestureRecognizer(tap)
+    }
+    
+    open func animate(_ animation: @escaping () -> ()) {
+        animate(animation, completion: nil)
+    }
+    
+    open func animate(_ animation: @escaping () -> (), completion: (() -> ())?) {
+        UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseOut], animations: animation) { _ in completion?() }
+    }
+    
+    open func presentActionSheet(completion: @escaping () -> ()) {
+        guard let view = actionSheet?.stackView else { return }
+        let frame = view.frame
+        view.frame.origin.y += frame.height + 100
+        let animation = { view.frame = frame }
+        animate(animation, completion: completion)
+    }
+    
+    open func presentBackgroundView() {
+        guard let view = actionSheet?.backgroundView else { return }
+        view.alpha = 0
+        let animation = { view.alpha = 1 }
+        animate(animation)
+    }
+
+    open func removeActionSheet(completion: @escaping () -> ()) {
+        guard let view = actionSheet?.stackView else { return }
+        let frame = view.frame
+        let animation = { view.frame.origin.y += frame.height + 100 }
+        animate(animation) { completion() }
+    }
+
+    open func removeBackgroundView() {
+        guard let view = actionSheet?.backgroundView else { return }
+        let animation = { view.alpha = 0 }
+        animate(animation)
+    }
+}
+
+
+// MARK: - Actions
+
+@objc public extension ActionSheetStandardPresenter {
+    
+    public func backgroundViewTapAction() {
+        guard isDismissableWithTapOnBackground else { return }
+        events.didDismissWithBackgroundTap?()
+        dismiss {}
+    }
+}

+ 0 - 0
Libraries external/Sheeeeeeeeet/Sheeeeeeeeet.h → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Sheeeeeeeeet.h


+ 2 - 2
Libraries external/Sheeeeeeeeet/Views/ActionSheetCollectionItemCell.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCollectionItemCell.swift

@@ -5,9 +5,9 @@ open class ActionSheetCollectionItemCell: ActionSheetItemCell {
     
     
     // MARK: - Properties
     // MARK: - Properties
     
     
-    static var itemCellIdentifier: String { return "Cell" }
+    static let itemCellIdentifier = ActionSheetCollectionItemCell.className
     
     
-    static var nib: UINib = UINib(nibName: "ActionSheetCollectionItemCell", bundle: Bundle.init(for: ActionSheetCollectionItemCell.self))
+    static let nib = ActionSheetCollectionItemCell.defaultNib
     
     
     
     
     // MARK: - Outlets
     // MARK: - Outlets

+ 0 - 0
Libraries external/Sheeeeeeeeet/Views/ActionSheetCollectionItemCell.xib → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCollectionItemCell.xib


+ 0 - 0
Libraries external/Sheeeeeeeeet/Views/ActionSheetCollectionItemContentCell.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCollectionItemContentCell.swift


+ 0 - 0
Libraries external/Sheeeeeeeeet/Views/ActionSheetCustomItemCell.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetCustomItemCell.swift


+ 1 - 1
Libraries external/Sheeeeeeeeet/Views/ActionSheetItemCell.swift → Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Views/ActionSheetItemCell.swift

@@ -10,7 +10,7 @@
  
  
  This is the base class for all different cell types in this
  This is the base class for all different cell types in this
  library. It makes it possible to set a global appearance on
  library. It makes it possible to set a global appearance on
- all item cells in an app.
+ all item cells, using `ActionSheetItemCell.appearance()`.
  
  
  */
  */
 
 

+ 35 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/ActionSheet+Items.swift

@@ -0,0 +1,35 @@
+//
+//  ActionSheet+Items.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+/*
+ 
+ These extensions provides action sheets with functions that
+ are shared by all example action sheets.
+ 
+ */
+
+import Sheeeeeeeeet
+
+extension ActionSheet {
+    
+    static var cancelButton: ActionSheetCancelButton {
+        return ActionSheetCancelButton(title: "Cancel")
+    }
+    
+    static var okButton: ActionSheetOkButton {
+        return ActionSheetOkButton(title: "OK")
+    }
+    
+    static var standardTitle: String {
+        return "What do you want to eat?"
+    }
+    
+    static func titleItem(title: String) -> ActionSheetTitle {
+        return ActionSheetTitle(title: title)
+    }
+}

+ 81 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/CollectionActionSheet.swift

@@ -0,0 +1,81 @@
+//
+//  CollectionActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+/*
+ 
+ This action sheet calls `setupItemsAndButtons` after it has
+ been initialized, since taps in the collection view have to
+ reload the action sheet to update selection display.
+ 
+ */
+
+import Sheeeeeeeeet
+
+class CollectionActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], action: @escaping ([MyCollectionViewCell.Item]) -> ()) {
+        let collectionItems = CollectionActionSheet.collectionItems
+        super.init(items: []) { _, item in
+            guard item.isOkButton else { return }
+            action(collectionItems.filter { $0.isSelected })
+        }
+        let items = self.items(for: options, collectionItems: collectionItems)
+        setup(items: items)
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension CollectionActionSheet {
+    
+    static var collectionItems: [MyCollectionViewCell.Item] {
+        var items: [MyCollectionViewCell.Item] = []
+        for i in 0...20 {
+            items.append(MyCollectionViewCell.Item(title: "\(i)", subtitle: "\(i)"))
+        }
+        return items
+    }
+    
+    func items(for options: [FoodOption], collectionItems: [MyCollectionViewCell.Item]) -> [ActionSheetItem] {
+        let title = ActionSheetSectionTitle(title: ActionSheet.standardTitle, subtitle: selectionSubtitle(for: collectionItems))
+        
+        let setupAction = { (cell: MyCollectionViewCell, index: Int) in
+            let item = collectionItems[index]
+            cell.configureWith(item: item)
+        }
+        
+        let selectionAction = { [weak self] (cell: MyCollectionViewCell, index: Int) in
+            let item = collectionItems[index]
+            item.isSelected = !item.isSelected
+            title.subtitle = self?.selectionSubtitle(for: collectionItems)
+            cell.configureWith(item: item)
+            self?.reloadData()
+        }
+        
+        let collectionItem = ActionSheetCollectionItem(
+            itemCellType: MyCollectionViewCell.self,
+            itemCount: collectionItems.count,
+            setupAction: setupAction,
+            selectionAction: selectionAction
+        )
+        
+        return [
+            ActionSheetSectionMargin(),
+            title,
+            ActionSheetSectionMargin(),
+            collectionItem,
+            ActionSheet.okButton,
+            ActionSheet.cancelButton]
+    }
+    
+    func selectionSubtitle(for collectionItems: [MyCollectionViewCell.Item]) -> String {
+        return "Selected items: \(collectionItems.filter { $0.isSelected }.count)"
+    }
+}

+ 41 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/CustomActionSheet.swift

@@ -0,0 +1,41 @@
+//
+//  CustomActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Daniel Saidi on 2018-10-08.
+//  Copyright © 2018 Daniel Saidi. All rights reserved.
+//
+
+import UIKit
+import Sheeeeeeeeet
+
+class CustomActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], buttonTapAction: @escaping (UIButton) -> ()) {
+        let items = CustomActionSheet.items(for: options, buttonTapAction: buttonTapAction)
+        super.init(items: items) { _, _ in }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+
+// MARK: - Private Functions
+
+private extension CustomActionSheet {
+    
+    static func items(for options: [FoodOption], buttonTapAction: @escaping (UIButton) -> ()) -> [ActionSheetItem] {
+        let customType = MyCustomViewCell.self
+        let customItem = ActionSheetCustomItem(cellType: customType) { cell in
+            cell.buttonTapAction = buttonTapAction
+        }
+        
+        return [
+            ActionSheetTitle(title: "Tap a button"),
+            customItem,
+            cancelButton
+        ]
+    }
+}

+ 46 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/DestructiveActionSheet.swift

@@ -0,0 +1,46 @@
+//
+//  DestructiveActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+/*
+ 
+ These extensions provides action sheets with functions that
+ are shared by all example action sheets.
+ 
+ */
+
+import Sheeeeeeeeet
+
+class DestructiveActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = DestructiveActionSheet.items(for: options)
+        super.init(items: items) { sheet, item in
+            guard item.isOkButton else { return }
+            let items = sheet.items.compactMap { $0 as? ActionSheetSelectItem }
+            action(items.filter { $0.isSelected })
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension DestructiveActionSheet {
+    
+    static func items(for options: [FoodOption]) -> [ActionSheetItem] {
+        let titleItem = ActionSheetTitle(title: "Remove Payment Options")
+        let image = UIImage(named: "ic_credit_card")
+        let visaTitle = "Visa **** **** **** 4321"
+        let visa = ActionSheetMultiSelectItem(title: visaTitle, isSelected: false, value: "visa", image: image)
+        let masterTitle = "MasterCard **** **** **** 9876"
+        let master = ActionSheetMultiSelectItem(title: masterTitle, isSelected: false, value: "master", image: image)
+        let removeButton = ActionSheetDangerButton(title: "Remove")
+        return [titleItem, visa, master, cancelButton, removeButton]
+    }
+}

+ 37 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/HeaderActionSheet.swift

@@ -0,0 +1,37 @@
+//
+//  HeaderActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+import Sheeeeeeeeet
+
+class HeaderActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = HeaderActionSheet.items(for: options)
+        super.init(items: items) { _, item in
+            if item.value == nil { return }
+            action([item])
+        }
+        let image = UIImage(named: "title-image")
+        headerView = UIImageView(image: image)
+        headerView?.frame.size.height = 150
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension HeaderActionSheet {
+    
+    static func items(for options: [FoodOption]) -> [ActionSheetItem] {
+        var items = options.map { $0.item() }
+        items.insert(titleItem(title: standardTitle), at: 0)
+        items.append(cancelButton)
+        return items
+    }
+}

+ 34 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/LinkActionSheet.swift

@@ -0,0 +1,34 @@
+//
+//  LinkActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+import Sheeeeeeeeet
+
+class LinkActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = LinkActionSheet.items(for: options)
+        super.init(items: items) { _, item in
+            if item.value == nil { return }
+            action([item])
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension LinkActionSheet {
+    
+    static func items(for options: [FoodOption]) -> [ActionSheetItem] {
+        var items = options.map { $0.linkItem() }
+        items.insert(titleItem(title: standardTitle), at: 0)
+        items.append(cancelButton)
+        return items
+    }
+}

+ 50 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/MultiSelectActionSheet.swift

@@ -0,0 +1,50 @@
+//
+//  MultiSelectActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+import Sheeeeeeeeet
+
+class MultiSelectActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], preselected: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = MultiSelectActionSheet.items(for: options, preselected: preselected)
+        super.init(items: items) { sheet, item in
+            guard item.isOkButton else { return }
+            let selectItems = sheet.items.compactMap { $0 as? ActionSheetSelectItem }
+            let selectedItems = selectItems.filter { $0.isSelected }
+            action(selectedItems)
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension MultiSelectActionSheet {
+    
+    static func items(for options: [FoodOption], preselected: [FoodOption]) -> [ActionSheetItem] {
+        var items = [ActionSheetItem]()
+        items.append(titleItem(title: standardTitle))
+        items.append(contentsOf: itemsGroup(for: options, preselected: .fast, group: "Appetizer"))
+        items.append(ActionSheetSectionMargin())
+        items.append(contentsOf: itemsGroup(for: options, preselected: .homeMade, group: "Main Dish"))
+        items.append(okButton)
+        items.append(cancelButton)
+        return items
+    }
+    
+    static func itemsGroup(for options: [FoodOption], preselected: FoodOption?, group: String) -> [ActionSheetItem] {
+        var items = [ActionSheetItem]()
+        let options = options.filter { $0 != .none && $0 != .fancy }
+        let foodItems = options.map { $0.multiSelectItem(isSelected: $0 == preselected, group: group) }
+        let toggler = ActionSheetMultiSelectToggleItem(title: group, state: .selectAll, group: group, selectAllTitle: "Select all", deselectAllTitle: "Deselect all")
+        items.append(toggler)
+        items.append(contentsOf: foodItems)
+        return items
+    }
+}

+ 41 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/SectionActionSheet.swift

@@ -0,0 +1,41 @@
+//
+//  SectionActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+import Sheeeeeeeeet
+
+class SectionActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = SectionActionSheet.items(for: options)
+        super.init(items: items) { _, item in
+            if item.value == nil { return }
+            action([item])
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension SectionActionSheet {
+    
+    static func items(for options: [FoodOption]) -> [ActionSheetItem] {
+        var items = [ActionSheetItem]()
+        items.append(titleItem(title: standardTitle))
+        items.append(ActionSheetSectionTitle(title: "Cheap"))
+        let cheap = options.filter { $0.isCheap }.map { $0.item() }
+        cheap.forEach { items.append($0) }
+        items.append(ActionSheetSectionMargin())
+        items.append(ActionSheetSectionTitle(title: "Expensive"))
+        let expensive = options.filter { !$0.isCheap }.map { $0.item() }
+        expensive.forEach { items.append($0) }
+        items.append(cancelButton)
+        return items
+    }
+}

+ 49 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/SingleSelectActionSheet.swift

@@ -0,0 +1,49 @@
+//
+//  MultiSelectActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+import Sheeeeeeeeet
+
+class SingleSelectActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], preselected: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = SingleSelectActionSheet.items(for: options, preselected: preselected)
+        super.init(items: items) { sheet, item in
+            guard item.isOkButton else { return }
+            let selectItems = sheet.items.compactMap { $0 as? ActionSheetSelectItem }
+            let selectedItems = selectItems.filter { $0.isSelected }
+            action(selectedItems)
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension SingleSelectActionSheet {
+    
+    static func items(for options: [FoodOption], preselected: [FoodOption]) -> [ActionSheetItem] {
+        var items = [ActionSheetItem]()
+        items.append(titleItem(title: standardTitle))
+        items.append(contentsOf: itemsGroup(for: options, preselected: .fast, group: "Appetizer"))
+        items.append(ActionSheetSectionMargin())
+        items.append(contentsOf: itemsGroup(for: options, preselected: .homeMade, group: "Main Dish"))
+        items.append(okButton)
+        items.append(cancelButton)
+        return items
+    }
+    
+    static func itemsGroup(for options: [FoodOption], preselected: FoodOption?, group: String) -> [ActionSheetItem] {
+        var items = [ActionSheetItem]()
+        let options = options.filter { $0 != .none && $0 != .fancy }
+        let foodItems = options.map { $0.singleSelectItem(isSelected: $0 == preselected, group: group) }
+        items.append(ActionSheetSectionTitle(title: group))
+        items.append(contentsOf: foodItems)
+        return items
+    }
+}

+ 34 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/ActionSheets/StandardActionSheet.swift

@@ -0,0 +1,34 @@
+//
+//  StandardActionSheet.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Jonas Ullström on 2018-03-16.
+//  Copyright © 2018 Jonas Ullström. All rights reserved.
+//
+
+import Sheeeeeeeeet
+
+class StandardActionSheet: ActionSheet {
+    
+    init(options: [FoodOption], action: @escaping ([ActionSheetItem]) -> ()) {
+        let items = StandardActionSheet.items(for: options)
+        super.init(items: items) { _, item in
+            if item.value == nil { return }
+            action([item])
+        }
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+}
+
+private extension StandardActionSheet {
+    
+    static func items(for options: [FoodOption]) -> [ActionSheetItem] {
+        var items = options.map { $0.item() }
+        items.insert(titleItem(title: standardTitle), at: 0)
+        items.append(cancelButton)
+        return items
+    }
+}

+ 80 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/AppDelegate+Appearance.swift

@@ -0,0 +1,80 @@
+//
+//  AppDelegate+Appearance.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Daniel Saidi on 2018-10-08.
+//  Copyright © 2018 Daniel Saidi. All rights reserved.
+//
+
+import UIKit
+import Sheeeeeeeeet
+
+extension AppDelegate {
+    
+    func applyAppearance() {
+        
+        let blue = UIColor(hex: 0x0FA2F5)
+        let green = UIColor(hex: 0x81c03f)
+        let pink = UIColor(hex: 0xec5f72)
+        let purple = UIColor(hex: 0xd9007b)
+        let red = UIColor(hex: 0xff3333)
+        
+        let robotoBlack = "Roboto-Black"
+        let robotoMedium = "Roboto-Medium"
+        let robotoRegular = "Roboto-Regular"
+        
+        let appearance = ActionSheetAppearance.standard
+        
+//        appearance.popover.width = 500
+        
+        appearance.item.font = UIFont(name: robotoRegular, size: 17)
+        appearance.item.textColor = .darkText
+        appearance.item.tintColor = .darkGray
+        appearance.item.subtitleFont = UIFont(name: robotoRegular, size: 14)
+        appearance.item.subtitleTextColor = blue
+        
+//        appearance.separatorColor = .red
+//        appearance.itemsSeparatorColor = .blue
+//        appearance.buttonsSeparatorColor = .green
+        
+        appearance.title.hideSeparator()
+        appearance.title.font = UIFont(name: robotoMedium, size: 15)
+        
+        appearance.sectionTitle.hideSeparator()
+        appearance.sectionTitle.font = UIFont(name: robotoMedium, size: 13)
+        appearance.sectionTitle.height = 20
+        
+        appearance.sectionMargin.height = 20
+        
+        appearance.selectItem.selectedIcon = UIImage(named: "ic_checkmark")
+        appearance.selectItem.selectedTintColor = blue
+        appearance.selectItem.selectedTextColor = green
+        appearance.selectItem.selectedIconTintColor = purple
+        
+        appearance.singleSelectItem.selectedIcon = UIImage(named: "ic_checkmark")
+        appearance.singleSelectItem.selectedTintColor = green
+        appearance.singleSelectItem.selectedTextColor = purple
+        appearance.singleSelectItem.selectedIconTintColor = blue
+        
+        appearance.multiSelectItem.selectedIcon = UIImage(named: "ic_checkmark")
+        appearance.multiSelectItem.selectedTintColor = purple
+        appearance.multiSelectItem.selectedTextColor = blue
+        appearance.multiSelectItem.selectedIconTintColor = green
+        
+        appearance.multiSelectToggleItem.hideSeparator()
+        appearance.multiSelectToggleItem.font = UIFont(name: robotoMedium, size: 13)
+        appearance.multiSelectToggleItem.selectAllTextColor = .lightGray
+        appearance.multiSelectToggleItem.deselectAllTextColor = red
+        
+        appearance.linkItem.linkIcon = UIImage(named: "ic_arrow_right")
+        
+        appearance.okButton.textColor = .darkGray
+        appearance.okButton.font = UIFont(name: robotoBlack, size: 17)
+        
+        appearance.dangerButton.textColor = pink
+        appearance.dangerButton.font = UIFont(name: robotoMedium, size: 17)
+        
+        appearance.cancelButton.textColor = .lightGray
+        appearance.cancelButton.font = UIFont(name: robotoMedium, size: 17)
+    }
+}

+ 20 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/AppDelegate.swift

@@ -0,0 +1,20 @@
+//
+//  AppDelegate.swift
+//  SheeeeeeeeetExample
+//
+//  Created by Daniel Saidi on 2017-11-18.
+//  Copyright © 2017 Daniel Saidi. All rights reserved.
+//
+
+import UIKit
+import Sheeeeeeeeet
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+    
+    var window: UIWindow?
+    
+    func applicationDidFinishLaunching(_ application: UIApplication) {
+        applyAppearance()
+    }
+}

+ 116 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,116 @@
+{
+  "images" : [
+    {
+      "size" : "20x20",
+      "idiom" : "iphone",
+      "filename" : "Icon-40.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "20x20",
+      "idiom" : "iphone",
+      "filename" : "Icon-60.png",
+      "scale" : "3x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "iphone",
+      "filename" : "Icon-58.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "iphone",
+      "filename" : "Icon-87.png",
+      "scale" : "3x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "iphone",
+      "filename" : "Icon-80.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "iphone",
+      "filename" : "Icon-120.png",
+      "scale" : "3x"
+    },
+    {
+      "size" : "60x60",
+      "idiom" : "iphone",
+      "filename" : "Icon-120.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "60x60",
+      "idiom" : "iphone",
+      "filename" : "Icon-180.png",
+      "scale" : "3x"
+    },
+    {
+      "size" : "20x20",
+      "idiom" : "ipad",
+      "filename" : "Icon-20.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "20x20",
+      "idiom" : "ipad",
+      "filename" : "Icon-40.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "ipad",
+      "filename" : "Icon-29.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "29x29",
+      "idiom" : "ipad",
+      "filename" : "Icon-58.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "ipad",
+      "filename" : "Icon-40.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "40x40",
+      "idiom" : "ipad",
+      "filename" : "Icon-80.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "76x76",
+      "idiom" : "ipad",
+      "filename" : "Icon-76.png",
+      "scale" : "1x"
+    },
+    {
+      "size" : "76x76",
+      "idiom" : "ipad",
+      "filename" : "Icon-152.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "83.5x83.5",
+      "idiom" : "ipad",
+      "filename" : "Icon-167.png",
+      "scale" : "2x"
+    },
+    {
+      "size" : "1024x1024",
+      "idiom" : "ios-marketing",
+      "filename" : "Icon-1024.png",
+      "scale" : "1x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-1024.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-120.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-152.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-167.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-180.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-20.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-29.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-40.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-58.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-60.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-76.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-80.png


BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/AppIcon.appiconset/Icon-87.png


+ 6 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 26 - 0
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/ic_account.imageset/Contents.json

@@ -0,0 +1,26 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "ic_account_circle.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "ic_account_circle_2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "ic_account_circle_3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "template-rendering-intent" : "template"
+  }
+}

BIN
Carthage/Checkouts/Sheeeeeeeeet/SheeeeeeeeetExample/Assets/Assets.xcassets/ic_account.imageset/ic_account_circle.png


Some files were not shown because too many files changed in this diff