├── docs ├── undocumented.txt ├── docsets │ ├── .docset │ │ └── Contents │ │ │ ├── Resources │ │ │ ├── Documents │ │ │ │ ├── undocumented.txt │ │ │ │ ├── img │ │ │ │ │ ├── dash.png │ │ │ │ │ ├── gh.png │ │ │ │ │ └── carat.png │ │ │ │ ├── js │ │ │ │ │ └── jazzy.js │ │ │ │ ├── css │ │ │ │ │ ├── highlight.css │ │ │ │ │ └── jazzy.css │ │ │ │ ├── Typealiases.html │ │ │ │ ├── Classes │ │ │ │ │ ├── GroupedActionSheetControllerAction.html │ │ │ │ │ └── ActionSheetControllerAction.html │ │ │ │ ├── Enums │ │ │ │ │ └── ActionSheetControllerStyle.html │ │ │ │ └── Enums.html │ │ │ └── docSet.dsidx │ │ │ └── Info.plist │ └── .tgz ├── img │ ├── dash.png │ ├── gh.png │ └── carat.png ├── js │ └── jazzy.js ├── css │ ├── highlight.css │ └── jazzy.css ├── Typealiases.html ├── Classes │ ├── GroupedActionSheetControllerAction.html │ └── ActionSheetControllerAction.html ├── Enums │ ├── ActionSheetControllerStyle.html │ └── ActionSheetControllerActionStyle.html ├── Enums.html └── Classes.html ├── ActionSheetControllerDemo ├── Assets.xcassets │ ├── Contents.json │ ├── shuffle.imageset │ │ ├── 05-shuffle.png │ │ ├── 05-shuffle@2x.png │ │ └── Contents.json │ ├── globe_earth.imageset │ │ ├── globe_earth.png │ │ ├── globe_earth@2x.png │ │ ├── globe_earth@3x.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── ViewController.swift ├── TableViewDataSource.swift └── AppDelegate.swift ├── Images └── ActionSheetContollerSample1.png ├── ActionSheetController.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcuserdata │ └── antonionunes.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── ActionSheetControllerDemo.xcscheme └── xcshareddata │ └── xcschemes │ └── ActionSheetController.xcscheme ├── .gitignore ├── ActionSheetControllerTests ├── Info.plist └── ActionSheetControllerTests.swift ├── ActionSheetControllerDemoTests ├── Info.plist └── ActionSheetControllerDemoTests.swift ├── ActionSheetControllerDemoUITests ├── Info.plist └── ActionSheetControllerDemoUITests.swift ├── ActionSheetController ├── Info.plist ├── ActionSheetController.h └── ActionControllerAnimationController.swift ├── License.txt ├── params.json ├── UIViewController+Helpers.swift ├── stylesheets ├── github-light.css ├── stylesheet.css └── normalize.css ├── index.html ├── ReadMe.md └── QueuedAlertPresenter.swift /docs/undocumented.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/undocumented.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/docsets/.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/docsets/.tgz -------------------------------------------------------------------------------- /docs/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/img/dash.png -------------------------------------------------------------------------------- /docs/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/img/gh.png -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/img/carat.png -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Images/ActionSheetContollerSample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/Images/ActionSheetContollerSample1.png -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/docSet.dsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/docsets/.docset/Contents/Resources/docSet.dsidx -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/img/dash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/docsets/.docset/Contents/Resources/Documents/img/dash.png -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/img/gh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/docsets/.docset/Contents/Resources/Documents/img/gh.png -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/docs/docsets/.docset/Contents/Resources/Documents/img/carat.png -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/shuffle.imageset/05-shuffle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/ActionSheetControllerDemo/Assets.xcassets/shuffle.imageset/05-shuffle.png -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/shuffle.imageset/05-shuffle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/ActionSheetControllerDemo/Assets.xcassets/shuffle.imageset/05-shuffle@2x.png -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/globe_earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/globe_earth.png -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/globe_earth@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/globe_earth@2x.png -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/globe_earth@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SintraWorks/ActionSheetController/HEAD/ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/globe_earth@3x.png -------------------------------------------------------------------------------- /ActionSheetController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | */build/* 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | *.xcworkspace 14 | !default.xcworkspace 15 | xcuserdata 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | .idea/ 20 | *.hmap 21 | *.xccheckout 22 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/shuffle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "05-shuffle.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "05-shuffle@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/globe_earth.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "globe_earth.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "globe_earth@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "globe_earth@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | com.jazzy. 7 | CFBundleName 8 | 9 | DocSetPlatformFamily 10 | jazzy 11 | isDashDocset 12 | 13 | dashIndexFilePath 14 | index.html 15 | isJavaScriptEnabled 16 | 17 | DashDocSetFamily 18 | dashtoc 19 | 20 | 21 | -------------------------------------------------------------------------------- /ActionSheetControllerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ActionSheetControllerDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ActionSheetControllerDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ActionSheetController/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 António Miguel Câncio Reis Jacinto Nunes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ActionSheetController.xcodeproj/xcuserdata/antonionunes.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ActionSheetController.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | ActionSheetControllerDemo.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 6D5958501C96D7CC0022D616 21 | 22 | primary 23 | 24 | 25 | 6D59585A1C96D7CC0022D616 26 | 27 | primary 28 | 29 | 30 | 6D5958741C96DA2C0022D616 31 | 32 | primary 33 | 34 | 35 | 6D5958871C96DA2C0022D616 36 | 37 | primary 38 | 39 | 40 | 6D5958921C96DA2C0022D616 41 | 42 | primary 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/js/jazzy.js: -------------------------------------------------------------------------------- 1 | window.jazzy = {'docset': false} 2 | if (typeof window.dash != 'undefined') { 3 | document.documentElement.className += ' dash' 4 | window.jazzy.docset = true 5 | } 6 | if (navigator.userAgent.match(/xcode/i)) { 7 | document.documentElement.className += ' xcode' 8 | window.jazzy.docset = true 9 | } 10 | 11 | // On doc load, toggle the URL hash discussion if present 12 | $(document).ready(function() { 13 | if (!window.jazzy.docset) { 14 | var linkToHash = $('a[href="' + window.location.hash +'"]'); 15 | linkToHash.trigger("click"); 16 | } 17 | }); 18 | 19 | // On token click, toggle its discussion and animate token.marginLeft 20 | $(".token").click(function(event) { 21 | if (window.jazzy.docset) { 22 | return; 23 | } 24 | var link = $(this); 25 | var animationDuration = 300; 26 | var tokenOffset = "15px"; 27 | var original = link.css('marginLeft') == tokenOffset; 28 | link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); 29 | $content = link.parent().parent().next(); 30 | $content.slideToggle(animationDuration); 31 | 32 | // Keeps the document from jumping to the hash. 33 | var href = $(this).attr('href'); 34 | if (history.pushState) { 35 | history.pushState({}, '', href); 36 | } else { 37 | location.hash = href; 38 | } 39 | event.preventDefault(); 40 | }); 41 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 0.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ActionSheetController/ActionSheetController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActionSheetController.h 3 | // ActionSheetController 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | //! Project version number for ActionSheetController. 29 | FOUNDATION_EXPORT double ActionSheetControllerVersionNumber; 30 | 31 | //! Project version string for ActionSheetController. 32 | FOUNDATION_EXPORT const unsigned char ActionSheetControllerVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | 36 | 37 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ActionSheetControllerDemo 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | class ViewController: UITableViewController { 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | 33 | title = "Menu" 34 | 35 | var frame = self.tableView.bounds 36 | frame.size.height = 20.0 37 | let headerView = UIView(frame: frame) 38 | headerView.translatesAutoresizingMaskIntoConstraints = false 39 | 40 | self.tableView.tableHeaderView = headerView 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /params.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Actionsheetcontroller", 3 | "tagline": "AcionSheetController is an iOS control for presenting a view in an iOS action sheet or alert style.", 4 | "body": "AcionSheetController\r\n====\r\n\r\nAcionSheetController is an iOS control for presenting a view in an iOS action sheet or alert style. You can add a custom view, representing your custom content, and add any number of buttons to represent actions related to that content. You can also forgo any custom view and simply present a number of actionable buttons.\r\n\r\n![Portrait](https://github.com/SintraWorks/ActionSheetController/blob/master/Images/ActionSheetContollerSample1.png)\r\n\r\n\r\nUsage\r\n====\r\n\r\nThere is generally no need to subclass ActionSheetController, although you can if you want to.\r\n\r\n## License (MIT License)\r\nCopyright (c) 2015 Roland Moers\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.", 5 | "google": "", 6 | "note": "Don't delete this file! It's used internally to help with page regeneration." 7 | } -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ActionSheetControllerDemoTests/ActionSheetControllerDemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActionSheetControllerDemoTests.swift 3 | // ActionSheetControllerDemoTests 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import XCTest 27 | @testable import ActionSheetControllerDemo 28 | 29 | class ActionSheetControllerDemoTests: XCTestCase { 30 | 31 | override func setUp() { 32 | super.setUp() 33 | // Put setup code here. This method is called before the invocation of each test method in the class. 34 | } 35 | 36 | override func tearDown() { 37 | // Put teardown code here. This method is called after the invocation of each test method in the class. 38 | super.tearDown() 39 | } 40 | 41 | func testExample() { 42 | // This is an example of a functional test case. 43 | // Use XCTAssert and related functions to verify your tests produce the correct results. 44 | } 45 | 46 | func testPerformanceExample() { 47 | // This is an example of a performance test case. 48 | self.measureBlock { 49 | // Put the code you want to measure the time of here. 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /ActionSheetControllerDemoUITests/ActionSheetControllerDemoUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActionSheetControllerDemoUITests.swift 3 | // ActionSheetControllerDemoUITests 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import XCTest 27 | 28 | class ActionSheetControllerDemoUITests: XCTestCase { 29 | 30 | override func setUp() { 31 | super.setUp() 32 | 33 | // Put setup code here. This method is called before the invocation of each test method in the class. 34 | 35 | // In UI tests it is usually best to stop immediately when a failure occurs. 36 | continueAfterFailure = false 37 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 38 | XCUIApplication().launch() 39 | 40 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 41 | } 42 | 43 | override func tearDown() { 44 | // Put teardown code here. This method is called after the invocation of each test method in the class. 45 | super.tearDown() 46 | } 47 | 48 | func testExample() { 49 | // Use recording to get started writing UI tests. 50 | // Use XCTAssert and related functions to verify your tests produce the correct results. 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /UIViewController+Helpers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Helpers.swift 3 | // RandomReminders 4 | // 5 | // Created by Antonio Nunes on 17/02/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | extension UIViewController { 29 | func presentViewControllerOnMainThread(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)?) { 30 | let op = BlockOperation(block: { self.present(viewControllerToPresent, animated: flag, completion: completion) }) 31 | OperationQueue.main.addOperation(op) 32 | } 33 | 34 | class func topViewControllerForViewController(_ queryBaseController: UIViewController) -> UIViewController { 35 | var targetController = queryBaseController 36 | var currentController: UIViewController? = targetController 37 | 38 | repeat { 39 | switch currentController { 40 | case let navigationController as UINavigationController: 41 | currentController = navigationController.viewControllers.last 42 | case let tabBarController as UITabBarController: 43 | currentController = tabBarController.selectedViewController 44 | default: 45 | currentController = targetController.presentedViewController 46 | } 47 | 48 | if let currentController = currentController { 49 | targetController = currentController 50 | } 51 | } while currentController != nil 52 | 53 | return targetController 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ActionSheetControllerTests/ActionSheetControllerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActionSheetControllerTests.swift 3 | // ActionSheetControllerTests 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import XCTest 27 | @testable import ActionSheetController 28 | 29 | class ActionSheetControllerTests: XCTestCase { 30 | 31 | override func setUp() { 32 | super.setUp() 33 | // Put setup code here. This method is called before the invocation of each test method in the class. 34 | } 35 | 36 | override func tearDown() { 37 | // Put teardown code here. This method is called after the invocation of each test method in the class. 38 | super.tearDown() 39 | } 40 | 41 | // func testExample() { 42 | // // This is an example of a functional test case. 43 | // // Use XCTAssert and related functions to verify your tests produce the correct results. 44 | // } 45 | // 46 | // func testPerformanceExample() { 47 | // // This is an example of a performance test case. 48 | // self.measureBlock { 49 | // // Put the code you want to measure the time of here. 50 | // } 51 | // } 52 | 53 | func testActionSheetControllerCreation() { 54 | let title = "Title" 55 | let message = "Message" 56 | let controller = ActionSheetController(title: title, message: message) 57 | XCTAssert( controller.title == title, "Incorrect controller title returned" ) 58 | XCTAssert( controller.message == message, "Incorrect controller message returned" ) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/TableViewDataSource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewDataSource.swift 3 | // ActionSheetController 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | 29 | enum RowIdentifier: Int { 30 | case customView, datePickerView, transparentBackground, noBackgroundTaps, groupedActions, viewController 31 | 32 | func description() -> String { 33 | switch self { 34 | case .customView: 35 | return "Custom View" 36 | case .datePickerView: 37 | return "Date Picker View" 38 | case .transparentBackground: 39 | return "Transparent Background and Image Button View" 40 | case .noBackgroundTaps: 41 | return "No Background Taps View" 42 | case .groupedActions: 43 | return "Grouped Actions View" 44 | case .viewController: 45 | return "Custom View Controller" 46 | } 47 | } 48 | 49 | static var count: Int = { 50 | return viewController.rawValue + 1 }() 51 | } 52 | 53 | 54 | class TableViewDataSource: NSObject, UITableViewDataSource { 55 | func numberOfSections(in tableView: UITableView) -> Int { 56 | return 1 57 | } 58 | 59 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 60 | return RowIdentifier.count 61 | } 62 | 63 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 64 | guard let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") else { return UITableViewCell(style: .default, reuseIdentifier: "Cell") } 65 | guard let item = RowIdentifier(rawValue: (indexPath as NSIndexPath).row) else { fatalError("Illegal row index") } 66 | 67 | cell.textLabel?.text = item.description() 68 | cell.imageView?.image = UIImage(systemName: "star.fill") 69 | cell.contentView.backgroundColor = UIColor.blue.withAlphaComponent(0.25) 70 | return cell 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /stylesheets/github-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 GitHub Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | */ 17 | 18 | .pl-c /* comment */ { 19 | color: #969896; 20 | } 21 | 22 | .pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */, 23 | .pl-s .pl-v /* string variable */ { 24 | color: #0086b3; 25 | } 26 | 27 | .pl-e /* entity */, 28 | .pl-en /* entity.name */ { 29 | color: #795da3; 30 | } 31 | 32 | .pl-s .pl-s1 /* string source */, 33 | .pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ { 34 | color: #333; 35 | } 36 | 37 | .pl-ent /* entity.name.tag */ { 38 | color: #63a35c; 39 | } 40 | 41 | .pl-k /* keyword, storage, storage.type */ { 42 | color: #a71d5d; 43 | } 44 | 45 | .pl-pds /* punctuation.definition.string, string.regexp.character-class */, 46 | .pl-s /* string */, 47 | .pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, 48 | .pl-sr /* string.regexp */, 49 | .pl-sr .pl-cce /* string.regexp constant.character.escape */, 50 | .pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */, 51 | .pl-sr .pl-sre /* string.regexp source.ruby.embedded */ { 52 | color: #183691; 53 | } 54 | 55 | .pl-v /* variable */ { 56 | color: #ed6a43; 57 | } 58 | 59 | .pl-id /* invalid.deprecated */ { 60 | color: #b52a1d; 61 | } 62 | 63 | .pl-ii /* invalid.illegal */ { 64 | background-color: #b52a1d; 65 | color: #f8f8f8; 66 | } 67 | 68 | .pl-sr .pl-cce /* string.regexp constant.character.escape */ { 69 | color: #63a35c; 70 | font-weight: bold; 71 | } 72 | 73 | .pl-ml /* markup.list */ { 74 | color: #693a17; 75 | } 76 | 77 | .pl-mh /* markup.heading */, 78 | .pl-mh .pl-en /* markup.heading entity.name */, 79 | .pl-ms /* meta.separator */ { 80 | color: #1d3e81; 81 | font-weight: bold; 82 | } 83 | 84 | .pl-mq /* markup.quote */ { 85 | color: #008080; 86 | } 87 | 88 | .pl-mi /* markup.italic */ { 89 | color: #333; 90 | font-style: italic; 91 | } 92 | 93 | .pl-mb /* markup.bold */ { 94 | color: #333; 95 | font-weight: bold; 96 | } 97 | 98 | .pl-md /* markup.deleted, meta.diff.header.from-file */ { 99 | background-color: #ffecec; 100 | color: #bd2c00; 101 | } 102 | 103 | .pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { 104 | background-color: #eaffea; 105 | color: #55a532; 106 | } 107 | 108 | .pl-mdr /* meta.diff.range */ { 109 | color: #795da3; 110 | font-weight: bold; 111 | } 112 | 113 | .pl-mo /* meta.output */ { 114 | color: #1d3e81; 115 | } 116 | 117 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ActionSheetControllerDemo 4 | // 5 | // Created by Antonio Nunes on 14/03/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | @UIApplicationMain 29 | class AppDelegate: UIResponder, UIApplicationDelegate { 30 | 31 | var window: UIWindow? 32 | 33 | 34 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 35 | // Override point for customization after application launch. 36 | return true 37 | } 38 | 39 | func applicationWillResignActive(_ application: UIApplication) { 40 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 41 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 42 | } 43 | 44 | func applicationDidEnterBackground(_ application: UIApplication) { 45 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 46 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 47 | } 48 | 49 | func applicationWillEnterForeground(_ application: UIApplication) { 50 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 51 | } 52 | 53 | func applicationDidBecomeActive(_ application: UIApplication) { 54 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 55 | } 56 | 57 | func applicationWillTerminate(_ application: UIApplication) { 58 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 59 | } 60 | 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /ActionSheetController.xcodeproj/xcuserdata/antonionunes.xcuserdatad/xcschemes/ActionSheetControllerDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ActionSheetController.xcodeproj/xcshareddata/xcschemes/ActionSheetController.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 63 | 69 | 70 | 71 | 72 | 78 | 79 | 85 | 86 | 87 | 88 | 90 | 91 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Actionsheetcontroller by SintraWorks 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 21 |
22 |

23 | AcionSheetController

24 | 25 |

AcionSheetController is an iOS control for presenting a view in an iOS action sheet or alert style. You can add a custom view, representing your custom content, and add any number of buttons to represent actions related to that content. You can also forgo any custom view and simply present a number of actionable buttons.

26 | 27 |

Portrait

28 | 29 |

30 | Usage

31 | 32 |

There is generally no need to subclass ActionSheetController, although you can if you want to.

33 | 34 |

35 | License (MIT License)

36 | 37 |

Copyright (c) 2015 Roland Moers

38 | 39 |

Permission is hereby granted, free of charge, to any person obtaining a copy 40 | of this software and associated documentation files (the "Software"), to deal 41 | in the Software without restriction, including without limitation the rights 42 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 43 | copies of the Software, and to permit persons to whom the Software is 44 | furnished to do so, subject to the following conditions:

45 | 46 |

The above copyright notice and this permission notice shall be included in 47 | all copies or substantial portions of the Software.

48 | 49 |

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 50 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 51 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 52 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 53 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 54 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 55 | THE SOFTWARE.

56 | 57 | 62 | 63 |
64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | AcionSheetController 2 | ==== 3 | 4 | AcionSheetController is an iOS control for presenting a view in an iOS action sheet or alert style. You can add a custom view, representing your custom content, and add any number of buttons to represent actions related to that content. You can also forgo any custom view and simply present a number of actionable buttons. 5 | 6 | ![Picker View](https://sintraworks.github.io/ActionSheetController/Images/ActionSheetContollerSample1.png) 7 | ![Buttons, light theme](https://sintraworks.github.io/ActionSheetController/Images/ActionSheetContollerSample2.png) 8 | 9 | ![Buttons, dark theme](https://sintraworks.github.io/ActionSheetController/Images/ActionSheetContollerSample3.png) 10 | 11 | AcionSheetController is written in **Swift** and was inspired by [RMActionController](https://github.com/CooperRS/RMActionController) by [Roland Moers](https://github.com/CooperRS). AcionSheetController differs in a number of aspects, firstly, of course, by being written in Swift, and also importantly by basing itself on **UIStackView**. 12 | 13 | Usage 14 | ==== 15 | By default ActionSheetController doesn't contain a content view, and will only show buttons for any actions you add. To show a content view you simply set the contentView property to hold the desired view. There is generally no need to subclass ActionSheetController, although you can if you want to. 16 | 17 | ### Adding a view 18 | Lets say you want to add a date picker: 19 | - You instantiate a UIDatePicker 20 | - You instantiate an action and consult the date picker in its handler, to extract the selected date. 21 | - You set the picker as the content view of the ActionSheetController 22 | 23 | ```swift 24 | private func datePickerSheet() -> ActionSheetController { 25 | let pickerView = UIDatePicker(frame: CGRectZero) 26 | 27 | let okAction = ActionSheetControllerAction(style: .Done, title: "OK", dismissesActionController: true) { controller in 28 | let date = pickerView.date 29 | let action = AlertAction(title: "Hurray!", style: .Default, enabled: true, isPreferredAction: true) { 30 | print("Dismissed!") 31 | } 32 | let alertInfo = AlertInfo(title: "Success", message: "You picked date: \(date.description)", actions: [action]) 33 | AlertPresenter.sharedAlertPresenter.addAlert(alertInfo) 34 | } 35 | 36 | let cancelAction = ActionSheetControllerAction(style: .Cancel, title: "Cancel", dismissesActionController: true, handler: nil) 37 | let sheetController = ActionSheetController(title: "Date Picker", message: "Pick a date for your enjoyment…", cancelAction: cancelAction, okAction: okAction) 38 | 39 | sheetController.contentView = pickerView 40 | 41 | return sheetController 42 | } 43 | ``` 44 | ### Presenting 45 | Presenting the controller is pretty standard: 46 | 47 | ```swift 48 | var sheetController = self.datePickerSheet() 49 | self.controller.presentViewController(sheetController, animated: true, completion: nil) 50 | ``` 51 | 52 | ### Presentation Style 53 | ActionSheetController can be presented as a popover on iPad, and it has a light and a dark theme, suitable for different context, and/or personal preference. 54 | 55 | ### Integration 56 | To use ActionSheetController simply drag the files ActionSheetController.swift and ActionSheetControllerAction.swift into your project. 57 | 58 | ### Requirements 59 | 60 | | Compile Time | Runtime | 61 | | :------------ | :------------ | 62 | | Xcode 7 | iOS 9 | 63 | | iOS 9 SDK | 64 | 65 | ## License (MIT License) 66 | Copyright (c) 2016 Antonio Nunes 67 | 68 | Permission is hereby granted, free of charge, to any person obtaining a copy 69 | of this software and associated documentation files (the "Software"), to deal 70 | in the Software without restriction, including without limitation the rights 71 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 72 | copies of the Software, and to permit persons to whom the Software is 73 | furnished to do so, subject to the following conditions: 74 | 75 | The above copyright notice and this permission notice shall be included in 76 | all copies or substantial portions of the Software. 77 | 78 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 79 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 80 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 81 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 82 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 83 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 84 | THE SOFTWARE. 85 | -------------------------------------------------------------------------------- /ActionSheetControllerDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* Credit to https://gist.github.com/wataru420/2048287 */ 2 | .highlight { 3 | /* Comment */ 4 | /* Error */ 5 | /* Keyword */ 6 | /* Operator */ 7 | /* Comment.Multiline */ 8 | /* Comment.Preproc */ 9 | /* Comment.Single */ 10 | /* Comment.Special */ 11 | /* Generic.Deleted */ 12 | /* Generic.Deleted.Specific */ 13 | /* Generic.Emph */ 14 | /* Generic.Error */ 15 | /* Generic.Heading */ 16 | /* Generic.Inserted */ 17 | /* Generic.Inserted.Specific */ 18 | /* Generic.Output */ 19 | /* Generic.Prompt */ 20 | /* Generic.Strong */ 21 | /* Generic.Subheading */ 22 | /* Generic.Traceback */ 23 | /* Keyword.Constant */ 24 | /* Keyword.Declaration */ 25 | /* Keyword.Pseudo */ 26 | /* Keyword.Reserved */ 27 | /* Keyword.Type */ 28 | /* Literal.Number */ 29 | /* Literal.String */ 30 | /* Name.Attribute */ 31 | /* Name.Builtin */ 32 | /* Name.Class */ 33 | /* Name.Constant */ 34 | /* Name.Entity */ 35 | /* Name.Exception */ 36 | /* Name.Function */ 37 | /* Name.Namespace */ 38 | /* Name.Tag */ 39 | /* Name.Variable */ 40 | /* Operator.Word */ 41 | /* Text.Whitespace */ 42 | /* Literal.Number.Float */ 43 | /* Literal.Number.Hex */ 44 | /* Literal.Number.Integer */ 45 | /* Literal.Number.Oct */ 46 | /* Literal.String.Backtick */ 47 | /* Literal.String.Char */ 48 | /* Literal.String.Doc */ 49 | /* Literal.String.Double */ 50 | /* Literal.String.Escape */ 51 | /* Literal.String.Heredoc */ 52 | /* Literal.String.Interpol */ 53 | /* Literal.String.Other */ 54 | /* Literal.String.Regex */ 55 | /* Literal.String.Single */ 56 | /* Literal.String.Symbol */ 57 | /* Name.Builtin.Pseudo */ 58 | /* Name.Variable.Class */ 59 | /* Name.Variable.Global */ 60 | /* Name.Variable.Instance */ 61 | /* Literal.Number.Integer.Long */ } 62 | .highlight .c { 63 | color: #999988; 64 | font-style: italic; } 65 | .highlight .err { 66 | color: #a61717; 67 | background-color: #e3d2d2; } 68 | .highlight .k { 69 | color: #000000; 70 | font-weight: bold; } 71 | .highlight .o { 72 | color: #000000; 73 | font-weight: bold; } 74 | .highlight .cm { 75 | color: #999988; 76 | font-style: italic; } 77 | .highlight .cp { 78 | color: #999999; 79 | font-weight: bold; } 80 | .highlight .c1 { 81 | color: #999988; 82 | font-style: italic; } 83 | .highlight .cs { 84 | color: #999999; 85 | font-weight: bold; 86 | font-style: italic; } 87 | .highlight .gd { 88 | color: #000000; 89 | background-color: #ffdddd; } 90 | .highlight .gd .x { 91 | color: #000000; 92 | background-color: #ffaaaa; } 93 | .highlight .ge { 94 | color: #000000; 95 | font-style: italic; } 96 | .highlight .gr { 97 | color: #aa0000; } 98 | .highlight .gh { 99 | color: #999999; } 100 | .highlight .gi { 101 | color: #000000; 102 | background-color: #ddffdd; } 103 | .highlight .gi .x { 104 | color: #000000; 105 | background-color: #aaffaa; } 106 | .highlight .go { 107 | color: #888888; } 108 | .highlight .gp { 109 | color: #555555; } 110 | .highlight .gs { 111 | font-weight: bold; } 112 | .highlight .gu { 113 | color: #aaaaaa; } 114 | .highlight .gt { 115 | color: #aa0000; } 116 | .highlight .kc { 117 | color: #000000; 118 | font-weight: bold; } 119 | .highlight .kd { 120 | color: #000000; 121 | font-weight: bold; } 122 | .highlight .kp { 123 | color: #000000; 124 | font-weight: bold; } 125 | .highlight .kr { 126 | color: #000000; 127 | font-weight: bold; } 128 | .highlight .kt { 129 | color: #445588; } 130 | .highlight .m { 131 | color: #009999; } 132 | .highlight .s { 133 | color: #d14; } 134 | .highlight .na { 135 | color: #008080; } 136 | .highlight .nb { 137 | color: #0086B3; } 138 | .highlight .nc { 139 | color: #445588; 140 | font-weight: bold; } 141 | .highlight .no { 142 | color: #008080; } 143 | .highlight .ni { 144 | color: #800080; } 145 | .highlight .ne { 146 | color: #990000; 147 | font-weight: bold; } 148 | .highlight .nf { 149 | color: #990000; } 150 | .highlight .nn { 151 | color: #555555; } 152 | .highlight .nt { 153 | color: #000080; } 154 | .highlight .nv { 155 | color: #008080; } 156 | .highlight .ow { 157 | color: #000000; 158 | font-weight: bold; } 159 | .highlight .w { 160 | color: #bbbbbb; } 161 | .highlight .mf { 162 | color: #009999; } 163 | .highlight .mh { 164 | color: #009999; } 165 | .highlight .mi { 166 | color: #009999; } 167 | .highlight .mo { 168 | color: #009999; } 169 | .highlight .sb { 170 | color: #d14; } 171 | .highlight .sc { 172 | color: #d14; } 173 | .highlight .sd { 174 | color: #d14; } 175 | .highlight .s2 { 176 | color: #d14; } 177 | .highlight .se { 178 | color: #d14; } 179 | .highlight .sh { 180 | color: #d14; } 181 | .highlight .si { 182 | color: #d14; } 183 | .highlight .sx { 184 | color: #d14; } 185 | .highlight .sr { 186 | color: #009926; } 187 | .highlight .s1 { 188 | color: #d14; } 189 | .highlight .ss { 190 | color: #990073; } 191 | .highlight .bp { 192 | color: #999999; } 193 | .highlight .vc { 194 | color: #008080; } 195 | .highlight .vg { 196 | color: #008080; } 197 | .highlight .vi { 198 | color: #008080; } 199 | .highlight .il { 200 | color: #009999; } 201 | -------------------------------------------------------------------------------- /docs/Typealiases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Typealiases Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 65 |
66 |
67 |
68 |

Typealiases

69 |

The following typealiases are available globally.

70 | 71 |
72 |
73 |
74 | 81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | ActionSheetControllerActionHandler 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    A block of code to be executed when the action is activated.

    96 | 97 |
    98 |
    99 |

    Declaration

    100 |
    101 |

    Swift

    102 |
    public typealias ActionSheetControllerActionHandler = (ActionSheetController) -> ()
    103 | 104 |
    105 |
    106 |
    107 |
    108 |
  • 109 |
110 |
111 |
112 |
113 | 117 |
118 |
119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Typealiases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Typealiases Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 65 |
66 |
67 |
68 |

Typealiases

69 |

The following typealiases are available globally.

70 | 71 |
72 |
73 |
74 | 81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | ActionSheetControllerActionHandler 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    A block of code to be executed when the action is activated.

    96 | 97 |
    98 |
    99 |

    Declaration

    100 |
    101 |

    Swift

    102 |
    public typealias ActionSheetControllerActionHandler = (ActionSheetController) -> ()
    103 | 104 |
    105 |
    106 |
    107 |
    108 |
  • 109 |
110 |
111 |
112 |
113 | 117 |
118 |
119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /docs/Classes/GroupedActionSheetControllerAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GroupedActionSheetControllerAction Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

GroupedActionSheetControllerAction

70 |
71 |
72 |
public class GroupedActionSheetControllerAction: ActionSheetControllerAction
73 | 74 |
75 |
76 |

A GroupedActionSheetControllerAction represents a grouping of ActionControllerActions.

77 | 78 |

An ActionSheetController uses one row for every action that has been added. GroupedActionSheetControllerAction enables showing multiple ActionControllerActions in one row.

79 | 80 |
81 |
82 |
83 |
    84 |
  • 85 |
    86 | 87 | 88 | 89 | init(style:actions:) 90 | 91 |
    92 |
    93 |
    94 |
    95 |
    96 |
    97 |

    Pass in the action style, and an array of actions to be shown on a single row.

    98 | 99 |
    100 |
    101 |

    Declaration

    102 |
    103 |

    Swift

    104 |
    public init(style: ActionSheetControllerActionStyle, actions: [ActionSheetControllerAction])
    105 | 106 |
    107 |
    108 |
    109 |
    110 |
  • 111 |
112 |
113 |
114 |
115 | 119 |
120 |
121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Classes/GroupedActionSheetControllerAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | GroupedActionSheetControllerAction Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

GroupedActionSheetControllerAction

70 |
71 |
72 |
public class GroupedActionSheetControllerAction: ActionSheetControllerAction
73 | 74 |
75 |
76 |

A GroupedActionSheetControllerAction represents a grouping of ActionControllerActions.

77 | 78 |

An ActionSheetController uses one row for every action that has been added. GroupedActionSheetControllerAction enables showing multiple ActionControllerActions in one row.

79 | 80 |
81 |
82 |
83 |
    84 |
  • 85 |
    86 | 87 | 88 | 89 | init(style:actions:) 90 | 91 |
    92 |
    93 |
    94 |
    95 |
    96 |
    97 |

    Pass in the action style, and an array of actions to be shown on a single row.

    98 | 99 |
    100 |
    101 |

    Declaration

    102 |
    103 |

    Swift

    104 |
    public init(style: ActionSheetControllerActionStyle, actions: [ActionSheetControllerAction])
    105 | 106 |
    107 |
    108 |
    109 |
    110 |
  • 111 |
112 |
113 |
114 |
115 | 119 |
120 |
121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /stylesheets/stylesheet.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; } 3 | 4 | body { 5 | padding: 0; 6 | margin: 0; 7 | font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; 8 | font-size: 16px; 9 | line-height: 1.5; 10 | color: #606c71; } 11 | 12 | a { 13 | color: #1e6bb8; 14 | text-decoration: none; } 15 | a:hover { 16 | text-decoration: underline; } 17 | 18 | .btn { 19 | display: inline-block; 20 | margin-bottom: 1rem; 21 | color: rgba(255, 255, 255, 0.7); 22 | background-color: rgba(255, 255, 255, 0.08); 23 | border-color: rgba(255, 255, 255, 0.2); 24 | border-style: solid; 25 | border-width: 1px; 26 | border-radius: 0.3rem; 27 | transition: color 0.2s, background-color 0.2s, border-color 0.2s; } 28 | .btn + .btn { 29 | margin-left: 1rem; } 30 | 31 | .btn:hover { 32 | color: rgba(255, 255, 255, 0.8); 33 | text-decoration: none; 34 | background-color: rgba(255, 255, 255, 0.2); 35 | border-color: rgba(255, 255, 255, 0.3); } 36 | 37 | @media screen and (min-width: 64em) { 38 | .btn { 39 | padding: 0.75rem 1rem; } } 40 | 41 | @media screen and (min-width: 42em) and (max-width: 64em) { 42 | .btn { 43 | padding: 0.6rem 0.9rem; 44 | font-size: 0.9rem; } } 45 | 46 | @media screen and (max-width: 42em) { 47 | .btn { 48 | display: block; 49 | width: 100%; 50 | padding: 0.75rem; 51 | font-size: 0.9rem; } 52 | .btn + .btn { 53 | margin-top: 1rem; 54 | margin-left: 0; } } 55 | 56 | .page-header { 57 | color: #fff; 58 | text-align: center; 59 | background-color: #159957; 60 | background-image: linear-gradient(120deg, #155799, #159957); } 61 | 62 | @media screen and (min-width: 64em) { 63 | .page-header { 64 | padding: 5rem 6rem; } } 65 | 66 | @media screen and (min-width: 42em) and (max-width: 64em) { 67 | .page-header { 68 | padding: 3rem 4rem; } } 69 | 70 | @media screen and (max-width: 42em) { 71 | .page-header { 72 | padding: 2rem 1rem; } } 73 | 74 | .project-name { 75 | margin-top: 0; 76 | margin-bottom: 0.1rem; } 77 | 78 | @media screen and (min-width: 64em) { 79 | .project-name { 80 | font-size: 3.25rem; } } 81 | 82 | @media screen and (min-width: 42em) and (max-width: 64em) { 83 | .project-name { 84 | font-size: 2.25rem; } } 85 | 86 | @media screen and (max-width: 42em) { 87 | .project-name { 88 | font-size: 1.75rem; } } 89 | 90 | .project-tagline { 91 | margin-bottom: 2rem; 92 | font-weight: normal; 93 | opacity: 0.7; } 94 | 95 | @media screen and (min-width: 64em) { 96 | .project-tagline { 97 | font-size: 1.25rem; } } 98 | 99 | @media screen and (min-width: 42em) and (max-width: 64em) { 100 | .project-tagline { 101 | font-size: 1.15rem; } } 102 | 103 | @media screen and (max-width: 42em) { 104 | .project-tagline { 105 | font-size: 1rem; } } 106 | 107 | .main-content :first-child { 108 | margin-top: 0; } 109 | .main-content img { 110 | max-width: 100%; } 111 | .main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 { 112 | margin-top: 2rem; 113 | margin-bottom: 1rem; 114 | font-weight: normal; 115 | color: #159957; } 116 | .main-content p { 117 | margin-bottom: 1em; } 118 | .main-content code { 119 | padding: 2px 4px; 120 | font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 121 | font-size: 0.9rem; 122 | color: #383e41; 123 | background-color: #f3f6fa; 124 | border-radius: 0.3rem; } 125 | .main-content pre { 126 | padding: 0.8rem; 127 | margin-top: 0; 128 | margin-bottom: 1rem; 129 | font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace; 130 | color: #567482; 131 | word-wrap: normal; 132 | background-color: #f3f6fa; 133 | border: solid 1px #dce6f0; 134 | border-radius: 0.3rem; } 135 | .main-content pre > code { 136 | padding: 0; 137 | margin: 0; 138 | font-size: 0.9rem; 139 | color: #567482; 140 | word-break: normal; 141 | white-space: pre; 142 | background: transparent; 143 | border: 0; } 144 | .main-content .highlight { 145 | margin-bottom: 1rem; } 146 | .main-content .highlight pre { 147 | margin-bottom: 0; 148 | word-break: normal; } 149 | .main-content .highlight pre, .main-content pre { 150 | padding: 0.8rem; 151 | overflow: auto; 152 | font-size: 0.9rem; 153 | line-height: 1.45; 154 | border-radius: 0.3rem; } 155 | .main-content pre code, .main-content pre tt { 156 | display: inline; 157 | max-width: initial; 158 | padding: 0; 159 | margin: 0; 160 | overflow: initial; 161 | line-height: inherit; 162 | word-wrap: normal; 163 | background-color: transparent; 164 | border: 0; } 165 | .main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after { 166 | content: normal; } 167 | .main-content ul, .main-content ol { 168 | margin-top: 0; } 169 | .main-content blockquote { 170 | padding: 0 1rem; 171 | margin-left: 0; 172 | color: #819198; 173 | border-left: 0.3rem solid #dce6f0; } 174 | .main-content blockquote > :first-child { 175 | margin-top: 0; } 176 | .main-content blockquote > :last-child { 177 | margin-bottom: 0; } 178 | .main-content table { 179 | display: block; 180 | width: 100%; 181 | overflow: auto; 182 | word-break: normal; 183 | word-break: keep-all; } 184 | .main-content table th { 185 | font-weight: bold; } 186 | .main-content table th, .main-content table td { 187 | padding: 0.5rem 1rem; 188 | border: 1px solid #e9ebec; } 189 | .main-content dl { 190 | padding: 0; } 191 | .main-content dl dt { 192 | padding: 0; 193 | margin-top: 1rem; 194 | font-size: 1rem; 195 | font-weight: bold; } 196 | .main-content dl dd { 197 | padding: 0; 198 | margin-bottom: 1rem; } 199 | .main-content hr { 200 | height: 2px; 201 | padding: 0; 202 | margin: 1rem 0; 203 | background-color: #eff0f1; 204 | border: 0; } 205 | 206 | @media screen and (min-width: 64em) { 207 | .main-content { 208 | max-width: 64rem; 209 | padding: 2rem 6rem; 210 | margin: 0 auto; 211 | font-size: 1.1rem; } } 212 | 213 | @media screen and (min-width: 42em) and (max-width: 64em) { 214 | .main-content { 215 | padding: 2rem 4rem; 216 | font-size: 1.1rem; } } 217 | 218 | @media screen and (max-width: 42em) { 219 | .main-content { 220 | padding: 2rem 1rem; 221 | font-size: 1rem; } } 222 | 223 | .site-footer { 224 | padding-top: 2rem; 225 | margin-top: 2rem; 226 | border-top: solid 1px #eff0f1; } 227 | 228 | .site-footer-owner { 229 | display: block; 230 | font-weight: bold; } 231 | 232 | .site-footer-credits { 233 | color: #819198; } 234 | 235 | @media screen and (min-width: 64em) { 236 | .site-footer { 237 | font-size: 1rem; } } 238 | 239 | @media screen and (min-width: 42em) and (max-width: 64em) { 240 | .site-footer { 241 | font-size: 1rem; } } 242 | 243 | @media screen and (max-width: 42em) { 244 | .site-footer { 245 | font-size: 0.9rem; } } 246 | -------------------------------------------------------------------------------- /docs/Enums/ActionSheetControllerStyle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ActionSheetControllerStyle Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

ActionSheetControllerStyle

70 |
71 |
72 |
public enum ActionSheetControllerStyle: Int
73 | 74 |
75 |
76 |

The controller style determines the overall theme of the controller. Either White or Black.

77 | 78 |
79 |
80 |
81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | White 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    The white theme, with a light background.

    96 | 97 |
    98 |
    99 |

    Declaration

    100 |
    101 |

    Swift

    102 |
    case White
    103 | 104 |
    105 |
    106 |
    107 |
    108 |
  • 109 |
110 |
111 |
112 |
    113 |
  • 114 |
    115 | 116 | 117 | 118 | Black 119 | 120 |
    121 |
    122 |
    123 |
    124 |
    125 |
    126 |

    The black theme, with a dark background.

    127 | 128 |
    129 |
    130 |

    Declaration

    131 |
    132 |

    Swift

    133 |
    case Black
    134 | 135 |
    136 |
    137 |
    138 |
    139 |
  • 140 |
141 |
142 |
143 |
144 | 148 |
149 |
150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Enums/ActionSheetControllerStyle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ActionSheetControllerStyle Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

ActionSheetControllerStyle

70 |
71 |
72 |
public enum ActionSheetControllerStyle: Int
73 | 74 |
75 |
76 |

The controller style determines the overall theme of the controller. Either White or Black.

77 | 78 |
79 |
80 |
81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | White 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    The white theme, with a light background.

    96 | 97 |
    98 |
    99 |

    Declaration

    100 |
    101 |

    Swift

    102 |
    case White
    103 | 104 |
    105 |
    106 |
    107 |
    108 |
  • 109 |
110 |
111 |
112 |
    113 |
  • 114 |
    115 | 116 | 117 | 118 | Black 119 | 120 |
    121 |
    122 |
    123 |
    124 |
    125 |
    126 |

    The black theme, with a dark background.

    127 | 128 |
    129 |
    130 |

    Declaration

    131 |
    132 |

    Swift

    133 |
    case Black
    134 | 135 |
    136 |
    137 |
    138 |
    139 |
  • 140 |
141 |
142 |
143 |
144 | 148 |
149 |
150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /QueuedAlertPresenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QueuedAlertPresenter.swift 3 | // RandomReminders 4 | // 5 | // Created by Antonio Nunes on 29/02/16. 6 | // Copyright © 2016 SintraWorks. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is furnished 13 | // to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | import UIKit 27 | 28 | 29 | public typealias AlertActionHandler = () -> () 30 | 31 | /** 32 | An AlertAction instance encapsulates all the required information to create an alert action. 33 | */ 34 | public struct AlertAction { 35 | var title: String 36 | var style: UIAlertAction.Style 37 | var handler: AlertActionHandler? 38 | var enabled: Bool 39 | var isPreferredAction: Bool 40 | 41 | /** 42 | Initializes an AlertAction instance with the passed in values. All parameters have default values, so pass only those you need. 43 | - title: Optional title for the action. Defaults to an empty string. 44 | - style: Alert style (UIAlertActionStyle). Defaults to .Default 45 | - isPreferredAction: Whether the action is the preferred action of the alert. Defaults to false. 46 | - handler: Optional closure containing code to execute when the action is clicked. 47 | */ 48 | public init(title: String = "", style: UIAlertAction.Style = .default, enabled: Bool = true, isPreferredAction: Bool = false, handler: AlertActionHandler? = nil) { 49 | self.title = title 50 | self.style = style 51 | self.enabled = enabled 52 | self.isPreferredAction = isPreferredAction 53 | self.handler = handler 54 | } 55 | } 56 | 57 | 58 | /** 59 | An AlertInfo instance encapsulates all the required information to create an Alert, including its actions. 60 | */ 61 | public struct AlertInfo { 62 | var title: String? 63 | var message: String? 64 | var style: UIAlertController.Style 65 | var actions: [AlertAction]? 66 | 67 | /** 68 | Initializes an AlertInfo instance with the passed in values. All parameteres have default values, so pass only those you need. 69 | - title: Optional title for the alert. Defaults to an empty string. 70 | - message: Optional message body for the alert. Defaults to an empty string 71 | - style: Alert style (UIAlertControllerStyle). Defaults to .Alert 72 | - actions: Optional array of AlertActions. Defaults to nil. 73 | */ 74 | public init(title: String? = "", message: String? = "", style: UIAlertController.Style = .alert, actions: [AlertAction]? = nil) { 75 | self.title = title 76 | self.message = message 77 | self.style = style 78 | self.actions = actions 79 | } 80 | } 81 | 82 | 83 | /** 84 | A QueuedAlertPresenter serializes the presentation of alerts. Use it when your code needs to present alerts in rapid succession, where the user may not be able to keep up with the alerts. 85 | 86 | Using QueuedAlertPresenter instead of UIAlertController directly, ensures your user gets to see all the alerts your code creates. 87 | 88 | To present an alert create an instance of AlertInfo then add it to the sharedAlertPresenter with addAlert(alertInfo). 89 | AlertInfo holds the information for an individual alert you want to present. 90 | */ 91 | open class QueuedAlertPresenter { 92 | public static let sharedAlertPresenter = QueuedAlertPresenter() 93 | 94 | fileprivate var queuedAlerts = [AlertInfo]() 95 | fileprivate var presentedAlert: AlertInfo? 96 | 97 | /** 98 | Adds an alert to the alert queue, and triggers presentation of the queued alerts. 99 | */ 100 | open func addAlert(_ alertInfo: AlertInfo) { 101 | objc_sync_enter(self) 102 | defer { objc_sync_exit(self) } 103 | 104 | self.queuedAlerts.append(alertInfo) 105 | self.presentAlerts() 106 | } 107 | 108 | /** 109 | Presents queued alerts in succession. 110 | 111 | - Returns: true if an alert was presented, false if no alert was presented. 112 | */ 113 | @discardableResult fileprivate func presentAlerts() -> Bool { 114 | if self.presentedAlert == nil, 115 | let alertToPresent = self.queuedAlerts.first { 116 | self.presentedAlert = alertToPresent 117 | self.presentAlert(alertToPresent) 118 | return true 119 | } 120 | return false 121 | } 122 | 123 | 124 | fileprivate func presentAlert(_ alertInfo :AlertInfo) { 125 | let alertController = UIAlertController(title: alertInfo.title, message:alertInfo.message, preferredStyle: alertInfo.style) 126 | 127 | if let actions = alertInfo.actions { 128 | for infoAction in actions { 129 | let alertAction = UIAlertAction(title: infoAction.title, style: infoAction.style) { action -> Void in 130 | infoAction.handler?() 131 | 132 | self.presentedAlert = nil 133 | self.queuedAlerts.removeFirst() 134 | self.presentAlerts() 135 | } 136 | 137 | alertAction.isEnabled = infoAction.enabled 138 | alertController.addAction(alertAction) 139 | 140 | if #available(iOS 9.0, *) { 141 | if infoAction.isPreferredAction { 142 | alertController.preferredAction = alertAction 143 | } 144 | } 145 | } 146 | } 147 | 148 | self.validViewControllerForPresentation.presentViewControllerOnMainThread(alertController, animated: true, completion: nil) 149 | } 150 | 151 | 152 | // Ensure we present on a view controller that is neither being dismissed, nor presenting another view controller. 153 | fileprivate var validViewControllerForPresentation: UIViewController { 154 | guard 155 | let keyWindow = UIApplication.shared.windows.first(where: { $0.isKeyWindow }), 156 | let rootViewController = keyWindow.rootViewController else { fatalError("There is no root view controller on the key window") } 157 | var validController = UIViewController.topViewControllerForViewController(rootViewController) 158 | 159 | while validController.isBeingDismissed { 160 | guard let ancestor = validController.presentingViewController else { fatalError("Exhausted view controller hierarchy, while looking for a controller that is not being dismissed") } 161 | validController = ancestor 162 | } 163 | 164 | return validController 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /ActionSheetController/ActionControllerAnimationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActionControllerAnimationController.swift 3 | // ActionSheetController 4 | // 5 | // Created by Antonio Nunes on 17/05/2017. 6 | // Copyright © 2017 SintraWorks. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | internal enum ActionControllerAnimationStyle { 12 | case presenting 13 | case dismissing 14 | } 15 | 16 | // MARK: - Animation (only on .Phone idiom devices) 17 | class ActionControllerAnimationController: NSObject, UIViewControllerAnimatedTransitioning { 18 | internal var animationStyle: ActionControllerAnimationStyle = .presenting 19 | 20 | private let longTransitionDuration: TimeInterval = 1.5 21 | private let shortTransitionDuration: TimeInterval = 0.3 22 | 23 | func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 24 | let containerView = transitionContext.containerView 25 | 26 | if self.animationStyle == .presenting { 27 | guard let actionController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) as? ActionSheetController else { return } 28 | 29 | actionController.view.backgroundColor = .clear 30 | 31 | let effectView = actionController.backgroundView 32 | let mainView = actionController.view! 33 | 34 | // Condition commented out because the effect looks quite bad, even though I think this is how Apple wants us to implement this. 35 | // Fading in the background view instead, actually looks good in my tests, but the system logs a warning for doing it. 36 | // if let effectView = actionController.backgroundView as? UIVisualEffectView { 37 | // effectView.effect = nil 38 | // } else { 39 | effectView.alpha = 0.0 40 | // } 41 | 42 | containerView.addSubview(effectView) 43 | NSLayoutConstraint.activate([ 44 | effectView.leftAnchor.constraint(equalTo: containerView.leftAnchor), 45 | effectView.rightAnchor.constraint(equalTo: containerView.rightAnchor), 46 | effectView.heightAnchor.constraint(equalTo: containerView.heightAnchor), 47 | effectView.topAnchor.constraint(equalTo: containerView.topAnchor) 48 | ]) 49 | containerView.setNeedsUpdateConstraints() 50 | containerView.layoutIfNeeded() 51 | 52 | if let effectView = effectView as? UIVisualEffectView { 53 | effectView.contentView.addSubview(mainView) 54 | } else { 55 | effectView.addSubview(mainView) 56 | } 57 | 58 | NSLayoutConstraint.activate([ 59 | mainView.leftAnchor.constraint(equalTo: effectView.safeAreaLayoutGuide.leftAnchor), 60 | mainView.rightAnchor.constraint(equalTo: effectView.safeAreaLayoutGuide.rightAnchor), 61 | ]) 62 | 63 | mainView.centerXAnchor.constraint(equalTo: effectView.centerXAnchor).isActive = true 64 | mainView.widthAnchor.constraint(equalTo: effectView.widthAnchor).isActive = true 65 | mainView.heightAnchor.constraint(equalTo: effectView.heightAnchor).isActive = true 66 | let initialConstraint = mainView.topAnchor.constraint(equalTo: effectView.bottomAnchor) 67 | initialConstraint.isActive = true 68 | effectView.setNeedsUpdateConstraints() 69 | effectView.layoutIfNeeded() 70 | effectView.removeConstraint(initialConstraint) 71 | 72 | actionController.animationConstraint = mainView.bottomAnchor.constraint(equalTo: effectView.bottomAnchor) 73 | actionController.animationConstraint!.isActive = true 74 | 75 | containerView.setNeedsUpdateConstraints() 76 | 77 | var damping: CGFloat = 1.0 78 | var duration = shortTransitionDuration 79 | if !actionController.bouncingEffectsDisabled { 80 | damping = 0.6 81 | duration = longTransitionDuration 82 | } 83 | 84 | UIView.animate(withDuration: duration, delay: 0.0, usingSpringWithDamping: damping, initialSpringVelocity: 1.0, options: [.beginFromCurrentState, .allowUserInteraction], animations: { () -> Void in 85 | // Condition commented out because the effect looks quite bad, even though I think this is how Apple wants us to implement this. 86 | // Fading in the background view instead, actually looks good in my tests, but the system logs a warning for doing it. 87 | // if let effectView = actionController.backgroundView as? UIVisualEffectView { 88 | // effectView.effect = UIBlurEffect(style: actionController.backgroundBlurEffectStyleForCurrentStyle) 89 | // } else { 90 | effectView.alpha = 1.0 91 | // } 92 | effectView.layoutIfNeeded() 93 | }, completion: { (finished) -> Void in 94 | transitionContext.completeTransition(true) 95 | }) 96 | } else if self.animationStyle == .dismissing { 97 | if let actionController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from) as? ActionSheetController { 98 | let mainView = actionController.view 99 | let effectView = actionController.backgroundView 100 | 101 | effectView.removeConstraint(actionController.animationConstraint!) 102 | 103 | mainView?.topAnchor.constraint(equalTo: effectView.bottomAnchor).isActive = true 104 | containerView.setNeedsUpdateConstraints() 105 | 106 | UIView.animate(withDuration: shortTransitionDuration, delay: 0, options:[.beginFromCurrentState], animations:{ () -> Void in 107 | // Condition commented out because, the effect looks quite bad, even though I think this is how Apple wants us to implement this. 108 | // Fading in the background view instead, actually looks good in my tests, but the system logs a warning for doing it. 109 | // if let effectView = actionController.backgroundView as? UIVisualEffectView { 110 | // effectView.effect = nil 111 | // } else { 112 | actionController.backgroundView.alpha = 0.0 113 | // } 114 | containerView.layoutIfNeeded() 115 | }, completion: { (finished) -> Void in 116 | transitionContext.completeTransition(true) 117 | }) 118 | } 119 | } 120 | } 121 | 122 | func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 123 | if self.animationStyle == .presenting { 124 | let toViewController = transitionContext?.viewController(forKey: UITransitionContextViewControllerKey.to) 125 | if let actionController = toViewController as? ActionSheetController { 126 | if actionController.bouncingEffectsDisabled { 127 | return shortTransitionDuration 128 | } else { 129 | return longTransitionDuration 130 | } 131 | } 132 | } else if self.animationStyle == .dismissing { 133 | return shortTransitionDuration 134 | } 135 | 136 | return longTransitionDuration 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /docs/Enums.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Enums Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 65 |
66 |
67 |
68 |

Enums

69 |

The following enums are available globally.

70 | 71 |
72 |
73 |
74 |
75 | 76 | 77 | 78 |

Controller

79 |
80 |
81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | ActionSheetControllerStyle 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    The controller style determines the overall theme of the controller. Either White or Black.

    96 | 97 | See more 98 |
    99 |
    100 |

    Declaration

    101 |
    102 |

    Swift

    103 |
    public enum ActionSheetControllerStyle: Int
    104 | 105 |
    106 |
    107 |
    108 |
    109 |
  • 110 |
111 |
112 |
113 | 120 |
    121 |
  • 122 |
    123 | 124 | 125 | 126 | ActionSheetControllerActionStyle 127 | 128 |
    129 |
    130 |
    131 |
    132 |
    133 |
    134 |

    The action style determines the display properties and placement of the action button.

    135 | 136 | See more 137 |
    138 |
    139 |

    Declaration

    140 |
    141 |

    Swift

    142 |
    public enum ActionSheetControllerActionStyle
    143 | 144 |
    145 |
    146 |
    147 |
    148 |
  • 149 |
150 |
151 |
152 |
153 | 157 |
158 |
159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Enums.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Enums Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 65 |
66 |
67 |
68 |

Enums

69 |

The following enums are available globally.

70 | 71 |
72 |
73 |
74 |
75 | 76 | 77 | 78 |

Controller

79 |
80 |
81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | ActionSheetControllerStyle 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    The controller style determines the overall theme of the controller. Either White or Black.

    96 | 97 | See more 98 |
    99 |
    100 |

    Declaration

    101 |
    102 |

    Swift

    103 |
    public enum ActionSheetControllerStyle: Int
    104 | 105 |
    106 |
    107 |
    108 |
    109 |
  • 110 |
111 |
112 |
113 | 120 |
    121 |
  • 122 |
    123 | 124 | 125 | 126 | ActionSheetControllerActionStyle 127 | 128 |
    129 |
    130 |
    131 |
    132 |
    133 |
    134 |

    The action style determines the display properties and placement of the action button.

    135 | 136 | See more 137 |
    138 |
    139 |

    Declaration

    140 |
    141 |

    Swift

    142 |
    public enum ActionSheetControllerActionStyle
    143 | 144 |
    145 |
    146 |
    147 |
    148 |
  • 149 |
150 |
151 |
152 |
153 | 157 |
158 |
159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /docs/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; } 143 | .nav-group-task a { 144 | color: #888; } 145 | 146 | .main-content { 147 | background-color: #fff; 148 | border: 1px solid #e2e2e2; 149 | margin-left: 246px; 150 | position: absolute; 151 | overflow: hidden; 152 | padding-bottom: 60px; 153 | top: 70px; 154 | width: 734px; } 155 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 156 | margin-bottom: 1em; } 157 | .main-content p { 158 | line-height: 1.8em; } 159 | .main-content section .section:first-child { 160 | margin-top: 0; 161 | padding-top: 0; } 162 | .main-content section .task-group-section .task-group:first-of-type { 163 | padding-top: 10px; } 164 | .main-content section .task-group-section .task-group:first-of-type .section-name { 165 | padding-top: 15px; } 166 | 167 | .section { 168 | padding: 0 25px; } 169 | 170 | .highlight { 171 | background-color: #eee; 172 | padding: 10px 12px; 173 | border: 1px solid #e2e2e2; 174 | border-radius: 4px; 175 | overflow-x: auto; } 176 | 177 | .declaration .highlight { 178 | overflow-x: initial; 179 | padding: 0 40px 40px 0; 180 | margin-bottom: -25px; 181 | background-color: transparent; 182 | border: none; } 183 | 184 | .section-name { 185 | margin: 0; 186 | margin-left: 18px; } 187 | 188 | .task-group-section { 189 | padding-left: 6px; 190 | border-top: 1px solid #e2e2e2; } 191 | 192 | .task-group { 193 | padding-top: 0px; } 194 | 195 | .task-name-container a[name]:before { 196 | content: ""; 197 | display: block; 198 | padding-top: 70px; 199 | margin: -70px 0 0; } 200 | 201 | .item { 202 | padding-top: 8px; 203 | width: 100%; 204 | list-style-type: none; } 205 | .item a[name]:before { 206 | content: ""; 207 | display: block; 208 | padding-top: 70px; 209 | margin: -70px 0 0; } 210 | .item code { 211 | background-color: transparent; 212 | padding: 0; } 213 | .item .token { 214 | padding-left: 3px; 215 | margin-left: 15px; 216 | font-size: 11.9px; } 217 | .item .declaration-note { 218 | font-size: .85em; 219 | color: gray; 220 | font-style: italic; } 221 | 222 | .pointer-container { 223 | border-bottom: 1px solid #e2e2e2; 224 | left: -23px; 225 | padding-bottom: 13px; 226 | position: relative; 227 | width: 110%; } 228 | 229 | .pointer { 230 | background: #f9f9f9; 231 | border-left: 1px solid #e2e2e2; 232 | border-top: 1px solid #e2e2e2; 233 | height: 12px; 234 | left: 21px; 235 | top: -7px; 236 | -webkit-transform: rotate(45deg); 237 | -moz-transform: rotate(45deg); 238 | -o-transform: rotate(45deg); 239 | transform: rotate(45deg); 240 | position: absolute; 241 | width: 12px; } 242 | 243 | .height-container { 244 | display: none; 245 | left: -25px; 246 | padding: 0 25px; 247 | position: relative; 248 | width: 100%; 249 | overflow: hidden; } 250 | .height-container .section { 251 | background: #f9f9f9; 252 | border-bottom: 1px solid #e2e2e2; 253 | left: -25px; 254 | position: relative; 255 | width: 100%; 256 | padding-top: 10px; 257 | padding-bottom: 5px; } 258 | 259 | .aside, .language { 260 | padding: 6px 12px; 261 | margin: 12px 0; 262 | border-left: 5px solid #dddddd; 263 | overflow-y: hidden; } 264 | .aside .aside-title, .language .aside-title { 265 | font-size: 9px; 266 | letter-spacing: 2px; 267 | text-transform: uppercase; 268 | padding-bottom: 0; 269 | margin: 0; 270 | color: #aaa; 271 | -webkit-user-select: none; } 272 | .aside p:last-child, .language p:last-child { 273 | margin-bottom: 0; } 274 | 275 | .language { 276 | border-left: 5px solid #cde9f4; } 277 | .language .aside-title { 278 | color: #4b8afb; } 279 | 280 | .aside-warning { 281 | border-left: 5px solid #ff6666; } 282 | .aside-warning .aside-title { 283 | color: #ff0000; } 284 | 285 | .graybox { 286 | border-collapse: collapse; 287 | width: 100%; } 288 | .graybox p { 289 | margin: 0; 290 | word-break: break-word; 291 | min-width: 50px; } 292 | .graybox td { 293 | border: 1px solid #e2e2e2; 294 | padding: 5px 25px 5px 10px; 295 | vertical-align: middle; } 296 | .graybox tr td:first-of-type { 297 | text-align: right; 298 | padding: 7px; 299 | vertical-align: top; 300 | word-break: normal; 301 | width: 40px; } 302 | 303 | .slightly-smaller { 304 | font-size: 0.9em; } 305 | 306 | #footer { 307 | position: absolute; 308 | bottom: 10px; 309 | margin-left: 25px; } 310 | #footer p { 311 | margin: 0; 312 | color: #aaa; 313 | font-size: 0.8em; } 314 | 315 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 316 | display: none; } 317 | html.dash .main-content { 318 | width: 980px; 319 | margin-left: 0; 320 | border: none; 321 | width: 100%; 322 | top: 0; 323 | padding-bottom: 0; } 324 | html.dash .height-container { 325 | display: block; } 326 | html.dash .item .token { 327 | margin-left: 0; } 328 | html.dash .content-wrapper { 329 | width: auto; } 330 | html.dash #footer { 331 | position: static; } 332 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/css/jazzy.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { 2 | background: transparent; 3 | border: 0; 4 | margin: 0; 5 | outline: 0; 6 | padding: 0; 7 | vertical-align: baseline; } 8 | 9 | body { 10 | background-color: #f2f2f2; 11 | font-family: Helvetica, freesans, Arial, sans-serif; 12 | font-size: 14px; 13 | -webkit-font-smoothing: subpixel-antialiased; 14 | word-wrap: break-word; } 15 | 16 | h1, h2, h3 { 17 | margin-top: 0.8em; 18 | margin-bottom: 0.3em; 19 | font-weight: 100; 20 | color: black; } 21 | 22 | h1 { 23 | font-size: 2.5em; } 24 | 25 | h2 { 26 | font-size: 2em; 27 | border-bottom: 1px solid #e2e2e2; } 28 | 29 | h4 { 30 | font-size: 13px; 31 | line-height: 1.5; 32 | margin-top: 21px; } 33 | 34 | h5 { 35 | font-size: 1.1em; } 36 | 37 | h6 { 38 | font-size: 1.1em; 39 | color: #777; } 40 | 41 | .section-name { 42 | color: gray; 43 | display: block; 44 | font-family: Helvetica; 45 | font-size: 22px; 46 | font-weight: 100; 47 | margin-bottom: 15px; } 48 | 49 | pre, code { 50 | font: 0.95em Menlo, monospace; 51 | color: #777; 52 | word-wrap: normal; } 53 | 54 | p code, li code { 55 | background-color: #eee; 56 | padding: 2px 4px; 57 | border-radius: 4px; } 58 | 59 | a { 60 | color: #0088cc; 61 | text-decoration: none; } 62 | 63 | ul { 64 | padding-left: 15px; } 65 | 66 | li { 67 | line-height: 1.8em; } 68 | 69 | img { 70 | max-width: 100%; } 71 | 72 | blockquote { 73 | margin-left: 0; 74 | padding: 0 10px; 75 | border-left: 4px solid #ccc; } 76 | 77 | .content-wrapper { 78 | margin: 0 auto; 79 | width: 980px; } 80 | 81 | header { 82 | font-size: 0.85em; 83 | line-height: 26px; 84 | background-color: #414141; 85 | position: fixed; 86 | width: 100%; 87 | z-index: 1; } 88 | header img { 89 | padding-right: 6px; 90 | vertical-align: -4px; 91 | height: 16px; } 92 | header a { 93 | color: #fff; } 94 | header p { 95 | float: left; 96 | color: #999; } 97 | header .header-right { 98 | float: right; 99 | margin-left: 16px; } 100 | 101 | #breadcrumbs { 102 | background-color: #f2f2f2; 103 | height: 27px; 104 | padding-top: 17px; 105 | position: fixed; 106 | width: 100%; 107 | z-index: 1; 108 | margin-top: 26px; } 109 | #breadcrumbs #carat { 110 | height: 10px; 111 | margin: 0 5px; } 112 | 113 | .sidebar { 114 | background-color: #f9f9f9; 115 | border: 1px solid #e2e2e2; 116 | overflow-y: auto; 117 | overflow-x: hidden; 118 | position: fixed; 119 | top: 70px; 120 | bottom: 0; 121 | width: 230px; 122 | word-wrap: normal; } 123 | 124 | .nav-groups { 125 | list-style-type: none; 126 | background: #fff; 127 | padding-left: 0; } 128 | 129 | .nav-group-name { 130 | border-bottom: 1px solid #e2e2e2; 131 | font-size: 1.1em; 132 | font-weight: 100; 133 | padding: 15px 0 15px 20px; } 134 | .nav-group-name > a { 135 | color: #333; } 136 | 137 | .nav-group-tasks { 138 | margin-top: 5px; } 139 | 140 | .nav-group-task { 141 | font-size: 0.9em; 142 | list-style-type: none; } 143 | .nav-group-task a { 144 | color: #888; } 145 | 146 | .main-content { 147 | background-color: #fff; 148 | border: 1px solid #e2e2e2; 149 | margin-left: 246px; 150 | position: absolute; 151 | overflow: hidden; 152 | padding-bottom: 60px; 153 | top: 70px; 154 | width: 734px; } 155 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { 156 | margin-bottom: 1em; } 157 | .main-content p { 158 | line-height: 1.8em; } 159 | .main-content section .section:first-child { 160 | margin-top: 0; 161 | padding-top: 0; } 162 | .main-content section .task-group-section .task-group:first-of-type { 163 | padding-top: 10px; } 164 | .main-content section .task-group-section .task-group:first-of-type .section-name { 165 | padding-top: 15px; } 166 | 167 | .section { 168 | padding: 0 25px; } 169 | 170 | .highlight { 171 | background-color: #eee; 172 | padding: 10px 12px; 173 | border: 1px solid #e2e2e2; 174 | border-radius: 4px; 175 | overflow-x: auto; } 176 | 177 | .declaration .highlight { 178 | overflow-x: initial; 179 | padding: 0 40px 40px 0; 180 | margin-bottom: -25px; 181 | background-color: transparent; 182 | border: none; } 183 | 184 | .section-name { 185 | margin: 0; 186 | margin-left: 18px; } 187 | 188 | .task-group-section { 189 | padding-left: 6px; 190 | border-top: 1px solid #e2e2e2; } 191 | 192 | .task-group { 193 | padding-top: 0px; } 194 | 195 | .task-name-container a[name]:before { 196 | content: ""; 197 | display: block; 198 | padding-top: 70px; 199 | margin: -70px 0 0; } 200 | 201 | .item { 202 | padding-top: 8px; 203 | width: 100%; 204 | list-style-type: none; } 205 | .item a[name]:before { 206 | content: ""; 207 | display: block; 208 | padding-top: 70px; 209 | margin: -70px 0 0; } 210 | .item code { 211 | background-color: transparent; 212 | padding: 0; } 213 | .item .token { 214 | padding-left: 3px; 215 | margin-left: 15px; 216 | font-size: 11.9px; } 217 | .item .declaration-note { 218 | font-size: .85em; 219 | color: gray; 220 | font-style: italic; } 221 | 222 | .pointer-container { 223 | border-bottom: 1px solid #e2e2e2; 224 | left: -23px; 225 | padding-bottom: 13px; 226 | position: relative; 227 | width: 110%; } 228 | 229 | .pointer { 230 | background: #f9f9f9; 231 | border-left: 1px solid #e2e2e2; 232 | border-top: 1px solid #e2e2e2; 233 | height: 12px; 234 | left: 21px; 235 | top: -7px; 236 | -webkit-transform: rotate(45deg); 237 | -moz-transform: rotate(45deg); 238 | -o-transform: rotate(45deg); 239 | transform: rotate(45deg); 240 | position: absolute; 241 | width: 12px; } 242 | 243 | .height-container { 244 | display: none; 245 | left: -25px; 246 | padding: 0 25px; 247 | position: relative; 248 | width: 100%; 249 | overflow: hidden; } 250 | .height-container .section { 251 | background: #f9f9f9; 252 | border-bottom: 1px solid #e2e2e2; 253 | left: -25px; 254 | position: relative; 255 | width: 100%; 256 | padding-top: 10px; 257 | padding-bottom: 5px; } 258 | 259 | .aside, .language { 260 | padding: 6px 12px; 261 | margin: 12px 0; 262 | border-left: 5px solid #dddddd; 263 | overflow-y: hidden; } 264 | .aside .aside-title, .language .aside-title { 265 | font-size: 9px; 266 | letter-spacing: 2px; 267 | text-transform: uppercase; 268 | padding-bottom: 0; 269 | margin: 0; 270 | color: #aaa; 271 | -webkit-user-select: none; } 272 | .aside p:last-child, .language p:last-child { 273 | margin-bottom: 0; } 274 | 275 | .language { 276 | border-left: 5px solid #cde9f4; } 277 | .language .aside-title { 278 | color: #4b8afb; } 279 | 280 | .aside-warning { 281 | border-left: 5px solid #ff6666; } 282 | .aside-warning .aside-title { 283 | color: #ff0000; } 284 | 285 | .graybox { 286 | border-collapse: collapse; 287 | width: 100%; } 288 | .graybox p { 289 | margin: 0; 290 | word-break: break-word; 291 | min-width: 50px; } 292 | .graybox td { 293 | border: 1px solid #e2e2e2; 294 | padding: 5px 25px 5px 10px; 295 | vertical-align: middle; } 296 | .graybox tr td:first-of-type { 297 | text-align: right; 298 | padding: 7px; 299 | vertical-align: top; 300 | word-break: normal; 301 | width: 40px; } 302 | 303 | .slightly-smaller { 304 | font-size: 0.9em; } 305 | 306 | #footer { 307 | position: absolute; 308 | bottom: 10px; 309 | margin-left: 25px; } 310 | #footer p { 311 | margin: 0; 312 | color: #aaa; 313 | font-size: 0.8em; } 314 | 315 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar { 316 | display: none; } 317 | html.dash .main-content { 318 | width: 980px; 319 | margin-left: 0; 320 | border: none; 321 | width: 100%; 322 | top: 0; 323 | padding-bottom: 0; } 324 | html.dash .height-container { 325 | display: block; } 326 | html.dash .item .token { 327 | margin-left: 0; } 328 | html.dash .content-wrapper { 329 | width: auto; } 330 | html.dash #footer { 331 | position: static; } 332 | -------------------------------------------------------------------------------- /docs/Classes/ActionSheetControllerAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ActionSheetControllerAction Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

ActionSheetControllerAction

70 |
71 |
72 |
public class ActionSheetControllerAction
73 | 74 |
75 |
76 |

An ActionSheetControllerAction instance represents an action on the ActionSheetController that can be tapped by the user. 77 | It has a title or image for identifying the action and a handler which is called when the action has been tapped by the user.

78 | 79 |
80 |
81 |
82 |
    83 |
  • 84 |
    85 | 86 | 87 | 88 | image 89 | 90 |
    91 |
    92 |
    93 |
    94 |
    95 |
    96 |

    The action’s image. It will not be shown if the action also has a title.

    97 | 98 |
    99 |
    100 |

    Declaration

    101 |
    102 |

    Swift

    103 |
    public var image: UIImage?
    104 | 105 |
    106 |
    107 |
    108 |
    109 |
  • 110 |
  • 111 | 118 |
    119 |
    120 |
    121 |
    122 |
    123 |

    Provide at least a title or an image. (But not both. The title overrides the image.) 124 | If you want the action to dismiss the controller when clicked set dismissesActionController to true.

    125 | 126 |
    127 |
    128 |

    Declaration

    129 |
    130 |

    Swift

    131 |
    public init(style: ActionSheetControllerActionStyle = .Done, title: String? = nil, image: UIImage? = nil, dismissesActionController: Bool = false, handler:ActionSheetControllerActionHandler? = nil)
    132 | 133 |
    134 |
    135 |
    136 |
    137 |
  • 138 |
139 |
140 |
141 |
142 | 146 |
147 |
148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /docs/docsets/.docset/Contents/Resources/Documents/Classes/ActionSheetControllerAction.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ActionSheetControllerAction Class Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

ActionSheetControllerAction

70 |
71 |
72 |
public class ActionSheetControllerAction
73 | 74 |
75 |
76 |

An ActionSheetControllerAction instance represents an action on the ActionSheetController that can be tapped by the user. 77 | It has a title or image for identifying the action and a handler which is called when the action has been tapped by the user.

78 | 79 |
80 |
81 |
82 |
    83 |
  • 84 |
    85 | 86 | 87 | 88 | image 89 | 90 |
    91 |
    92 |
    93 |
    94 |
    95 |
    96 |

    The action’s image. It will not be shown if the action also has a title.

    97 | 98 |
    99 |
    100 |

    Declaration

    101 |
    102 |

    Swift

    103 |
    public var image: UIImage?
    104 | 105 |
    106 |
    107 |
    108 |
    109 |
  • 110 |
  • 111 | 118 |
    119 |
    120 |
    121 |
    122 |
    123 |

    Provide at least a title or an image. (But not both. The title overrides the image.) 124 | If you want the action to dismiss the controller when clicked set dismissesActionController to true.

    125 | 126 |
    127 |
    128 |

    Declaration

    129 |
    130 |

    Swift

    131 |
    public init(style: ActionSheetControllerActionStyle = .Done, title: String? = nil, image: UIImage? = nil, dismissesActionController: Bool = false, handler:ActionSheetControllerActionHandler? = nil)
    132 | 133 |
    134 |
    135 |
    136 |
    137 |
  • 138 |
139 |
140 |
141 |
142 | 146 |
147 |
148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /stylesheets/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 29 | * and Firefox. 30 | * Correct `block` display not defined for `main` in IE 11. 31 | */ 32 | 33 | article, 34 | aside, 35 | details, 36 | figcaption, 37 | figure, 38 | footer, 39 | header, 40 | hgroup, 41 | main, 42 | menu, 43 | nav, 44 | section, 45 | summary { 46 | display: block; 47 | } 48 | 49 | /** 50 | * 1. Correct `inline-block` display not defined in IE 8/9. 51 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 52 | */ 53 | 54 | audio, 55 | canvas, 56 | progress, 57 | video { 58 | display: inline-block; /* 1 */ 59 | vertical-align: baseline; /* 2 */ 60 | } 61 | 62 | /** 63 | * Prevent modern browsers from displaying `audio` without controls. 64 | * Remove excess height in iOS 5 devices. 65 | */ 66 | 67 | audio:not([controls]) { 68 | display: none; 69 | height: 0; 70 | } 71 | 72 | /** 73 | * Address `[hidden]` styling not present in IE 8/9/10. 74 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 75 | */ 76 | 77 | [hidden], 78 | template { 79 | display: none; 80 | } 81 | 82 | /* Links 83 | ========================================================================== */ 84 | 85 | /** 86 | * Remove the gray background color from active links in IE 10. 87 | */ 88 | 89 | a { 90 | background-color: transparent; 91 | } 92 | 93 | /** 94 | * Improve readability when focused and also mouse hovered in all browsers. 95 | */ 96 | 97 | a:active, 98 | a:hover { 99 | outline: 0; 100 | } 101 | 102 | /* Text-level semantics 103 | ========================================================================== */ 104 | 105 | /** 106 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 107 | */ 108 | 109 | abbr[title] { 110 | border-bottom: 1px dotted; 111 | } 112 | 113 | /** 114 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 115 | */ 116 | 117 | b, 118 | strong { 119 | font-weight: bold; 120 | } 121 | 122 | /** 123 | * Address styling not present in Safari and Chrome. 124 | */ 125 | 126 | dfn { 127 | font-style: italic; 128 | } 129 | 130 | /** 131 | * Address variable `h1` font-size and margin within `section` and `article` 132 | * contexts in Firefox 4+, Safari, and Chrome. 133 | */ 134 | 135 | h1 { 136 | font-size: 2em; 137 | margin: 0.67em 0; 138 | } 139 | 140 | /** 141 | * Address styling not present in IE 8/9. 142 | */ 143 | 144 | mark { 145 | background: #ff0; 146 | color: #000; 147 | } 148 | 149 | /** 150 | * Address inconsistent and variable font size in all browsers. 151 | */ 152 | 153 | small { 154 | font-size: 80%; 155 | } 156 | 157 | /** 158 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 159 | */ 160 | 161 | sub, 162 | sup { 163 | font-size: 75%; 164 | line-height: 0; 165 | position: relative; 166 | vertical-align: baseline; 167 | } 168 | 169 | sup { 170 | top: -0.5em; 171 | } 172 | 173 | sub { 174 | bottom: -0.25em; 175 | } 176 | 177 | /* Embedded content 178 | ========================================================================== */ 179 | 180 | /** 181 | * Remove border when inside `a` element in IE 8/9/10. 182 | */ 183 | 184 | img { 185 | border: 0; 186 | } 187 | 188 | /** 189 | * Correct overflow not hidden in IE 9/10/11. 190 | */ 191 | 192 | svg:not(:root) { 193 | overflow: hidden; 194 | } 195 | 196 | /* Grouping content 197 | ========================================================================== */ 198 | 199 | /** 200 | * Address margin not present in IE 8/9 and Safari. 201 | */ 202 | 203 | figure { 204 | margin: 1em 40px; 205 | } 206 | 207 | /** 208 | * Address differences between Firefox and other browsers. 209 | */ 210 | 211 | hr { 212 | box-sizing: content-box; 213 | height: 0; 214 | } 215 | 216 | /** 217 | * Contain overflow in all browsers. 218 | */ 219 | 220 | pre { 221 | overflow: auto; 222 | } 223 | 224 | /** 225 | * Address odd `em`-unit font size rendering in all browsers. 226 | */ 227 | 228 | code, 229 | kbd, 230 | pre, 231 | samp { 232 | font-family: monospace, monospace; 233 | font-size: 1em; 234 | } 235 | 236 | /* Forms 237 | ========================================================================== */ 238 | 239 | /** 240 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 241 | * styling of `select`, unless a `border` property is set. 242 | */ 243 | 244 | /** 245 | * 1. Correct color not being inherited. 246 | * Known issue: affects color of disabled elements. 247 | * 2. Correct font properties not being inherited. 248 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 249 | */ 250 | 251 | button, 252 | input, 253 | optgroup, 254 | select, 255 | textarea { 256 | color: inherit; /* 1 */ 257 | font: inherit; /* 2 */ 258 | margin: 0; /* 3 */ 259 | } 260 | 261 | /** 262 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 263 | */ 264 | 265 | button { 266 | overflow: visible; 267 | } 268 | 269 | /** 270 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 271 | * All other form control elements do not inherit `text-transform` values. 272 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 273 | * Correct `select` style inheritance in Firefox. 274 | */ 275 | 276 | button, 277 | select { 278 | text-transform: none; 279 | } 280 | 281 | /** 282 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 283 | * and `video` controls. 284 | * 2. Correct inability to style clickable `input` types in iOS. 285 | * 3. Improve usability and consistency of cursor style between image-type 286 | * `input` and others. 287 | */ 288 | 289 | button, 290 | html input[type="button"], /* 1 */ 291 | input[type="reset"], 292 | input[type="submit"] { 293 | -webkit-appearance: button; /* 2 */ 294 | cursor: pointer; /* 3 */ 295 | } 296 | 297 | /** 298 | * Re-set default cursor for disabled elements. 299 | */ 300 | 301 | button[disabled], 302 | html input[disabled] { 303 | cursor: default; 304 | } 305 | 306 | /** 307 | * Remove inner padding and border in Firefox 4+. 308 | */ 309 | 310 | button::-moz-focus-inner, 311 | input::-moz-focus-inner { 312 | border: 0; 313 | padding: 0; 314 | } 315 | 316 | /** 317 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 318 | * the UA stylesheet. 319 | */ 320 | 321 | input { 322 | line-height: normal; 323 | } 324 | 325 | /** 326 | * It's recommended that you don't attempt to style these elements. 327 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 328 | * 329 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 330 | * 2. Remove excess padding in IE 8/9/10. 331 | */ 332 | 333 | input[type="checkbox"], 334 | input[type="radio"] { 335 | box-sizing: border-box; /* 1 */ 336 | padding: 0; /* 2 */ 337 | } 338 | 339 | /** 340 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 341 | * `font-size` values of the `input`, it causes the cursor style of the 342 | * decrement button to change from `default` to `text`. 343 | */ 344 | 345 | input[type="number"]::-webkit-inner-spin-button, 346 | input[type="number"]::-webkit-outer-spin-button { 347 | height: auto; 348 | } 349 | 350 | /** 351 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 352 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 353 | * (include `-moz` to future-proof). 354 | */ 355 | 356 | input[type="search"] { 357 | -webkit-appearance: textfield; /* 1 */ /* 2 */ 358 | box-sizing: content-box; 359 | } 360 | 361 | /** 362 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 363 | * Safari (but not Chrome) clips the cancel button when the search input has 364 | * padding (and `textfield` appearance). 365 | */ 366 | 367 | input[type="search"]::-webkit-search-cancel-button, 368 | input[type="search"]::-webkit-search-decoration { 369 | -webkit-appearance: none; 370 | } 371 | 372 | /** 373 | * Define consistent border, margin, and padding. 374 | */ 375 | 376 | fieldset { 377 | border: 1px solid #c0c0c0; 378 | margin: 0 2px; 379 | padding: 0.35em 0.625em 0.75em; 380 | } 381 | 382 | /** 383 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 384 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 385 | */ 386 | 387 | legend { 388 | border: 0; /* 1 */ 389 | padding: 0; /* 2 */ 390 | } 391 | 392 | /** 393 | * Remove default vertical scrollbar in IE 8/9/10/11. 394 | */ 395 | 396 | textarea { 397 | overflow: auto; 398 | } 399 | 400 | /** 401 | * Don't inherit the `font-weight` (applied by a rule above). 402 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 403 | */ 404 | 405 | optgroup { 406 | font-weight: bold; 407 | } 408 | 409 | /* Tables 410 | ========================================================================== */ 411 | 412 | /** 413 | * Remove most spacing between table cells. 414 | */ 415 | 416 | table { 417 | border-collapse: collapse; 418 | border-spacing: 0; 419 | } 420 | 421 | td, 422 | th { 423 | padding: 0; 424 | } 425 | -------------------------------------------------------------------------------- /docs/Classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Classes Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

Docs (100% documented)

17 |

View on GitHub

18 |
19 |
20 |
21 | 26 |
27 |
28 | 65 |
66 |
67 |
68 |

Classes

69 |

The following classes are available globally.

70 | 71 |
72 |
73 |
74 |
75 | 76 | 77 | 78 |

Controller

79 |
80 |
81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | ActionSheetController 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    iOS control for presenting a view in a style reminiscent of an action sheet/alert. 96 | You can add a custom view, and any number of buttons to represent and handle actions.

    97 | 98 | See more 99 |
    100 |
    101 |

    Declaration

    102 |
    103 |

    Swift

    104 |
    public class ActionSheetController: UIViewController, UIViewControllerTransitioningDelegate, UIPopoverPresentationControllerDelegate
    105 | 106 |
    107 |
    108 |
    109 |
    110 |
  • 111 |
112 |
113 |
114 |
115 | 116 | 117 | 118 |

Individual Actions

119 |
120 |
121 |
    122 |
  • 123 |
    124 | 125 | 126 | 127 | ActionSheetControllerAction 128 | 129 |
    130 |
    131 |
    132 |
    133 |
    134 |
    135 |

    An ActionSheetControllerAction instance represents an action on the ActionSheetController that can be tapped by the user. 136 | It has a title or image for identifying the action and a handler which is called when the action has been tapped by the user.

    137 | 138 | See more 139 |
    140 |
    141 |

    Declaration

    142 |
    143 |

    Swift

    144 |
    public class ActionSheetControllerAction
    145 | 146 |
    147 |
    148 |
    149 |
    150 |
  • 151 |
152 |
153 |
154 |
155 | 156 | 157 | 158 |

Grouped Actions

159 |
160 |
161 |
    162 |
  • 163 |
    164 | 165 | 166 | 167 | GroupedActionSheetControllerAction 168 | 169 |
    170 |
    171 |
    172 |
    173 |
    174 |
    175 |

    A GroupedActionSheetControllerAction represents a grouping of ActionControllerActions.

    176 | 177 |

    An ActionSheetController uses one row for every action that has been added. GroupedActionSheetControllerAction enables showing multiple ActionControllerActions in one row.

    178 | 179 | See more 180 |
    181 |
    182 |

    Declaration

    183 |
    184 |

    Swift

    185 |
    public class GroupedActionSheetControllerAction: ActionSheetControllerAction
    186 | 187 |
    188 |
    189 |
    190 |
    191 |
  • 192 |
193 |
194 |
195 |
196 | 200 |
201 |
202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /docs/Enums/ActionSheetControllerActionStyle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ActionSheetControllerActionStyle Enum Reference 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Docs (100% documented)

18 |

View on GitHub

19 |
20 |
21 |
22 | 27 |
28 |
29 | 66 |
67 |
68 |
69 |

ActionSheetControllerActionStyle

70 |
71 |
72 |
public enum ActionSheetControllerActionStyle
73 | 74 |
75 |
76 |

The action style determines the display properties and placement of the action button.

77 | 78 |
79 |
80 |
81 |
    82 |
  • 83 |
    84 | 85 | 86 | 87 | Done 88 | 89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    The button is displayed with a regular font and positioned right below the content view.

    96 | 97 |
    98 |
    99 |

    Declaration

    100 |
    101 |

    Swift

    102 |
    case Done
    103 | 104 |
    105 |
    106 |
    107 |
    108 |
  • 109 |
110 |
111 |
112 |
    113 |
  • 114 |
    115 | 116 | 117 | 118 | Cancel 119 | 120 |
    121 |
    122 |
    123 |
    124 |
    125 |
    126 |

    The button is displayed with a bold font and positioned below all done buttons (or the content view if there are no done buttons).

    127 | 128 |
    129 |
    130 |

    Declaration

    131 |
    132 |

    Swift

    133 |
    case Cancel
    134 | 135 |
    136 |
    137 |
    138 |
    139 |
  • 140 |
141 |
142 |
143 |
    144 |
  • 145 |
    146 | 147 | 148 | 149 | Destructive 150 | 151 |
    152 |
    153 |
    154 |
    155 |
    156 |
    157 |

    The button is displayed with a standard font and positioned right below the content view. Currently only supported when blur effects are disabled.

    158 | 159 |
    160 |
    161 |

    Declaration

    162 |
    163 |

    Swift

    164 |
    case Destructive
    165 | 166 |
    167 |
    168 |
    169 |
    170 |
  • 171 |
172 |
173 |
174 |
    175 |
  • 176 |
    177 | 178 | 179 | 180 | Additional 181 | 182 |
    183 |
    184 |
    185 |
    186 |
    187 |
    188 |

    The button is displayed with a regular font and positioned above the content view.

    189 | 190 |
    191 |
    192 |

    Declaration

    193 |
    194 |

    Swift

    195 |
    case Additional
    196 | 197 |
    198 |
    199 |
    200 |
    201 |
  • 202 |
203 |
204 |
205 |
206 | 210 |
211 |
212 | 213 | 214 | 215 | --------------------------------------------------------------------------------