├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ ├── Private │ │ │ └── SWBufferedToast │ │ │ │ ├── SWBufferedToast.h │ │ │ │ ├── SWToast.h │ │ │ │ └── SWToastConstraintManager.h │ │ └── Public │ │ │ └── SWBufferedToast │ │ │ ├── SWBufferedToast.h │ │ │ ├── SWToast.h │ │ │ └── SWToastConstraintManager.h │ ├── Local Podspecs │ │ └── SWBufferedToast.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── Pods-SWBufferedToast-SWBufferedToast │ │ ├── Pods-SWBufferedToast-SWBufferedToast-Private.xcconfig │ │ ├── Pods-SWBufferedToast-SWBufferedToast-dummy.m │ │ ├── Pods-SWBufferedToast-SWBufferedToast-prefix.pch │ │ └── Pods-SWBufferedToast-SWBufferedToast.xcconfig │ │ ├── Pods-SWBufferedToast │ │ ├── Pods-SWBufferedToast-acknowledgements.markdown │ │ ├── Pods-SWBufferedToast-acknowledgements.plist │ │ ├── Pods-SWBufferedToast-dummy.m │ │ ├── Pods-SWBufferedToast-environment.h │ │ ├── Pods-SWBufferedToast-resources.sh │ │ ├── Pods-SWBufferedToast.debug.xcconfig │ │ └── Pods-SWBufferedToast.release.xcconfig │ │ ├── Pods-Tests-SWBufferedToast │ │ ├── Pods-Tests-SWBufferedToast-Private.xcconfig │ │ ├── Pods-Tests-SWBufferedToast-dummy.m │ │ ├── Pods-Tests-SWBufferedToast-prefix.pch │ │ └── Pods-Tests-SWBufferedToast.xcconfig │ │ └── Pods-Tests │ │ ├── Pods-Tests-acknowledgements.markdown │ │ ├── Pods-Tests-acknowledgements.plist │ │ ├── Pods-Tests-dummy.m │ │ ├── Pods-Tests-environment.h │ │ ├── Pods-Tests-resources.sh │ │ ├── Pods-Tests.debug.xcconfig │ │ └── Pods-Tests.release.xcconfig ├── SWBufferedToast.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── SWBufferedToast-Example.xcscheme ├── SWBufferedToast.xcworkspace │ └── contents.xcworkspacedata ├── SWBufferedToast │ ├── Base.lproj │ │ ├── Main_iPad.storyboard │ │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── ExampleBackground.imageset │ │ │ ├── Contents.json │ │ │ └── public-domain-images-free-stock-photos-apple-fruits-iphone-1.png │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── SWAppDelegate.h │ ├── SWAppDelegate.m │ ├── SWBufferedToast-Info.plist │ ├── SWBufferedToast-Prefix.pch │ ├── SWViewController.h │ ├── SWViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── Pod ├── Assets │ ├── .gitkeep │ ├── BufferMask.png │ ├── Bufferlines0001.png │ ├── Bufferlines0002.png │ ├── Bufferlines0003.png │ ├── Bufferlines0004.png │ ├── Bufferlines0005.png │ ├── Bufferlines0006.png │ ├── Bufferlines0007.png │ ├── Bufferlines0008.png │ ├── Bufferlines0009.png │ ├── Bufferlines0010.png │ ├── Bufferlines0011.png │ ├── Bufferlines0012.png │ ├── Bufferlines0013.png │ ├── Bufferlines0014.png │ ├── Bufferlines0015.png │ ├── Bufferlines0016.png │ ├── Bufferlines0017.png │ ├── Bufferlines0018.png │ ├── Bufferlines0019.png │ ├── Bufferlines0020.png │ ├── Bufferlines0021.png │ ├── Bufferlines0022.png │ ├── Bufferlines0023.png │ ├── Bufferlines0024.png │ ├── Bufferlines0025.png │ ├── Bufferlines0026.png │ ├── Bufferlines0027.png │ ├── Bufferlines0028.png │ ├── Bufferlines0029.png │ ├── Bufferlines0030.png │ ├── Bufferlines0031.png │ ├── Bufferlines0032.png │ ├── Bufferlines0033.png │ ├── Bufferlines0034.png │ ├── Bufferlines0035.png │ ├── Bufferlines0036.png │ ├── Bufferlines0037.png │ ├── Bufferlines0038.png │ ├── Bufferlines0039.png │ ├── Bufferlines0040.png │ ├── Bufferlines0041.png │ ├── Bufferlines0042.png │ ├── Bufferlines0043.png │ ├── Bufferlines0044.png │ ├── Bufferlines0045.png │ ├── Bufferlines0046.png │ ├── Bufferlines0047.png │ ├── Bufferlines0048.png │ ├── Bufferlines0049.png │ ├── Bufferlines0050.png │ ├── Bufferlines0051.png │ ├── Bufferlines0052.png │ ├── Bufferlines0053.png │ ├── Bufferlines0054.png │ ├── Bufferlines0055.png │ ├── Bufferlines0056.png │ ├── Bufferlines0057.png │ ├── Bufferlines0058.png │ ├── Bufferlines0059.png │ ├── Bufferlines0060.png │ ├── Bufferlines0061.png │ ├── Bufferlines0062.png │ ├── Bufferlines0063.png │ ├── Bufferlines0064.png │ ├── Bufferlines0065.png │ ├── Bufferlines0066.png │ ├── Bufferlines0067.png │ ├── Bufferlines0068.png │ ├── Bufferlines0069.png │ ├── Bufferlines0070.png │ ├── Bufferlines0071.png │ ├── Bufferlines0072.png │ ├── Bufferlines0073.png │ ├── Bufferlines0074.png │ ├── Bufferlines0075.png │ ├── Bufferlines0076.png │ ├── Bufferlines0077.png │ ├── Bufferlines0078.png │ ├── Bufferlines0079.png │ ├── Bufferlines0080.png │ ├── Bufferlines0081.png │ ├── Bufferlines0082.png │ ├── Bufferlines0083.png │ ├── Bufferlines0084.png │ ├── Bufferlines0085.png │ ├── Bufferlines0086.png │ ├── Bufferlines0087.png │ ├── Bufferlines0088.png │ ├── Bufferlines0089.png │ ├── Bufferlines0090.png │ ├── Bufferlines0091.png │ ├── Bufferlines0092.png │ ├── Bufferlines0093.png │ ├── Bufferlines0094.png │ ├── Bufferlines0095.png │ ├── Bufferlines0096.png │ ├── Bufferlines0097.png │ ├── Bufferlines0098.png │ ├── Bufferlines0099.png │ ├── Bufferlines0100.png │ ├── Bufferlines0101.png │ └── Bufferlines0102.png └── Classes │ ├── .gitkeep │ ├── SWBufferedToast.h │ ├── SWBufferedToast.m │ ├── SWToast.h │ ├── SWToast.m │ ├── SWToastConstraintManager.h │ └── SWToastConstraintManager.m ├── README.md ├── SWBufferedToast.podspec └── Screenshots ├── loginToast.png ├── noticeToast.png └── plainToast.png /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Note: if you ignore the Pods directory, make sure to uncomment 30 | # `pod install` in .travis.yml 31 | # 32 | # Pods/ 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | install: 12 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 13 | script: 14 | - set -o pipefail && xcodebuild test -workspace Example/SWBufferedToast.xcworkspace -scheme SWBufferedToast-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | target 'SWBufferedToast', :exclusive => true do 4 | pod "SWBufferedToast", :path => "../" 5 | end 6 | 7 | target 'Tests', :exclusive => true do 8 | pod "SWBufferedToast", :path => "../" 9 | 10 | 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SWBufferedToast (0.1.5) 3 | 4 | DEPENDENCIES: 5 | - SWBufferedToast (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | SWBufferedToast: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | SWBufferedToast: 276c19272fc588f4c6de7218aedb39423407d7a9 13 | 14 | COCOAPODS: 0.36.3 15 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/SWBufferedToast/SWBufferedToast.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SWBufferedToast.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/SWBufferedToast/SWToast.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SWToast.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/SWBufferedToast/SWToastConstraintManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SWToastConstraintManager.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SWBufferedToast/SWBufferedToast.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SWBufferedToast.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SWBufferedToast/SWToast.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SWToast.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SWBufferedToast/SWToastConstraintManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/SWToastConstraintManager.h -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/SWBufferedToast.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SWBufferedToast", 3 | "version": "0.1.5", 4 | "summary": "A simple UI class for presenting useful information to the user.", 5 | "description": "\n SWBufferedToast is a simple alert-style class for presenting information to the user.\n An SWBufferedToast can be instantiated with one of three types:\n \n Plain Toast\n A simple dismissable alert with a title, description and action button.\n\n Notice Toast\n An non-dismissable alert used to notify the user of an ongoing task. This alert cannot be dismissed by the user, but can be dismissed using a timer or by calling toast.dismiss.\n\n Login Toast\n A modal login window in the style of a toast.\n\n\n All three alert types have a buffering animation that can be turned on and off as necessary. Additionally, you can supply your own images for this buffering animation.\n\n If you wish to use your own animation images for the buffering state please be sure to add them to the \"Pods-SWBufferedToast-SWBufferedToast-SWBufferedToast\" target.\n\n", 6 | "homepage": "https://github.com/sfwalsh/SWBufferedToast", 7 | "license": "MIT", 8 | "authors": { 9 | "Stephen Walsh": "sw7891@hotmail.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/sfwalsh/SWBufferedToast.git", 13 | "tag": "0.1.5" 14 | }, 15 | "platforms": { 16 | "ios": "7.0" 17 | }, 18 | "requires_arc": true, 19 | "source_files": "Pod/Classes/**/*", 20 | "resource_bundles": { 21 | "SWBufferedToast": [ 22 | "Pod/Assets/*.png" 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SWBufferedToast (0.1.5) 3 | 4 | DEPENDENCIES: 5 | - SWBufferedToast (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | SWBufferedToast: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | SWBufferedToast: 276c19272fc588f4c6de7218aedb39423407d7a9 13 | 14 | COCOAPODS: 0.36.3 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast-SWBufferedToast/Pods-SWBufferedToast-SWBufferedToast-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-SWBufferedToast-SWBufferedToast.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SWBufferedToast" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SWBufferedToast" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast-SWBufferedToast/Pods-SWBufferedToast-SWBufferedToast-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SWBufferedToast_SWBufferedToast : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SWBufferedToast_SWBufferedToast 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast-SWBufferedToast/Pods-SWBufferedToast-SWBufferedToast-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-SWBufferedToast-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast-SWBufferedToast/Pods-SWBufferedToast-SWBufferedToast.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Example/Pods/Target Support Files/Pods-SWBufferedToast-SWBufferedToast/Pods-SWBufferedToast-SWBufferedToast.xcconfig -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SWBufferedToast 5 | 6 | Copyright (c) 2015 Stephen Walsh 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 | furnished 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 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2015 Stephen Walsh <stephenw@donedeal.ie> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | SWBufferedToast 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_SWBufferedToast : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_SWBufferedToast 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // SWBufferedToast 10 | #define COCOAPODS_POD_AVAILABLE_SWBufferedToast 11 | #define COCOAPODS_VERSION_MAJOR_SWBufferedToast 0 12 | #define COCOAPODS_VERSION_MINOR_SWBufferedToast 1 13 | #define COCOAPODS_VERSION_PATCH_SWBufferedToast 5 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES="" 10 | 11 | install_resource() 12 | { 13 | case $1 in 14 | *.storyboard) 15 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 16 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 17 | ;; 18 | *.xib) 19 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 20 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 21 | ;; 22 | *.framework) 23 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 26 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 27 | ;; 28 | *.xcdatamodel) 29 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 30 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 31 | ;; 32 | *.xcdatamodeld) 33 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 34 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 35 | ;; 36 | *.xcmappingmodel) 37 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 38 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 39 | ;; 40 | *.xcassets) 41 | XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'" 42 | ;; 43 | /*) 44 | echo "$1" 45 | echo "$1" >> "$RESOURCES_TO_COPY" 46 | ;; 47 | *) 48 | echo "${PODS_ROOT}/$1" 49 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 50 | ;; 51 | esac 52 | } 53 | if [[ "$CONFIGURATION" == "Debug" ]]; then 54 | install_resource "${BUILT_PRODUCTS_DIR}/SWBufferedToast.bundle" 55 | fi 56 | if [[ "$CONFIGURATION" == "Release" ]]; then 57 | install_resource "${BUILT_PRODUCTS_DIR}/SWBufferedToast.bundle" 58 | fi 59 | 60 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 61 | if [[ "${ACTION}" == "install" ]]; then 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | fi 64 | rm -f "$RESOURCES_TO_COPY" 65 | 66 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 67 | then 68 | case "${TARGETED_DEVICE_FAMILY}" in 69 | 1,2) 70 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 71 | ;; 72 | 1) 73 | TARGET_DEVICE_ARGS="--target-device iphone" 74 | ;; 75 | 2) 76 | TARGET_DEVICE_ARGS="--target-device ipad" 77 | ;; 78 | *) 79 | TARGET_DEVICE_ARGS="--target-device mac" 80 | ;; 81 | esac 82 | while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT") 83 | echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | fi 85 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SWBufferedToast" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SWBufferedToast" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-SWBufferedToast-SWBufferedToast" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SWBufferedToast" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SWBufferedToast" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-SWBufferedToast-SWBufferedToast" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SWBufferedToast/Pods-Tests-SWBufferedToast-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-Tests-SWBufferedToast.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SWBufferedToast" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SWBufferedToast" 4 | OTHER_LDFLAGS = -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SWBufferedToast/Pods-Tests-SWBufferedToast-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests_SWBufferedToast : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests_SWBufferedToast 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SWBufferedToast/Pods-Tests-SWBufferedToast-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-SWBufferedToast/Pods-Tests-SWBufferedToast.xcconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Example/Pods/Target Support Files/Pods-Tests-SWBufferedToast/Pods-Tests-SWBufferedToast.xcconfig -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SWBufferedToast 5 | 6 | Copyright (c) 2015 Stephen Walsh 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 | furnished 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 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2015 Stephen Walsh <stephenw@donedeal.ie> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | SWBufferedToast 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // SWBufferedToast 10 | #define COCOAPODS_POD_AVAILABLE_SWBufferedToast 11 | #define COCOAPODS_VERSION_MAJOR_SWBufferedToast 0 12 | #define COCOAPODS_VERSION_MINOR_SWBufferedToast 1 13 | #define COCOAPODS_VERSION_PATCH_SWBufferedToast 5 14 | 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES="" 10 | 11 | install_resource() 12 | { 13 | case $1 in 14 | *.storyboard) 15 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 16 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 17 | ;; 18 | *.xib) 19 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 20 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 21 | ;; 22 | *.framework) 23 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 26 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 27 | ;; 28 | *.xcdatamodel) 29 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 30 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 31 | ;; 32 | *.xcdatamodeld) 33 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 34 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 35 | ;; 36 | *.xcmappingmodel) 37 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 38 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 39 | ;; 40 | *.xcassets) 41 | XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'" 42 | ;; 43 | /*) 44 | echo "$1" 45 | echo "$1" >> "$RESOURCES_TO_COPY" 46 | ;; 47 | *) 48 | echo "${PODS_ROOT}/$1" 49 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 50 | ;; 51 | esac 52 | } 53 | if [[ "$CONFIGURATION" == "Debug" ]]; then 54 | install_resource "${BUILT_PRODUCTS_DIR}/SWBufferedToast.bundle" 55 | fi 56 | if [[ "$CONFIGURATION" == "Release" ]]; then 57 | install_resource "${BUILT_PRODUCTS_DIR}/SWBufferedToast.bundle" 58 | fi 59 | 60 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 61 | if [[ "${ACTION}" == "install" ]]; then 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | fi 64 | rm -f "$RESOURCES_TO_COPY" 65 | 66 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 67 | then 68 | case "${TARGETED_DEVICE_FAMILY}" in 69 | 1,2) 70 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 71 | ;; 72 | 1) 73 | TARGET_DEVICE_ARGS="--target-device iphone" 74 | ;; 75 | 2) 76 | TARGET_DEVICE_ARGS="--target-device ipad" 77 | ;; 78 | *) 79 | TARGET_DEVICE_ARGS="--target-device mac" 80 | ;; 81 | esac 82 | while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT") 83 | echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | fi 85 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SWBufferedToast" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SWBufferedToast" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-Tests-SWBufferedToast" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SWBufferedToast" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SWBufferedToast" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-Tests-SWBufferedToast" 5 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 6 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/SWBufferedToast.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 11 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 12 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 13 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 14 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 15 | 6003F59E195388D20070C39A /* SWAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWAppDelegate.m */; }; 16 | 6003F5A1195388D20070C39A /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6003F59F195388D20070C39A /* Main_iPhone.storyboard */; }; 17 | 6003F5A4195388D20070C39A /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A2195388D20070C39A /* Main_iPad.storyboard */; }; 18 | 6003F5A7195388D20070C39A /* SWViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWViewController.m */; }; 19 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 20 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 21 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 22 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 23 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 24 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 25 | A5A8E7C82B41615DAA06CAB5 /* libPods-SWBufferedToast.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B7333CC5896B115AEF081ECF /* libPods-SWBufferedToast.a */; }; 26 | E276A6E9220036B593CE4563 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FCDC48520BDE030EEF20B7A /* libPods-Tests.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 6003F582195388D10070C39A /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 6003F589195388D20070C39A; 35 | remoteInfo = SWBufferedToast; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 0FCDC48520BDE030EEF20B7A /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 1056EDB67879A82B7241919D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 42 | 287C13033B3631CA571738B6 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 43 | 4C073AE2646284842EA0CB65 /* Pods-SWBufferedToast.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SWBufferedToast.release.xcconfig"; path = "Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast.release.xcconfig"; sourceTree = ""; }; 44 | 4C2E489BAEFD2610DB44F22C /* SWBufferedToast.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SWBufferedToast.podspec; path = ../SWBufferedToast.podspec; sourceTree = ""; }; 45 | 5A94C88EF15957B6B7AFF24A /* Pods-SWBufferedToast.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SWBufferedToast.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast.debug.xcconfig"; sourceTree = ""; }; 46 | 6003F58A195388D20070C39A /* SWBufferedToast.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SWBufferedToast.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 48 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 49 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 50 | 6003F595195388D20070C39A /* SWBufferedToast-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SWBufferedToast-Info.plist"; sourceTree = ""; }; 51 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 52 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 53 | 6003F59B195388D20070C39A /* SWBufferedToast-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SWBufferedToast-Prefix.pch"; sourceTree = ""; }; 54 | 6003F59C195388D20070C39A /* SWAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWAppDelegate.h; sourceTree = ""; }; 55 | 6003F59D195388D20070C39A /* SWAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWAppDelegate.m; sourceTree = ""; }; 56 | 6003F5A0195388D20070C39A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 57 | 6003F5A3195388D20070C39A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 58 | 6003F5A5195388D20070C39A /* SWViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWViewController.h; sourceTree = ""; }; 59 | 6003F5A6195388D20070C39A /* SWViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWViewController.m; sourceTree = ""; }; 60 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 61 | 6003F5AE195388D20070C39A /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 63 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 64 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 65 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 66 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 67 | 694EE3EB72114E82E8BD6B60 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; 68 | B7333CC5896B115AEF081ECF /* libPods-SWBufferedToast.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SWBufferedToast.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | D9D248CFF273459F9EB68832 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 6003F587195388D20070C39A /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 78 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 79 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 80 | A5A8E7C82B41615DAA06CAB5 /* libPods-SWBufferedToast.a in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 6003F5AB195388D20070C39A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 89 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 90 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 91 | E276A6E9220036B593CE4563 /* libPods-Tests.a in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 3BDF2AA11531CC6AD8389584 /* Pods */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 5A94C88EF15957B6B7AFF24A /* Pods-SWBufferedToast.debug.xcconfig */, 102 | 4C073AE2646284842EA0CB65 /* Pods-SWBufferedToast.release.xcconfig */, 103 | D9D248CFF273459F9EB68832 /* Pods-Tests.debug.xcconfig */, 104 | 694EE3EB72114E82E8BD6B60 /* Pods-Tests.release.xcconfig */, 105 | ); 106 | name = Pods; 107 | sourceTree = ""; 108 | }; 109 | 6003F581195388D10070C39A = { 110 | isa = PBXGroup; 111 | children = ( 112 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 113 | 6003F593195388D20070C39A /* SWBufferedToast */, 114 | 6003F5B5195388D20070C39A /* Tests */, 115 | 6003F58C195388D20070C39A /* Frameworks */, 116 | 6003F58B195388D20070C39A /* Products */, 117 | 3BDF2AA11531CC6AD8389584 /* Pods */, 118 | ); 119 | sourceTree = ""; 120 | }; 121 | 6003F58B195388D20070C39A /* Products */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 6003F58A195388D20070C39A /* SWBufferedToast.app */, 125 | 6003F5AE195388D20070C39A /* Tests.xctest */, 126 | ); 127 | name = Products; 128 | sourceTree = ""; 129 | }; 130 | 6003F58C195388D20070C39A /* Frameworks */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 6003F58D195388D20070C39A /* Foundation.framework */, 134 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 135 | 6003F591195388D20070C39A /* UIKit.framework */, 136 | 6003F5AF195388D20070C39A /* XCTest.framework */, 137 | B7333CC5896B115AEF081ECF /* libPods-SWBufferedToast.a */, 138 | 0FCDC48520BDE030EEF20B7A /* libPods-Tests.a */, 139 | ); 140 | name = Frameworks; 141 | sourceTree = ""; 142 | }; 143 | 6003F593195388D20070C39A /* SWBufferedToast */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 6003F59C195388D20070C39A /* SWAppDelegate.h */, 147 | 6003F59D195388D20070C39A /* SWAppDelegate.m */, 148 | 6003F59F195388D20070C39A /* Main_iPhone.storyboard */, 149 | 6003F5A2195388D20070C39A /* Main_iPad.storyboard */, 150 | 6003F5A5195388D20070C39A /* SWViewController.h */, 151 | 6003F5A6195388D20070C39A /* SWViewController.m */, 152 | 6003F5A8195388D20070C39A /* Images.xcassets */, 153 | 6003F594195388D20070C39A /* Supporting Files */, 154 | ); 155 | path = SWBufferedToast; 156 | sourceTree = ""; 157 | }; 158 | 6003F594195388D20070C39A /* Supporting Files */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 6003F595195388D20070C39A /* SWBufferedToast-Info.plist */, 162 | 6003F596195388D20070C39A /* InfoPlist.strings */, 163 | 6003F599195388D20070C39A /* main.m */, 164 | 6003F59B195388D20070C39A /* SWBufferedToast-Prefix.pch */, 165 | ); 166 | name = "Supporting Files"; 167 | sourceTree = ""; 168 | }; 169 | 6003F5B5195388D20070C39A /* Tests */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 6003F5BB195388D20070C39A /* Tests.m */, 173 | 6003F5B6195388D20070C39A /* Supporting Files */, 174 | ); 175 | path = Tests; 176 | sourceTree = ""; 177 | }; 178 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 182 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 183 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 184 | ); 185 | name = "Supporting Files"; 186 | sourceTree = ""; 187 | }; 188 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 189 | isa = PBXGroup; 190 | children = ( 191 | 4C2E489BAEFD2610DB44F22C /* SWBufferedToast.podspec */, 192 | 1056EDB67879A82B7241919D /* README.md */, 193 | 287C13033B3631CA571738B6 /* LICENSE */, 194 | ); 195 | name = "Podspec Metadata"; 196 | sourceTree = ""; 197 | }; 198 | /* End PBXGroup section */ 199 | 200 | /* Begin PBXNativeTarget section */ 201 | 6003F589195388D20070C39A /* SWBufferedToast */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SWBufferedToast" */; 204 | buildPhases = ( 205 | 75BA7E062F1CF6132BAA6130 /* Check Pods Manifest.lock */, 206 | 6003F586195388D20070C39A /* Sources */, 207 | 6003F587195388D20070C39A /* Frameworks */, 208 | 6003F588195388D20070C39A /* Resources */, 209 | 1A203FEEB5E6332FA997A771 /* Copy Pods Resources */, 210 | ); 211 | buildRules = ( 212 | ); 213 | dependencies = ( 214 | ); 215 | name = SWBufferedToast; 216 | productName = SWBufferedToast; 217 | productReference = 6003F58A195388D20070C39A /* SWBufferedToast.app */; 218 | productType = "com.apple.product-type.application"; 219 | }; 220 | 6003F5AD195388D20070C39A /* Tests */ = { 221 | isa = PBXNativeTarget; 222 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */; 223 | buildPhases = ( 224 | B0A013BA983C886658812D98 /* Check Pods Manifest.lock */, 225 | 6003F5AA195388D20070C39A /* Sources */, 226 | 6003F5AB195388D20070C39A /* Frameworks */, 227 | 6003F5AC195388D20070C39A /* Resources */, 228 | D81FB32935B5F17C1704E186 /* Copy Pods Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 234 | ); 235 | name = Tests; 236 | productName = SWBufferedToastTests; 237 | productReference = 6003F5AE195388D20070C39A /* Tests.xctest */; 238 | productType = "com.apple.product-type.bundle.unit-test"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | 6003F582195388D10070C39A /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | CLASSPREFIX = SW; 247 | LastUpgradeCheck = 0510; 248 | ORGANIZATIONNAME = "Stephen Walsh"; 249 | TargetAttributes = { 250 | 6003F5AD195388D20070C39A = { 251 | TestTargetID = 6003F589195388D20070C39A; 252 | }; 253 | }; 254 | }; 255 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SWBufferedToast" */; 256 | compatibilityVersion = "Xcode 3.2"; 257 | developmentRegion = English; 258 | hasScannedForEncodings = 0; 259 | knownRegions = ( 260 | en, 261 | Base, 262 | ); 263 | mainGroup = 6003F581195388D10070C39A; 264 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | 6003F589195388D20070C39A /* SWBufferedToast */, 269 | 6003F5AD195388D20070C39A /* Tests */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 6003F588195388D20070C39A /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 6003F5A4195388D20070C39A /* Main_iPad.storyboard in Resources */, 280 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 281 | 6003F5A1195388D20070C39A /* Main_iPhone.storyboard in Resources */, 282 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | 6003F5AC195388D20070C39A /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | /* End PBXResourcesBuildPhase section */ 295 | 296 | /* Begin PBXShellScriptBuildPhase section */ 297 | 1A203FEEB5E6332FA997A771 /* Copy Pods Resources */ = { 298 | isa = PBXShellScriptBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | ); 302 | inputPaths = ( 303 | ); 304 | name = "Copy Pods Resources"; 305 | outputPaths = ( 306 | ); 307 | runOnlyForDeploymentPostprocessing = 0; 308 | shellPath = /bin/sh; 309 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SWBufferedToast/Pods-SWBufferedToast-resources.sh\"\n"; 310 | showEnvVarsInLog = 0; 311 | }; 312 | 75BA7E062F1CF6132BAA6130 /* Check Pods Manifest.lock */ = { 313 | isa = PBXShellScriptBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | ); 317 | inputPaths = ( 318 | ); 319 | name = "Check Pods Manifest.lock"; 320 | outputPaths = ( 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | shellPath = /bin/sh; 324 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 325 | showEnvVarsInLog = 0; 326 | }; 327 | B0A013BA983C886658812D98 /* Check Pods Manifest.lock */ = { 328 | isa = PBXShellScriptBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | ); 332 | inputPaths = ( 333 | ); 334 | name = "Check Pods Manifest.lock"; 335 | outputPaths = ( 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | shellPath = /bin/sh; 339 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 340 | showEnvVarsInLog = 0; 341 | }; 342 | D81FB32935B5F17C1704E186 /* Copy Pods Resources */ = { 343 | isa = PBXShellScriptBuildPhase; 344 | buildActionMask = 2147483647; 345 | files = ( 346 | ); 347 | inputPaths = ( 348 | ); 349 | name = "Copy Pods Resources"; 350 | outputPaths = ( 351 | ); 352 | runOnlyForDeploymentPostprocessing = 0; 353 | shellPath = /bin/sh; 354 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; 355 | showEnvVarsInLog = 0; 356 | }; 357 | /* End PBXShellScriptBuildPhase section */ 358 | 359 | /* Begin PBXSourcesBuildPhase section */ 360 | 6003F586195388D20070C39A /* Sources */ = { 361 | isa = PBXSourcesBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | 6003F59E195388D20070C39A /* SWAppDelegate.m in Sources */, 365 | 6003F5A7195388D20070C39A /* SWViewController.m in Sources */, 366 | 6003F59A195388D20070C39A /* main.m in Sources */, 367 | ); 368 | runOnlyForDeploymentPostprocessing = 0; 369 | }; 370 | 6003F5AA195388D20070C39A /* Sources */ = { 371 | isa = PBXSourcesBuildPhase; 372 | buildActionMask = 2147483647; 373 | files = ( 374 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | }; 378 | /* End PBXSourcesBuildPhase section */ 379 | 380 | /* Begin PBXTargetDependency section */ 381 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 382 | isa = PBXTargetDependency; 383 | target = 6003F589195388D20070C39A /* SWBufferedToast */; 384 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 385 | }; 386 | /* End PBXTargetDependency section */ 387 | 388 | /* Begin PBXVariantGroup section */ 389 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 390 | isa = PBXVariantGroup; 391 | children = ( 392 | 6003F597195388D20070C39A /* en */, 393 | ); 394 | name = InfoPlist.strings; 395 | sourceTree = ""; 396 | }; 397 | 6003F59F195388D20070C39A /* Main_iPhone.storyboard */ = { 398 | isa = PBXVariantGroup; 399 | children = ( 400 | 6003F5A0195388D20070C39A /* Base */, 401 | ); 402 | name = Main_iPhone.storyboard; 403 | sourceTree = ""; 404 | }; 405 | 6003F5A2195388D20070C39A /* Main_iPad.storyboard */ = { 406 | isa = PBXVariantGroup; 407 | children = ( 408 | 6003F5A3195388D20070C39A /* Base */, 409 | ); 410 | name = Main_iPad.storyboard; 411 | sourceTree = ""; 412 | }; 413 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 414 | isa = PBXVariantGroup; 415 | children = ( 416 | 6003F5B9195388D20070C39A /* en */, 417 | ); 418 | name = InfoPlist.strings; 419 | sourceTree = ""; 420 | }; 421 | /* End PBXVariantGroup section */ 422 | 423 | /* Begin XCBuildConfiguration section */ 424 | 6003F5BD195388D20070C39A /* Debug */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | ALWAYS_SEARCH_USER_PATHS = NO; 428 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 429 | CLANG_CXX_LIBRARY = "libc++"; 430 | CLANG_ENABLE_MODULES = YES; 431 | CLANG_ENABLE_OBJC_ARC = YES; 432 | CLANG_WARN_BOOL_CONVERSION = YES; 433 | CLANG_WARN_CONSTANT_CONVERSION = YES; 434 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 435 | CLANG_WARN_EMPTY_BODY = YES; 436 | CLANG_WARN_ENUM_CONVERSION = YES; 437 | CLANG_WARN_INT_CONVERSION = YES; 438 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 439 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 440 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 441 | COPY_PHASE_STRIP = NO; 442 | GCC_C_LANGUAGE_STANDARD = gnu99; 443 | GCC_DYNAMIC_NO_PIC = NO; 444 | GCC_OPTIMIZATION_LEVEL = 0; 445 | GCC_PREPROCESSOR_DEFINITIONS = ( 446 | "DEBUG=1", 447 | "$(inherited)", 448 | ); 449 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 450 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 451 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 452 | GCC_WARN_UNDECLARED_SELECTOR = YES; 453 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 454 | GCC_WARN_UNUSED_FUNCTION = YES; 455 | GCC_WARN_UNUSED_VARIABLE = YES; 456 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 457 | ONLY_ACTIVE_ARCH = YES; 458 | SDKROOT = iphoneos; 459 | TARGETED_DEVICE_FAMILY = "1,2"; 460 | }; 461 | name = Debug; 462 | }; 463 | 6003F5BE195388D20070C39A /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | buildSettings = { 466 | ALWAYS_SEARCH_USER_PATHS = NO; 467 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 468 | CLANG_CXX_LIBRARY = "libc++"; 469 | CLANG_ENABLE_MODULES = YES; 470 | CLANG_ENABLE_OBJC_ARC = YES; 471 | CLANG_WARN_BOOL_CONVERSION = YES; 472 | CLANG_WARN_CONSTANT_CONVERSION = YES; 473 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INT_CONVERSION = YES; 477 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 478 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 479 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 480 | COPY_PHASE_STRIP = YES; 481 | ENABLE_NS_ASSERTIONS = NO; 482 | GCC_C_LANGUAGE_STANDARD = gnu99; 483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 485 | GCC_WARN_UNDECLARED_SELECTOR = YES; 486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 487 | GCC_WARN_UNUSED_FUNCTION = YES; 488 | GCC_WARN_UNUSED_VARIABLE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 490 | SDKROOT = iphoneos; 491 | TARGETED_DEVICE_FAMILY = "1,2"; 492 | VALIDATE_PRODUCT = YES; 493 | }; 494 | name = Release; 495 | }; 496 | 6003F5C0195388D20070C39A /* Debug */ = { 497 | isa = XCBuildConfiguration; 498 | baseConfigurationReference = 5A94C88EF15957B6B7AFF24A /* Pods-SWBufferedToast.debug.xcconfig */; 499 | buildSettings = { 500 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 501 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 502 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 503 | GCC_PREFIX_HEADER = "SWBufferedToast/SWBufferedToast-Prefix.pch"; 504 | INFOPLIST_FILE = "SWBufferedToast/SWBufferedToast-Info.plist"; 505 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 506 | PRODUCT_NAME = "$(TARGET_NAME)"; 507 | WRAPPER_EXTENSION = app; 508 | }; 509 | name = Debug; 510 | }; 511 | 6003F5C1195388D20070C39A /* Release */ = { 512 | isa = XCBuildConfiguration; 513 | baseConfigurationReference = 4C073AE2646284842EA0CB65 /* Pods-SWBufferedToast.release.xcconfig */; 514 | buildSettings = { 515 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 516 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 517 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 518 | GCC_PREFIX_HEADER = "SWBufferedToast/SWBufferedToast-Prefix.pch"; 519 | INFOPLIST_FILE = "SWBufferedToast/SWBufferedToast-Info.plist"; 520 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 521 | PRODUCT_NAME = "$(TARGET_NAME)"; 522 | WRAPPER_EXTENSION = app; 523 | }; 524 | name = Release; 525 | }; 526 | 6003F5C3195388D20070C39A /* Debug */ = { 527 | isa = XCBuildConfiguration; 528 | baseConfigurationReference = D9D248CFF273459F9EB68832 /* Pods-Tests.debug.xcconfig */; 529 | buildSettings = { 530 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SWBufferedToast.app/SWBufferedToast"; 531 | FRAMEWORK_SEARCH_PATHS = ( 532 | "$(SDKROOT)/Developer/Library/Frameworks", 533 | "$(inherited)", 534 | "$(DEVELOPER_FRAMEWORKS_DIR)", 535 | ); 536 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 537 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 538 | GCC_PREPROCESSOR_DEFINITIONS = ( 539 | "DEBUG=1", 540 | "$(inherited)", 541 | ); 542 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | TEST_HOST = "$(BUNDLE_LOADER)"; 545 | WRAPPER_EXTENSION = xctest; 546 | }; 547 | name = Debug; 548 | }; 549 | 6003F5C4195388D20070C39A /* Release */ = { 550 | isa = XCBuildConfiguration; 551 | baseConfigurationReference = 694EE3EB72114E82E8BD6B60 /* Pods-Tests.release.xcconfig */; 552 | buildSettings = { 553 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SWBufferedToast.app/SWBufferedToast"; 554 | FRAMEWORK_SEARCH_PATHS = ( 555 | "$(SDKROOT)/Developer/Library/Frameworks", 556 | "$(inherited)", 557 | "$(DEVELOPER_FRAMEWORKS_DIR)", 558 | ); 559 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 560 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 561 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 562 | PRODUCT_NAME = "$(TARGET_NAME)"; 563 | TEST_HOST = "$(BUNDLE_LOADER)"; 564 | WRAPPER_EXTENSION = xctest; 565 | }; 566 | name = Release; 567 | }; 568 | /* End XCBuildConfiguration section */ 569 | 570 | /* Begin XCConfigurationList section */ 571 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "SWBufferedToast" */ = { 572 | isa = XCConfigurationList; 573 | buildConfigurations = ( 574 | 6003F5BD195388D20070C39A /* Debug */, 575 | 6003F5BE195388D20070C39A /* Release */, 576 | ); 577 | defaultConfigurationIsVisible = 0; 578 | defaultConfigurationName = Release; 579 | }; 580 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SWBufferedToast" */ = { 581 | isa = XCConfigurationList; 582 | buildConfigurations = ( 583 | 6003F5C0195388D20070C39A /* Debug */, 584 | 6003F5C1195388D20070C39A /* Release */, 585 | ); 586 | defaultConfigurationIsVisible = 0; 587 | defaultConfigurationName = Release; 588 | }; 589 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */ = { 590 | isa = XCConfigurationList; 591 | buildConfigurations = ( 592 | 6003F5C3195388D20070C39A /* Debug */, 593 | 6003F5C4195388D20070C39A /* Release */, 594 | ); 595 | defaultConfigurationIsVisible = 0; 596 | defaultConfigurationName = Release; 597 | }; 598 | /* End XCConfigurationList section */ 599 | }; 600 | rootObject = 6003F582195388D10070C39A /* Project object */; 601 | } 602 | -------------------------------------------------------------------------------- /Example/SWBufferedToast.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/SWBufferedToast.xcodeproj/xcshareddata/xcschemes/SWBufferedToast-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/SWBufferedToast.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 37 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 36 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "60x60", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "29x29", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "40x40", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "76x76", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Example/SWBufferedToast/Images.xcassets/ExampleBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "public-domain-images-free-stock-photos-apple-fruits-iphone-1.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/SWBufferedToast/Images.xcassets/ExampleBackground.imageset/public-domain-images-free-stock-photos-apple-fruits-iphone-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Example/SWBufferedToast/Images.xcassets/ExampleBackground.imageset/public-domain-images-free-stock-photos-apple-fruits-iphone-1.png -------------------------------------------------------------------------------- /Example/SWBufferedToast/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/SWAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWAppDelegate.h 3 | // SWBufferedToast 4 | // 5 | // Created by CocoaPods on 04/02/2015. 6 | // Copyright (c) 2014 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SWAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/SWAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWAppDelegate.m 3 | // SWBufferedToast 4 | // 5 | // Created by CocoaPods on 04/02/2015. 6 | // Copyright (c) 2014 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import "SWAppDelegate.h" 10 | 11 | @implementation SWAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/SWBufferedToast-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/SWBufferedToast-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/SWViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWViewController.h 3 | // SWBufferedToast 4 | // 5 | // Created by Stephen Walsh on 04/02/2015. 6 | // Copyright (c) 2014 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SWBufferedToast/SWBufferedToast.h" 11 | 12 | @interface SWViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/SWViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWViewController.m 3 | // SWBufferedToast 4 | // 5 | // Created by Stephen Walsh on 04/02/2015. 6 | // Copyright (c) 2014 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import "SWViewController.h" 10 | 11 | @interface SWViewController () 12 | 13 | @property (nonatomic, strong) SWBufferedToast *plainToast; 14 | @property (nonatomic, strong) SWBufferedToast *loginToast; 15 | 16 | @property (nonatomic, readonly) UIColor *eggshellGreen; 17 | @property (nonatomic, readonly) UIColor *ectoplasmGreen; 18 | @property (nonatomic, readonly) UIColor *candyCaneRed; 19 | @property (nonatomic, readonly) UIColor *jarringBlue; 20 | 21 | @property (nonatomic, readonly) NSString *longRamble; 22 | @property (nonatomic, readonly) NSString *sheepleResponse; 23 | @property (nonatomic, readonly) NSString *jam; 24 | 25 | @end 26 | 27 | @implementation SWViewController 28 | 29 | 30 | #pragma mark - setup 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | } 35 | 36 | 37 | #pragma mark - nice colours. 38 | - (UIColor *)eggshellGreen 39 | { 40 | return [UIColor colorWithRed:114.0f/255.0f green:209.0f/255.0f blue:192.0f/255.0f alpha:1.0f]; 41 | } 42 | 43 | - (UIColor *)ectoplasmGreen 44 | { 45 | //Mmmmmm, tastes like spooks. 46 | return [UIColor colorWithRed:114.0f/255.0f green:209.0f/255.0f blue:192.0f/255.0f alpha:0.75f]; 47 | } 48 | 49 | - (UIColor *)candyCaneRed 50 | { 51 | return [UIColor colorWithRed:211.0f/255.0f green:59.0f/255.0f blue:66.0f/255.0f alpha:1.0f]; 52 | } 53 | 54 | - (UIColor *)jarringBlue 55 | { 56 | return [UIColor colorWithRed:0.0f/255.0f green:176.0f/255.0f blue:193.0f/255.0f alpha:0.75f]; 57 | } 58 | 59 | 60 | #pragma mark - strings 61 | - (NSString *)longRamble 62 | { 63 | return @"Did you know that breakfast is the most important meal of the day? Why don't you go to your kitchen right now and have some breakfast."; 64 | } 65 | 66 | - (NSString *)sheepleResponse 67 | { 68 | return @"Okay, I'll do that."; 69 | } 70 | 71 | - (NSString *)jam 72 | { 73 | return @"Waiting for user to apply jam..."; 74 | } 75 | 76 | 77 | #pragma mark - lethargic loaders 78 | - (SWBufferedToast *)plainToast 79 | { 80 | if (!_plainToast) { 81 | //Create a plain toast type. This toast is dismissable by swiping up and has an action button. 82 | //Implement the SWBufferedToastDelegate protocol to be notified of when the user taps the action button. 83 | _plainToast = [[SWBufferedToast alloc] initPlainToastWithTitle:@"Hello" 84 | subtitle:self.longRamble 85 | actionButtonText:self.sheepleResponse 86 | backgroundColor:self.ectoplasmGreen 87 | toastColor:self.eggshellGreen 88 | animationImageNames:nil 89 | andDelegate:self 90 | onView:self.view]; 91 | } 92 | 93 | return _plainToast; 94 | } 95 | 96 | - (SWBufferedToast *)loginToast 97 | { 98 | if (!_loginToast) { 99 | _loginToast = [[SWBufferedToast alloc] initLoginToastWithTitle:@"Login" 100 | usernameTitle:@"Username" 101 | passwordTitle:@"Password" 102 | doneTitle:@"Sign In" 103 | backgroundColour:self.ectoplasmGreen 104 | toastColor:self.candyCaneRed 105 | animationImageNames:nil andDelegate:self 106 | onView:self.view]; 107 | } 108 | 109 | return _loginToast; 110 | } 111 | 112 | 113 | #pragma mark - SWBufferedToastDelegate implementation 114 | - (void)didTapActionButtonWithToast:(SWBufferedToast *)toast 115 | { 116 | if (toast == self.plainToast) { 117 | [self.plainToast dismiss]; 118 | 119 | /** 120 | Display a notice toast type. This toast cannot be dismissed by the user and can either be dismissed when a task 121 | is completed (by calling [toast dismiss]) or after a timer has completed. 122 | **/ 123 | 124 | SWBufferedToast *noticeToast = [[SWBufferedToast alloc] initNoticeToastWithTitle:@"Get Your Toast" 125 | subtitle:self.jam 126 | timeToDisplay:10.0 127 | backgroundColour:self.jarringBlue 128 | toastColor:self.candyCaneRed 129 | animationImageNames:nil 130 | onView:self.view]; 131 | [noticeToast appear]; 132 | 133 | //Show the buffering state. You can supply your own images for the animation; if you don't a default animation will be used. 134 | [noticeToast beginLoading]; 135 | } 136 | } 137 | 138 | - (void)didAttemptLoginWithUsername:(NSString *)username 139 | andPassword:(NSString *)password 140 | withToast:(SWBufferedToast *)toast 141 | { 142 | if (toast == self.loginToast) { 143 | //Returns the values the user entered for their username and password. You should probably attempt a login at this point. 144 | [self.loginToast beginLoading]; 145 | //Once you have authed with your api you can dismiss the toast by calling 146 | // [self.loginToast dismiss]; 147 | } 148 | } 149 | 150 | - (void)didDismissToastView:(SWBufferedToast *)toast 151 | { 152 | //Called when a toast has been dismissed. 153 | } 154 | 155 | 156 | #pragma mark - actions 157 | - (IBAction)exampleButtonTapped:(id)sender 158 | { 159 | [self.plainToast appear]; 160 | } 161 | 162 | - (IBAction)didTapLoginButton:(id)sender 163 | { 164 | [self.loginToast appear]; 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/SWBufferedToast/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SWBufferedToast 4 | // 5 | // Created by Stephen Walsh on 04/02/2015. 6 | // Copyright (c) 2014 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SWAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every test case source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | 9 | 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWBufferedToastTests.m 3 | // SWBufferedToastTests 4 | // 5 | // Created by Stephen Walsh on 04/02/2015. 6 | // Copyright (c) 2014 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | ${TEST_EXAMPLE} 10 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Stephen Walsh 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Assets/BufferMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/BufferMask.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0001.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0002.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0003.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0004.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0005.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0006.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0007.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0008.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0009.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0010.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0011.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0012.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0013.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0014.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0015.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0016.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0017.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0018.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0019.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0020.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0021.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0022.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0023.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0024.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0025.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0026.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0027.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0028.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0029.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0030.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0031.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0032.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0033.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0034.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0035.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0036.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0037.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0038.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0039.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0040.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0041.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0042.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0043.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0044.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0045.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0046.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0047.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0048.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0049.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0050.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0051.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0052.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0052.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0053.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0054.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0055.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0056.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0057.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0058.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0059.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0060.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0061.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0062.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0063.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0064.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0065.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0066.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0067.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0068.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0069.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0070.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0071.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0072.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0073.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0073.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0074.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0074.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0075.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0076.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0077.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0077.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0078.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0079.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0080.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0081.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0081.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0082.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0082.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0083.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0083.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0084.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0085.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0086.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0087.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0088.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0089.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0090.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0091.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0092.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0093.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0093.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0094.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0095.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0095.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0096.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0097.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0097.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0098.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0099.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0100.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0101.png -------------------------------------------------------------------------------- /Pod/Assets/Bufferlines0102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Assets/Bufferlines0102.png -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/SWBufferedToast.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWBufferedToast.h 3 | // LoginTest 4 | // 5 | // Created by Stephen Walsh on 30/03/2015. 6 | // Copyright (c) 2015 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | @class SWBufferedToast; 10 | 11 | @protocol SWBufferedToastDelegate 12 | 13 | - (void)didTapActionButtonWithToast:(SWBufferedToast*)toast; 14 | - (void)didAttemptLoginWithUsername:(NSString*)username 15 | andPassword:(NSString*)password 16 | withToast:(SWBufferedToast*)toast; 17 | - (void)didDismissToastView:(SWBufferedToast*)toast; 18 | 19 | @end 20 | 21 | #import 22 | #import "SWToast.h" 23 | 24 | @interface SWBufferedToast : UIView 25 | 26 | @property (nonatomic, assign) BOOL isLocked; 27 | @property (nonatomic, weak) id delegate; 28 | 29 | - (instancetype)initPlainToastWithTitle:(NSString*)title 30 | subtitle:(NSString*)subtitle 31 | actionButtonText:(NSString*)dismissButtonText 32 | backgroundColor:(UIColor*)backgroundColor 33 | toastColor:(UIColor*)toastColor 34 | animationImageNames:(NSArray*)animationImageNames 35 | andDelegate:(id)delegate 36 | onView:(UIView*)parentView; 37 | 38 | - (instancetype)initLoginToastWithTitle:(NSString*)title 39 | usernameTitle:(NSString*)usernameTitle 40 | passwordTitle:(NSString*)passwordTitle 41 | doneTitle:(NSString*)doneTitle 42 | backgroundColour:(UIColor*)backgroundColor 43 | toastColor:(UIColor*)toastColor 44 | animationImageNames:(NSArray*)animationImageNames 45 | andDelegate:(id)delegate 46 | onView:(UIView*)parentView; 47 | 48 | - (instancetype)initNoticeToastWithTitle:(NSString*)title 49 | subtitle:(NSString*)subtitle 50 | timeToDisplay:(NSInteger)timeToDisplay 51 | backgroundColour:(UIColor*)backgroundColor 52 | toastColor:(UIColor*)toastColor 53 | animationImageNames:(NSArray*)animationImageNames 54 | onView:(UIView*)parentView; 55 | 56 | - (void)appear; 57 | - (void)dismiss; 58 | - (void)beginLoading; 59 | - (void)endLoading; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Pod/Classes/SWBufferedToast.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWBufferedToast.m 3 | // LoginTest 4 | // 5 | // Created by Stephen Walsh on 30/03/2015. 6 | // Copyright (c) 2015 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import "SWBufferedToast.h" 10 | 11 | @interface SWBufferedToast() 12 | 13 | @property (nonatomic, weak) UIView *parentView; 14 | @property (nonatomic, strong) SWToast *toastView; 15 | 16 | @property (nonatomic, strong) UIPanGestureRecognizer *panGestureRecognizer; 17 | @property (nonatomic, assign) float firstY; 18 | @property (nonatomic, assign) float firstX; 19 | @property (nonatomic, assign) NSInteger timeToDisplay; 20 | 21 | @property (nonatomic, strong) NSTimer *displayTimer; 22 | 23 | @end 24 | 25 | 26 | @implementation SWBufferedToast 27 | 28 | 29 | #pragma mark - initializers 30 | - (instancetype)initPlainToastWithTitle:(NSString *)title 31 | subtitle:(NSString *)subtitle 32 | actionButtonText:(NSString *)actionButtonText 33 | backgroundColor:(UIColor *)backgroundColor 34 | toastColor:(UIColor *)toastColor 35 | animationImageNames:(NSArray *)animationImageNames 36 | andDelegate:(id)delegate 37 | onView:(UIView *)parentView 38 | { 39 | self = [super init]; 40 | if (self) { 41 | self.backgroundColor = backgroundColor; 42 | self.parentView = parentView; 43 | self.toastView = [[SWToast alloc] initPlainToastWithColour:toastColor 44 | title:title 45 | subtitle:subtitle 46 | actionTitle:actionButtonText 47 | animationImageNames:animationImageNames 48 | plainDelegate:self 49 | andParent:self]; 50 | 51 | self.delegate = delegate; 52 | [self.toastView addGestureRecognizer:self.panGestureRecognizer]; 53 | } 54 | return self; 55 | } 56 | 57 | - (instancetype)initLoginToastWithTitle:(NSString *)title 58 | usernameTitle:(NSString *)usernameTitle 59 | passwordTitle:(NSString *)passwordTitle 60 | doneTitle:(NSString *)doneTitle 61 | backgroundColour:(UIColor *)backgroundColor 62 | toastColor:(UIColor *)toastColor 63 | animationImageNames:(NSArray *)animationImageNames 64 | andDelegate:(id)delegate 65 | onView:(UIView *)parentView 66 | { 67 | self = [super init]; 68 | if (self) { 69 | self.backgroundColor = backgroundColor; 70 | self.parentView = parentView; 71 | self.toastView = [[SWToast alloc] initLoginToastWithColour:toastColor 72 | title:title 73 | usernameTitle:usernameTitle 74 | passwordTitle:passwordTitle 75 | doneTitle:doneTitle 76 | animationImageNames:animationImageNames 77 | loginDelegate:self 78 | andParent:self]; 79 | 80 | self.delegate = delegate; 81 | [self.toastView addGestureRecognizer:self.panGestureRecognizer]; 82 | } 83 | return self; 84 | } 85 | 86 | - (instancetype)initNoticeToastWithTitle:(NSString *)title 87 | subtitle:(NSString*)subtitle 88 | timeToDisplay:(NSInteger)timeToDisplay 89 | backgroundColour:(UIColor *)backgroundColor 90 | toastColor:(UIColor *)toastColor 91 | animationImageNames:(NSArray*)animationImageNames 92 | onView:(UIView *)parentView 93 | { 94 | self = [super init]; 95 | if (self) { 96 | self.backgroundColor = backgroundColor; 97 | self.parentView = parentView; 98 | self.toastView = [[SWToast alloc] initNoticeToastWithColour:toastColor 99 | title:title 100 | subtitle:subtitle 101 | animationImageNames:animationImageNames 102 | andParent:self]; 103 | 104 | [self.toastView addGestureRecognizer:self.panGestureRecognizer]; 105 | self.timeToDisplay = timeToDisplay; 106 | } 107 | return self; 108 | } 109 | 110 | 111 | #pragma mark - lazy loaders 112 | - (UIPanGestureRecognizer *)panGestureRecognizer 113 | { 114 | if (!_panGestureRecognizer) { 115 | _panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(moveView:)]; 116 | } 117 | 118 | return _panGestureRecognizer; 119 | } 120 | 121 | 122 | #pragma mark - actions 123 | - (void)appear 124 | { 125 | self.alpha = 0; 126 | [self setupConstraints]; 127 | [UIView animateWithDuration:0.5 animations:^{ 128 | self.alpha = 1; 129 | 130 | } completion:^(BOOL finished) { 131 | if (finished) { 132 | [self.toastView appear]; 133 | if (self.toastView.toastType == SWBufferedToastTypeNotice) { 134 | [self setupDismissTimer]; 135 | } 136 | } 137 | }]; 138 | } 139 | 140 | - (void)dismiss 141 | { 142 | [UIView animateWithDuration:0.25 animations:^{ 143 | self.alpha = 0; 144 | [self.toastView disappear]; 145 | } completion:^(BOOL finished) { 146 | if (finished) { 147 | [self removeFromSuperview]; 148 | [self.delegate didDismissToastView:self]; 149 | } 150 | }]; 151 | } 152 | 153 | - (void)setupDismissTimer 154 | { 155 | if (self.timeToDisplay > 0) { 156 | self.displayTimer = [NSTimer scheduledTimerWithTimeInterval:self.timeToDisplay 157 | target:self 158 | selector:@selector(dismissNoticeToast:) 159 | userInfo:nil 160 | repeats:NO]; 161 | } 162 | } 163 | 164 | - (void)dismissNoticeToast:(id)sender 165 | { 166 | [self.displayTimer invalidate]; 167 | [self dismiss]; 168 | } 169 | 170 | - (void)beginLoading 171 | { 172 | [self.toastView showBuffer]; 173 | } 174 | 175 | - (void)endLoading 176 | { 177 | [self.toastView hideBuffer]; 178 | } 179 | 180 | - (void)moveView:(id)sender 181 | { 182 | if (!self.isLocked) { 183 | [self bringSubviewToFront:[(UIPanGestureRecognizer*)sender view]]; 184 | 185 | CGPoint translatedPoint = [(UIPanGestureRecognizer*)sender translationInView:self]; 186 | 187 | if ([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateBegan) { 188 | self.firstX = self.toastView.center.x; 189 | self.firstY = self.toastView.center.y; 190 | } 191 | 192 | translatedPoint = CGPointMake(self.firstX, self.firstY + translatedPoint.y); 193 | 194 | [self.toastView setCenter:translatedPoint]; 195 | 196 | if ([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateEnded) { 197 | CGFloat velocityX = (0.2*[(UIPanGestureRecognizer*)sender velocityInView:self].x); 198 | 199 | CGFloat finalX = self.firstX; 200 | CGFloat finalY = self.firstY; 201 | 202 | if (self.toastView.isLoading && self.toastView.loadingBlocksDismiss) { 203 | CGFloat animationDuration = (ABS(velocityX)*.0002)+.2; 204 | [UIView animateWithDuration:animationDuration+1 205 | delay:0 206 | usingSpringWithDamping:0.25f 207 | initialSpringVelocity:10.0f 208 | options:UIViewAnimationOptionCurveEaseOut 209 | animations:^{ 210 | [[sender view] setCenter:CGPointMake(finalX, finalY)]; 211 | } completion:nil]; 212 | } 213 | else{ 214 | if (self.toastView.center.y < (self.frame.size.height/2 - (self.frame.size.height/4)) 215 | && ((self.toastView.toastType == SWBufferedToastTypeLogin) || (self.toastView.toastType == SWBufferedToastTypePlain))) { 216 | [self dismiss]; 217 | } 218 | else{ 219 | CGFloat animationDuration = (ABS(velocityX)*.0002)+.2; 220 | [UIView animateWithDuration:animationDuration+1 221 | delay:0 222 | usingSpringWithDamping:0.25f 223 | initialSpringVelocity:10.0f 224 | options:UIViewAnimationOptionCurveEaseOut 225 | animations:^{ 226 | [[sender view] setCenter:CGPointMake(finalX, finalY)]; 227 | } completion:nil]; 228 | } 229 | } 230 | } 231 | } 232 | 233 | } 234 | 235 | 236 | #pragma mark - constraints 237 | - (void)setupConstraints 238 | { 239 | [self.parentView addSubview:self]; 240 | self.translatesAutoresizingMaskIntoConstraints = NO; 241 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:self 242 | attribute:NSLayoutAttributeWidth 243 | relatedBy:0 244 | toItem:self.parentView 245 | attribute:NSLayoutAttributeWidth 246 | multiplier:1.0 247 | constant:0]; 248 | 249 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:self 250 | attribute:NSLayoutAttributeHeight 251 | relatedBy:0 252 | toItem:self.parentView 253 | attribute:NSLayoutAttributeHeight 254 | multiplier:1.0 255 | constant:0]; 256 | 257 | NSLayoutConstraint *leadingConstraint = [NSLayoutConstraint constraintWithItem:self 258 | attribute:NSLayoutAttributeLeading 259 | relatedBy:NSLayoutRelationEqual 260 | toItem:self.parentView 261 | attribute:NSLayoutAttributeLeading 262 | multiplier:1.0f 263 | constant:0.f]; 264 | 265 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:self 266 | attribute:NSLayoutAttributeTop 267 | relatedBy:NSLayoutRelationEqual 268 | toItem:self.parentView 269 | attribute:NSLayoutAttributeTop 270 | multiplier:1.0f 271 | constant:0.f]; 272 | 273 | 274 | [self.parentView addConstraints:@[widthConstraint, heightConstraint, topConstraint, leadingConstraint]]; 275 | } 276 | 277 | 278 | #pragma mark - plain toast delegate impl 279 | - (void)actionButtonTapped 280 | { 281 | [self.delegate didTapActionButtonWithToast:self]; 282 | } 283 | 284 | 285 | #pragma mark - login toast delegate impl 286 | - (void)loginButtonTappedWithUsername:(NSString *)username 287 | andPassword:(NSString *)password 288 | { 289 | [self.delegate didAttemptLoginWithUsername:username 290 | andPassword:password 291 | withToast:self]; 292 | } 293 | 294 | 295 | #pragma mark - cleanup 296 | - (void)dealloc 297 | { 298 | self.delegate = nil; 299 | } 300 | 301 | @end 302 | -------------------------------------------------------------------------------- /Pod/Classes/SWToast.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWToast.h 3 | // LoginTest 4 | // 5 | // Created by Stephen Walsh on 30/03/2015. 6 | // Copyright (c) 2015 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol SWPlainToastDelegate 12 | 13 | - (void)actionButtonTapped; 14 | 15 | @end 16 | 17 | @protocol SWLoginToastDelegate 18 | 19 | - (void)loginButtonTappedWithUsername:(NSString*)username 20 | andPassword:(NSString*)password; 21 | 22 | @end 23 | 24 | typedef NS_ENUM(NSInteger, SWBufferedToastType) { 25 | SWBufferedToastTypePlain, 26 | SWBufferedToastTypeLogin, 27 | SWBufferedToastTypeNotice 28 | }; 29 | 30 | @interface SWToast : UIView 31 | 32 | @property (nonatomic, assign) SWBufferedToastType toastType; 33 | @property (nonatomic, assign) BOOL isLoading; 34 | @property (nonatomic, readonly) BOOL loadingBlocksDismiss; 35 | @property (nonatomic, weak) id plainToastDelegate; 36 | @property (nonatomic, weak) id loginToastDelegate; 37 | 38 | - (instancetype)initPlainToastWithColour:(UIColor*)color 39 | title:(NSString*)title 40 | subtitle:(NSString*)subtitle 41 | actionTitle:(NSString*)actionTitle 42 | animationImageNames:(NSArray*)animationImageNames 43 | plainDelegate:(id)delegate 44 | andParent:(UIView*)parentView; 45 | 46 | - (instancetype)initLoginToastWithColour:(UIColor*)color 47 | title:(NSString*)title 48 | usernameTitle:(NSString*)usernameTitle 49 | passwordTitle:(NSString*)passwordTitle 50 | doneTitle:(NSString*)doneTitle 51 | animationImageNames:(NSArray*)animationImageNames 52 | loginDelegate:(id)loginDelegate 53 | andParent:(UIView*)parentView; 54 | 55 | - (instancetype)initNoticeToastWithColour:(UIColor*)color 56 | title:(NSString*)title 57 | subtitle:(NSString*)subtitle 58 | animationImageNames:(NSArray*)animationImageNames 59 | andParent:(UIView*)parentView; 60 | 61 | - (void)appear; 62 | - (void)disappear; 63 | - (void)showBuffer; 64 | - (void)hideBuffer; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pod/Classes/SWToast.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWToast.m 3 | // LoginTest 4 | // 5 | // Created by Stephen Walsh on 30/03/2015. 6 | // Copyright (c) 2015 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import "SWToast.h" 10 | #import "SWToastConstraintManager.h" 11 | 12 | static float const kToastCornerRadius = 4.0f; 13 | static float const kAnimationDurationDisappear = 0.5f; 14 | static float const kAnimationDurationAppear = 1.0f; 15 | static float const kAnimationDurationBuffer = 2.0f; 16 | 17 | static NSString * const kBufferImageMaskName = @"BufferMask"; 18 | static NSString * const kBundlePath = @"SWBufferedToast"; 19 | 20 | @interface SWToast() 21 | 22 | @property (nonatomic, weak) SWBufferedToast *parentView; 23 | 24 | @property (nonatomic, readonly) NSArray *animationImageNames; 25 | @property (nonatomic, strong) NSMutableArray *defaultAnimationImageNames; 26 | @property (nonatomic, strong) NSMutableArray *userAnimationImageNames; 27 | 28 | @property (nonatomic, strong) NSLayoutConstraint *constraintY; 29 | @property (nonatomic, strong) UIImageView *bufferImage; 30 | @property (nonatomic, strong) UIImageView *bufferImageMask; 31 | @property (nonatomic, strong) UILabel *titleLabel; 32 | @property (nonatomic, strong) UILabel *subtitleLabel; 33 | @property (nonatomic, strong) UIButton *actionButton; 34 | @property (nonatomic, strong) UITextField *usernameField; 35 | @property (nonatomic, strong) UITextField *passwordField; 36 | @property (nonatomic, strong) NSBundle *bundle; 37 | 38 | @end 39 | 40 | @implementation SWToast 41 | 42 | 43 | #pragma mark - initializers 44 | - (instancetype)initPlainToastWithColour:(UIColor *)color 45 | title:(NSString *)title 46 | subtitle:(NSString *)subtitle 47 | actionTitle:(NSString *)actionTitle 48 | animationImageNames:(NSArray*)animationImageNames 49 | plainDelegate:(id)delegate 50 | andParent:(SWBufferedToast*)parentView 51 | { 52 | self = [super init]; 53 | 54 | if (self) { 55 | self.toastType = SWBufferedToastTypePlain; 56 | self.parentView = parentView; 57 | self.plainToastDelegate = delegate; 58 | 59 | self.backgroundColor = color; 60 | self.layer.cornerRadius = kToastCornerRadius; 61 | self.clipsToBounds = YES; 62 | 63 | 64 | self.userAnimationImageNames = [animationImageNames mutableCopy]; 65 | self.titleLabel.text = title; 66 | self.subtitleLabel.text = subtitle; 67 | [self.actionButton setTitle:actionTitle forState:UIControlStateNormal]; 68 | } 69 | 70 | return self; 71 | } 72 | 73 | - (instancetype)initLoginToastWithColour:(UIColor *)color 74 | title:(NSString *)title 75 | usernameTitle:(NSString *)usernameTitle 76 | passwordTitle:(NSString *)passwordTitle 77 | doneTitle:(NSString *)doneTitle 78 | animationImageNames:(NSArray *)animationImageNames 79 | loginDelegate:(id)loginDelegate 80 | andParent:(SWBufferedToast *)parentView 81 | { 82 | self = [super init]; 83 | 84 | if (self) { 85 | self.toastType = SWBufferedToastTypeLogin; 86 | self.parentView = parentView; 87 | self.loginToastDelegate = loginDelegate; 88 | 89 | self.backgroundColor = color; 90 | self.layer.cornerRadius = kToastCornerRadius; 91 | self.clipsToBounds = YES; 92 | 93 | self.userAnimationImageNames = [animationImageNames mutableCopy]; 94 | self.titleLabel.text = title; 95 | self.usernameField.placeholder = usernameTitle; 96 | self.passwordField.placeholder = passwordTitle; 97 | [self.actionButton setTitle:doneTitle forState:UIControlStateNormal]; 98 | } 99 | 100 | return self; 101 | } 102 | 103 | - (instancetype)initNoticeToastWithColour:(UIColor *)color 104 | title:(NSString *)title 105 | subtitle:(NSString*)subtitle 106 | animationImageNames:(NSArray*)animationImageNames 107 | andParent:(SWBufferedToast*)parentView 108 | { 109 | self = [super init]; 110 | 111 | if (self) { 112 | self.toastType = SWBufferedToastTypeNotice; 113 | self.parentView = parentView; 114 | 115 | self.backgroundColor = color; 116 | self.layer.cornerRadius = kToastCornerRadius; 117 | self.clipsToBounds = YES; 118 | 119 | self.userAnimationImageNames = [animationImageNames mutableCopy]; 120 | self.titleLabel.text = title; 121 | self.subtitleLabel.text = subtitle; 122 | } 123 | 124 | return self; 125 | } 126 | 127 | 128 | #pragma mark - lazy loaders 129 | - (NSBundle *)bundle 130 | { 131 | if (!_bundle) { 132 | NSBundle *bundle = [NSBundle bundleForClass:[self class]]; 133 | NSString *bundlePath = [bundle pathForResource:kBundlePath ofType:@"bundle"]; 134 | _bundle = [NSBundle bundleWithPath:bundlePath]; 135 | } 136 | return _bundle; 137 | } 138 | 139 | - (BOOL)loadingBlocksDismiss 140 | { 141 | switch (self.toastType) { 142 | case SWBufferedToastTypeLogin: 143 | return YES; 144 | break; 145 | default: 146 | return NO; 147 | break; 148 | } 149 | } 150 | 151 | - (UILabel *)titleLabel 152 | { 153 | if (!_titleLabel) { 154 | _titleLabel = [[UILabel alloc] init]; 155 | _titleLabel.textAlignment = NSTextAlignmentCenter; 156 | _titleLabel.textColor = [UIColor whiteColor]; 157 | _titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:24.0f]; 158 | } 159 | 160 | return _titleLabel; 161 | } 162 | 163 | - (UILabel *)subtitleLabel 164 | { 165 | if (!_subtitleLabel) { 166 | _subtitleLabel = [[UILabel alloc] init]; 167 | _subtitleLabel.textAlignment = NSTextAlignmentCenter; 168 | _subtitleLabel.textColor = [UIColor whiteColor]; 169 | _subtitleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:18.0f]; 170 | _subtitleLabel.numberOfLines = -1; 171 | } 172 | 173 | return _subtitleLabel; 174 | } 175 | 176 | - (UITextField *)usernameField 177 | { 178 | if (!_usernameField) { 179 | _usernameField = [[UITextField alloc] init]; 180 | _usernameField.textAlignment = NSTextAlignmentCenter; 181 | _usernameField.textColor = [UIColor whiteColor]; 182 | _usernameField.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:18.0f]; 183 | [_usernameField setTintColor:[UIColor whiteColor]]; 184 | _usernameField.delegate = self; 185 | } 186 | 187 | return _usernameField; 188 | } 189 | 190 | - (UITextField *)passwordField 191 | { 192 | if (!_passwordField) { 193 | _passwordField = [[UITextField alloc] init]; 194 | _passwordField.textAlignment = NSTextAlignmentCenter; 195 | _passwordField.textColor = [UIColor whiteColor]; 196 | _passwordField.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:18.0f]; 197 | [_passwordField setSecureTextEntry:YES]; 198 | [_passwordField setTintColor:[UIColor whiteColor]]; 199 | _passwordField.delegate = self; 200 | } 201 | 202 | return _passwordField; 203 | } 204 | 205 | - (UIButton *)actionButton 206 | { 207 | if (!_actionButton) { 208 | _actionButton = [[UIButton alloc] init]; 209 | [_actionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 210 | [_actionButton setTitleColor:[self darkerColorForColor:self.backgroundColor] forState:UIControlStateDisabled]; 211 | _actionButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:18.0f]; 212 | [_actionButton addTarget:self action:@selector(didTapActionButton:) forControlEvents:UIControlEventTouchUpInside]; 213 | } 214 | 215 | return _actionButton; 216 | } 217 | 218 | - (NSMutableArray *)defaultAnimationImageNames 219 | { 220 | if (!_defaultAnimationImageNames) { 221 | NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; 222 | formatter.numberStyle = NSNumberFormatterNoStyle; 223 | [formatter setMinimumIntegerDigits:4]; 224 | 225 | _defaultAnimationImageNames = [[NSMutableArray alloc] init]; 226 | 227 | for (int i = 1; i<101; i++) { 228 | NSString *imageNumber = [formatter stringFromNumber:[NSNumber numberWithInteger:i]]; 229 | NSString *imageName = [NSString stringWithFormat:@"Bufferlines%@", imageNumber]; 230 | [_defaultAnimationImageNames addObject:imageName]; 231 | } 232 | } 233 | 234 | return _defaultAnimationImageNames; 235 | } 236 | 237 | - (NSArray *)animationImageNames 238 | { 239 | if (!self.userAnimationImageNames) { 240 | return self.defaultAnimationImageNames; 241 | } 242 | else{ 243 | return self.userAnimationImageNames; 244 | } 245 | } 246 | 247 | - (UIImageView *)bufferImageMask 248 | { 249 | if (!_bufferImageMask) { 250 | UIImage *biMask = [[UIImage imageWithData:[NSData dataWithContentsOfURL:[self.bundle URLForResource:kBufferImageMaskName withExtension:@"png"]]] 251 | imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 252 | _bufferImageMask = [[UIImageView alloc] initWithImage:biMask]; 253 | _bufferImageMask.tintColor = self.backgroundColor; 254 | _bufferImage.clipsToBounds = YES; 255 | } 256 | 257 | return _bufferImageMask; 258 | } 259 | 260 | - (UIImageView *)bufferImage 261 | { 262 | if (!_bufferImage) { 263 | 264 | _bufferImage = [[UIImageView alloc] initWithImage:[UIImage new]]; 265 | 266 | NSMutableArray *images = [[NSMutableArray alloc] init]; 267 | for (int i = 0; i < self.animationImageNames.count; i++) { 268 | UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[self.bundle URLForResource:[self.animationImageNames objectAtIndex:i] withExtension:@"png"]]]; 269 | [images addObject:[self imageWithColour:[self darkerColorForColor:self.backgroundColor] andImage:image]]; 270 | } 271 | 272 | _bufferImage.animationImages = images; 273 | _bufferImage.animationDuration = kAnimationDurationBuffer; 274 | _bufferImage.animationRepeatCount = -1; 275 | _bufferImage.contentMode = UIViewContentModeScaleAspectFill; 276 | _bufferImage.clipsToBounds = YES; 277 | _bufferImage.tintColor = [self darkerColorForColor:self.backgroundColor]; 278 | } 279 | 280 | return _bufferImage; 281 | } 282 | 283 | 284 | #pragma mark - actions 285 | - (void)appear 286 | { 287 | switch (self.toastType) { 288 | case SWBufferedToastTypeNotice:{ 289 | [self appearAnimationNotice]; 290 | } 291 | break; 292 | case SWBufferedToastTypeLogin:{ 293 | [self appearAnimationLogin]; 294 | } 295 | break; 296 | default: { 297 | [self appearAnimationDefault]; 298 | } 299 | break; 300 | } 301 | } 302 | 303 | - (void)disappear 304 | { 305 | switch (self.toastType) { 306 | case SWBufferedToastTypeNotice:{ 307 | [self disappearAnimationNotice]; 308 | } 309 | break; 310 | default:{ 311 | [self disappearAnimationDefault]; 312 | } 313 | break; 314 | } 315 | } 316 | 317 | - (void)showBuffer 318 | { 319 | self.isLoading = YES; 320 | if (self.toastType == SWBufferedToastTypeLogin) { 321 | [self.usernameField setEnabled:NO]; 322 | [self.passwordField setEnabled:NO]; 323 | [self.actionButton setEnabled:NO]; 324 | } 325 | [self showBufferAnimation]; 326 | 327 | } 328 | 329 | - (void)hideBuffer 330 | { 331 | self.isLoading = NO; 332 | if (self.toastType == SWBufferedToastTypeLogin) { 333 | [self.usernameField setEnabled:YES]; 334 | [self.passwordField setEnabled:YES]; 335 | [self.actionButton setEnabled:YES]; 336 | } 337 | [self hideBufferAnimation]; 338 | 339 | } 340 | 341 | - (void)didTapActionButton:(id)sender 342 | { 343 | if(self.toastType == SWBufferedToastTypePlain){ 344 | [self performNoticeAction]; 345 | } 346 | else if (self.toastType == SWBufferedToastTypeLogin){ 347 | [self performLoginAction]; 348 | } 349 | } 350 | 351 | - (void)performNoticeAction 352 | { 353 | [self.plainToastDelegate actionButtonTapped]; 354 | } 355 | 356 | - (void)performLoginAction 357 | { 358 | [self.loginToastDelegate loginButtonTappedWithUsername:self.usernameField.text andPassword:self.passwordField.text]; 359 | [self updateLoginConstraintsToCenter]; 360 | [self endEditing:YES]; 361 | } 362 | 363 | 364 | #pragma mark - animation types 365 | - (void)appearAnimationNotice 366 | { 367 | self.alpha = 0; 368 | 369 | [self applyAllConstraints]; 370 | [self.parentView layoutIfNeeded]; 371 | self.constraintY.constant = 0; 372 | self.transform = CGAffineTransformMakeScale(0.7, 0.7); 373 | [UIView animateWithDuration:kAnimationDurationAppear 374 | delay:0 375 | usingSpringWithDamping:0.7f 376 | initialSpringVelocity:15.0f 377 | options:UIViewAnimationOptionCurveEaseOut 378 | animations:^{ 379 | self.transform = CGAffineTransformMakeScale(1.0, 1.0); 380 | self.alpha = 1; 381 | } completion:nil]; 382 | } 383 | 384 | - (void)appearAnimationLogin 385 | { 386 | [self applyAllConstraints]; 387 | [self.parentView layoutIfNeeded]; 388 | [self.usernameField becomeFirstResponder]; 389 | } 390 | 391 | - (void)appearAnimationDefault 392 | { 393 | [self applyAllConstraints]; 394 | [self.parentView layoutIfNeeded]; 395 | self.constraintY.constant = 0; 396 | [UIView animateWithDuration:kAnimationDurationAppear 397 | delay:0 398 | usingSpringWithDamping:0.7f 399 | initialSpringVelocity:15.0f 400 | options:UIViewAnimationOptionCurveEaseOut 401 | animations:^{ 402 | [self.parentView layoutIfNeeded]; 403 | } completion:nil]; 404 | } 405 | 406 | - (void)disappearAnimationNotice 407 | { 408 | self.alpha = 1; 409 | [UIView animateWithDuration:kAnimationDurationDisappear 410 | delay:0 411 | usingSpringWithDamping:0.7f 412 | initialSpringVelocity:15.0f 413 | options:0 414 | animations:^{ 415 | [self.parentView layoutIfNeeded]; 416 | self.transform = CGAffineTransformMakeScale(0.4, 0.4); 417 | self.alpha = 0; 418 | } completion:^(BOOL finished) { 419 | if (finished) { 420 | [self removeFromSuperview]; 421 | } 422 | }]; 423 | 424 | } 425 | 426 | - (void)disappearAnimationDefault 427 | { 428 | self.constraintY.constant = -self.parentView.frame.size.height; 429 | 430 | [UIView animateWithDuration:kAnimationDurationDisappear animations:^{ 431 | [self.parentView layoutIfNeeded]; 432 | } completion:^(BOOL finished) { 433 | if (finished) { 434 | [self removeFromSuperview]; 435 | } 436 | }]; 437 | } 438 | 439 | - (void)showBufferAnimation 440 | { 441 | if(self.animationImageNames){ 442 | self.bufferImage.alpha = 0.0f; 443 | [SWToastConstraintManager applyBufferMaskConstraintsForImageView:self.bufferImageMask onToast:self]; 444 | [SWToastConstraintManager applyBufferMaskConstraintsForImageView:self.bufferImage onToast:self]; 445 | 446 | [self.parentView layoutIfNeeded]; 447 | 448 | [UIView animateWithDuration:kAnimationDurationAppear animations:^{ 449 | self.bufferImage.alpha = 1.0f; 450 | [self.bufferImage startAnimating]; 451 | } completion:nil]; 452 | } 453 | } 454 | 455 | - (void)hideBufferAnimation 456 | { 457 | [UIView animateWithDuration:kAnimationDurationDisappear animations:^{ 458 | self.bufferImage.alpha = 0; 459 | } completion:^(BOOL finished) { 460 | if (finished) { 461 | [self.bufferImage stopAnimating]; 462 | [self.bufferImage removeFromSuperview]; 463 | [self.bufferImageMask removeFromSuperview]; 464 | } 465 | }]; 466 | } 467 | 468 | 469 | #pragma constraints 470 | - (void)applyAllConstraints 471 | { 472 | self.constraintY = [SWToastConstraintManager applyViewConstraintsForToast:self andParentView:self.parentView]; 473 | [SWToastConstraintManager applyTitleConstraintsForLabel:self.titleLabel onToast:self]; 474 | if (self.toastType == SWBufferedToastTypePlain) { 475 | [SWToastConstraintManager applyButtonConstraintsForButton:self.actionButton onToast:self]; 476 | [SWToastConstraintManager applySubtitleConstraintsForLabel:self.subtitleLabel toTitleLabel:self.titleLabel andActionButton:self.actionButton onToast:self]; 477 | } 478 | else if (self.toastType == SWBufferedToastTypeLogin){ 479 | [SWToastConstraintManager applyTextfieldConstraintsForUsernameField:self.usernameField toTitleLabel:self.titleLabel onToast:self]; 480 | [SWToastConstraintManager applyTextfieldConstraintsForPasswordField:self.passwordField toUsernameField:self.usernameField onToast:self]; 481 | [SWToastConstraintManager applyButtonConstraintsForButton:self.actionButton onToast:self]; 482 | } 483 | else{ 484 | [SWToastConstraintManager applySubtitleConstraintsForLabel:self.subtitleLabel toTitleLabel:self.titleLabel onToast:self]; 485 | } 486 | } 487 | 488 | - (void)updateLoginConstraintsToCenter 489 | { 490 | self.constraintY.constant = 0; 491 | [UIView animateWithDuration:kAnimationDurationAppear 492 | delay:0 493 | usingSpringWithDamping:0.7f 494 | initialSpringVelocity:15.0f 495 | options:UIViewAnimationOptionCurveEaseOut 496 | animations:^{ 497 | [self.parentView layoutIfNeeded]; 498 | } completion:nil]; 499 | } 500 | 501 | - (void)updateLoginConstraintsForUsername 502 | { 503 | [self.parentView layoutIfNeeded]; 504 | self.constraintY.constant = -75; 505 | [UIView animateWithDuration:kAnimationDurationAppear 506 | delay:0 507 | usingSpringWithDamping:0.7f 508 | initialSpringVelocity:15.0f 509 | options:UIViewAnimationOptionCurveEaseOut 510 | animations:^{ 511 | [self.parentView layoutIfNeeded]; 512 | } completion:nil]; 513 | } 514 | 515 | - (void)updateLoginConstraintsForPassword 516 | { 517 | [self.parentView layoutIfNeeded]; 518 | self.constraintY.constant = -95; 519 | [UIView animateWithDuration:kAnimationDurationAppear 520 | delay:0 521 | usingSpringWithDamping:0.7f 522 | initialSpringVelocity:15.0f 523 | options:UIViewAnimationOptionCurveEaseOut 524 | animations:^{ 525 | [self.parentView layoutIfNeeded]; 526 | } completion:nil]; 527 | } 528 | 529 | 530 | #pragma mark - UITextField delegate impl 531 | - (void)textFieldDidBeginEditing:(UITextField *)textField 532 | { 533 | if (textField == self.usernameField) { 534 | [self updateLoginConstraintsForUsername]; 535 | } 536 | else if (textField == self.passwordField){ 537 | [self updateLoginConstraintsForPassword]; 538 | } 539 | } 540 | 541 | 542 | #pragma mark - helpers 543 | - (UIImage *)imageWithColour:(UIColor *) color andImage:(UIImage *)image 544 | { 545 | UIGraphicsBeginImageContextWithOptions(image.size, false, image.scale); 546 | CGContextRef context = UIGraphicsGetCurrentContext(); 547 | CGContextTranslateCTM(context, 0, image.size.height); 548 | CGContextScaleCTM(context, 1.0, -1.0); 549 | CGContextSetBlendMode(context, kCGBlendModeNormal); 550 | CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height); 551 | CGContextClipToMask(context, rect, image.CGImage); 552 | [color setFill]; 553 | CGContextFillRect(context, rect); 554 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 555 | UIGraphicsEndImageContext(); 556 | 557 | return newImage; 558 | } 559 | 560 | - (UIColor *)darkerColorForColor:(UIColor *)c 561 | { 562 | CGFloat r, g, b, a; 563 | if ([c getRed:&r green:&g blue:&b alpha:&a]) 564 | return [UIColor colorWithRed:MAX(r - 0.1, 0.0) 565 | green:MAX(g - 0.1, 0.0) 566 | blue:MAX(b - 0.1, 0.0) 567 | alpha:a]; 568 | return [UIColor blackColor]; 569 | } 570 | 571 | 572 | #pragma mark - cleanup 573 | - (void)dealloc 574 | { 575 | self.plainToastDelegate = nil; 576 | self.loginToastDelegate = nil; 577 | } 578 | 579 | @end 580 | -------------------------------------------------------------------------------- /Pod/Classes/SWToastConstraintManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // SWToastConstraintManager.h 3 | // LoginTest 4 | // 5 | // Created by Stephen Walsh on 31/03/2015. 6 | // Copyright (c) 2015 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SWToast.h" 11 | #import "SWBufferedToast.h" 12 | 13 | @interface SWToastConstraintManager : NSObject 14 | 15 | + (NSLayoutConstraint*)applyViewConstraintsForToast:(SWToast *)toast 16 | andParentView:(SWBufferedToast *)parentView; 17 | 18 | + (void)applyBufferMaskConstraintsForImageView:(UIImageView *)imageView 19 | onToast:(SWToast *)toast; 20 | 21 | + (void)applyTitleConstraintsForLabel:(UILabel *)label 22 | onToast:(SWToast *)toast; 23 | 24 | + (void)applySubtitleConstraintsForLabel:(UILabel *)label 25 | toTitleLabel:(UILabel *)titleLabel 26 | onToast:(SWToast *)toast; 27 | 28 | + (void)applySubtitleConstraintsForLabel:(UILabel *)label 29 | toTitleLabel:(UILabel *)titleLabel 30 | andActionButton:(UIButton *)actionButton 31 | onToast:(SWToast *)toast; 32 | 33 | + (void)applyTextfieldConstraintsForUsernameField:(UITextField *)usernameField 34 | toTitleLabel:(UILabel *)titleLabel 35 | onToast:(SWToast *)toast; 36 | 37 | + (void)applyTextfieldConstraintsForPasswordField:(UITextField *)passwordField 38 | toUsernameField:(UITextField *)usernameField 39 | onToast:(SWToast *)toast; 40 | 41 | + (void)applyButtonConstraintsForButton:(UIButton *)button 42 | onToast:(SWToast *)toast; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Pod/Classes/SWToastConstraintManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // SWToastConstraintManager.m 3 | // LoginTest 4 | // 5 | // Created by Stephen Walsh on 31/03/2015. 6 | // Copyright (c) 2015 Stephen Walsh. All rights reserved. 7 | // 8 | 9 | #import "SWToastConstraintManager.h" 10 | 11 | #define IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad 12 | #define IPHONE UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone 13 | 14 | #define kPlainToastMultiplierWidth (IPAD ? 0.5f : 0.7f); 15 | #define kPlainToastMultiplerHeight (IPAD ? 0.3f : 0.55f); 16 | #define kLoginToastMultiplierWidth (IPAD ? 0.7f : 0.9f); 17 | #define kLoginToastMultiplierHeight (IPAD ? 0.25f : 0.50f); 18 | #define kNoticeToastHeight 180.0f; 19 | #define KNoticeToastWidth 300.0f; 20 | #define kMultiplierBufferHeight 0.8f; 21 | #define kLabelHeightTitle 40.0f; 22 | #define kButtonHeightAction 70.0f; 23 | #define kTextfieldHeightUsername 70.0f; 24 | #define kTextfieldHeightPassword 70.0f; 25 | #define kTextfieldTitleDistance -10.0f; 26 | #define kLoginToastHeight (IPAD ? 220.0f : 200.0f); 27 | 28 | 29 | @implementation SWToastConstraintManager 30 | 31 | + (NSLayoutConstraint*)applyViewConstraintsForToast:(SWToast *)toast 32 | andParentView:(SWBufferedToast *)parentView 33 | { 34 | switch (toast.toastType) { 35 | case SWBufferedToastTypeLogin: 36 | { 37 | [parentView addSubview:toast]; 38 | toast.translatesAutoresizingMaskIntoConstraints = NO; 39 | //Add view's constraints 40 | float width = kLoginToastMultiplierWidth; 41 | float height = kLoginToastHeight; 42 | NSLayoutConstraint *widthConstraint; 43 | 44 | if (IPAD) { 45 | widthConstraint = [NSLayoutConstraint constraintWithItem:toast 46 | attribute:NSLayoutAttributeWidth 47 | relatedBy:0 48 | toItem:nil 49 | attribute:NSLayoutAttributeNotAnAttribute 50 | multiplier:1.0f 51 | constant:300]; 52 | } 53 | else{ 54 | widthConstraint = [NSLayoutConstraint constraintWithItem:toast 55 | attribute:NSLayoutAttributeWidth 56 | relatedBy:0 57 | toItem:parentView 58 | attribute:NSLayoutAttributeWidth 59 | multiplier:width 60 | constant:0]; 61 | } 62 | 63 | 64 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:toast 65 | attribute:NSLayoutAttributeHeight 66 | relatedBy:0 67 | toItem:nil 68 | attribute:NSLayoutAttributeNotAnAttribute 69 | multiplier:1.0f 70 | constant:height]; 71 | 72 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:toast 73 | attribute:NSLayoutAttributeCenterX 74 | relatedBy:NSLayoutRelationEqual 75 | toItem:parentView 76 | attribute:NSLayoutAttributeCenterX 77 | multiplier:1.0f 78 | constant:0]; 79 | 80 | NSLayoutConstraint *constraintY = [NSLayoutConstraint constraintWithItem:toast 81 | attribute:NSLayoutAttributeCenterY 82 | relatedBy:NSLayoutRelationEqual 83 | toItem:parentView 84 | attribute:NSLayoutAttributeCenterY 85 | multiplier:1.0f 86 | constant:-height]; 87 | 88 | 89 | [parentView addConstraints:@[widthConstraint, heightConstraint, constraintX, constraintY]]; 90 | return constraintY; 91 | } 92 | break; 93 | 94 | case SWBufferedToastTypeNotice: 95 | { 96 | [parentView addSubview:toast]; 97 | toast.translatesAutoresizingMaskIntoConstraints = NO; 98 | //Add view's constraints 99 | float width = KNoticeToastWidth; 100 | float height = kNoticeToastHeight; 101 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:toast 102 | attribute:NSLayoutAttributeWidth 103 | relatedBy:0 104 | toItem:nil 105 | attribute:NSLayoutAttributeNotAnAttribute 106 | multiplier:1.0f 107 | constant:width]; 108 | 109 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:toast 110 | attribute:NSLayoutAttributeHeight 111 | relatedBy:0 112 | toItem:nil 113 | attribute:NSLayoutAttributeNotAnAttribute 114 | multiplier:1.0f 115 | constant:height]; 116 | 117 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:toast 118 | attribute:NSLayoutAttributeCenterX 119 | relatedBy:NSLayoutRelationEqual 120 | toItem:parentView 121 | attribute:NSLayoutAttributeCenterX 122 | multiplier:1.0f 123 | constant:0]; 124 | 125 | NSLayoutConstraint *constraintY = [NSLayoutConstraint constraintWithItem:toast 126 | attribute:NSLayoutAttributeCenterY 127 | relatedBy:NSLayoutRelationEqual 128 | toItem:parentView 129 | attribute:NSLayoutAttributeCenterY 130 | multiplier:1.0f 131 | constant:-(parentView.frame.size.height+height)]; 132 | 133 | 134 | [parentView addConstraints:@[widthConstraint, heightConstraint, constraintX, constraintY]]; 135 | return constraintY; 136 | } 137 | break; 138 | 139 | default: 140 | { 141 | [parentView addSubview:toast]; 142 | toast.translatesAutoresizingMaskIntoConstraints = NO; 143 | 144 | float width = kPlainToastMultiplierWidth; 145 | float height = kPlainToastMultiplerHeight; 146 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:toast 147 | attribute:NSLayoutAttributeWidth 148 | relatedBy:0 149 | toItem:parentView 150 | attribute:NSLayoutAttributeWidth 151 | multiplier:width 152 | constant:0]; 153 | 154 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:toast 155 | attribute:NSLayoutAttributeHeight 156 | relatedBy:0 157 | toItem:parentView 158 | attribute:NSLayoutAttributeHeight 159 | multiplier:height 160 | constant:0]; 161 | 162 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:toast 163 | attribute:NSLayoutAttributeCenterX 164 | relatedBy:NSLayoutRelationEqual 165 | toItem:parentView 166 | attribute:NSLayoutAttributeCenterX 167 | multiplier:1.0f 168 | constant:0]; 169 | 170 | NSLayoutConstraint *constraintY = [NSLayoutConstraint constraintWithItem:toast 171 | attribute:NSLayoutAttributeCenterY 172 | relatedBy:NSLayoutRelationEqual 173 | toItem:parentView 174 | attribute:NSLayoutAttributeCenterY 175 | multiplier:1.0f 176 | constant:-(parentView.frame.size.height*height)]; 177 | 178 | 179 | [parentView addConstraints:@[widthConstraint, heightConstraint, constraintX, constraintY]]; 180 | return constraintY; 181 | } 182 | break; 183 | } 184 | 185 | return nil; 186 | } 187 | 188 | + (void)applyBufferMaskConstraintsForImageView:(UIImageView *)imageView 189 | onToast:(SWToast *)toast 190 | { 191 | [toast insertSubview:imageView atIndex:0]; 192 | imageView.translatesAutoresizingMaskIntoConstraints = NO; 193 | imageView.userInteractionEnabled = NO; 194 | float height = kMultiplierBufferHeight; 195 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:imageView 196 | attribute:NSLayoutAttributeWidth 197 | relatedBy:0 198 | toItem:toast 199 | attribute:NSLayoutAttributeWidth 200 | multiplier:1 201 | constant:0]; 202 | 203 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:imageView 204 | attribute:NSLayoutAttributeHeight 205 | relatedBy:0 206 | toItem:toast 207 | attribute:NSLayoutAttributeHeight 208 | multiplier:height 209 | constant:0]; 210 | 211 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:imageView 212 | attribute:NSLayoutAttributeTop 213 | relatedBy:NSLayoutRelationEqual 214 | toItem:toast 215 | attribute:NSLayoutAttributeTop 216 | multiplier:1.0f 217 | constant:0.f]; 218 | 219 | NSLayoutConstraint *leadingConstraint = [NSLayoutConstraint constraintWithItem:imageView 220 | attribute:NSLayoutAttributeLeading 221 | relatedBy:NSLayoutRelationEqual 222 | toItem:toast 223 | attribute:NSLayoutAttributeLeading 224 | multiplier:1.0f 225 | constant:0.f]; 226 | 227 | [toast addConstraints:@[widthConstraint, heightConstraint, topConstraint, leadingConstraint]]; 228 | } 229 | 230 | + (void)applyTitleConstraintsForLabel:(UILabel *)label 231 | onToast:(SWToast *)toast 232 | { 233 | [toast addSubview:label]; 234 | label.translatesAutoresizingMaskIntoConstraints = NO; 235 | label.userInteractionEnabled = NO; 236 | float height = kLabelHeightTitle; 237 | 238 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:label 239 | attribute:NSLayoutAttributeWidth 240 | relatedBy:0 241 | toItem:toast 242 | attribute:NSLayoutAttributeWidth 243 | multiplier:1 244 | constant:0]; 245 | 246 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:label 247 | attribute:NSLayoutAttributeHeight 248 | relatedBy:0 249 | toItem:nil 250 | attribute:NSLayoutAttributeNotAnAttribute 251 | multiplier:1.0f 252 | constant:height]; 253 | 254 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:label 255 | attribute:NSLayoutAttributeTop 256 | relatedBy:NSLayoutRelationEqual 257 | toItem:toast 258 | attribute:NSLayoutAttributeTop 259 | multiplier:1.0f 260 | constant:10.f]; 261 | 262 | NSLayoutConstraint *leadingConstraint = [NSLayoutConstraint constraintWithItem:label 263 | attribute:NSLayoutAttributeLeading 264 | relatedBy:NSLayoutRelationEqual 265 | toItem:toast 266 | attribute:NSLayoutAttributeLeading 267 | multiplier:1.0f 268 | constant:0.f]; 269 | 270 | [toast addConstraints:@[widthConstraint, heightConstraint, topConstraint, leadingConstraint]]; 271 | } 272 | 273 | + (void)applySubtitleConstraintsForLabel:(UILabel *)label 274 | toTitleLabel:(UILabel *)titleLabel 275 | onToast:(SWToast *)toast 276 | { 277 | [toast addSubview:label]; 278 | label.translatesAutoresizingMaskIntoConstraints = NO; 279 | 280 | 281 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:label 282 | attribute:NSLayoutAttributeWidth 283 | relatedBy:0 284 | toItem:toast 285 | attribute:NSLayoutAttributeWidth 286 | multiplier:1 287 | constant:-20]; 288 | 289 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:label 290 | attribute:NSLayoutAttributeCenterX 291 | relatedBy:NSLayoutRelationEqual 292 | toItem:toast 293 | attribute:NSLayoutAttributeCenterX 294 | multiplier:1.0f 295 | constant:0]; 296 | 297 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:label 298 | attribute:NSLayoutAttributeTop 299 | relatedBy:NSLayoutRelationEqual 300 | toItem:titleLabel 301 | attribute:NSLayoutAttributeBottom 302 | multiplier:1.0f 303 | constant:-30.f]; 304 | 305 | NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:label 306 | attribute:NSLayoutAttributeBottom 307 | relatedBy:NSLayoutRelationEqual 308 | toItem:toast 309 | attribute:NSLayoutAttributeBottom 310 | multiplier:1.0f 311 | constant:-10.f]; 312 | 313 | 314 | [toast addConstraints:@[widthConstraint, constraintX, topConstraint, bottomConstraint]]; 315 | } 316 | 317 | + (void)applySubtitleConstraintsForLabel:(UILabel *)label 318 | toTitleLabel:(UILabel *)titleLabel 319 | andActionButton:(UIButton *)actionButton 320 | onToast:(SWToast *)toast 321 | { 322 | [toast addSubview:label]; 323 | label.translatesAutoresizingMaskIntoConstraints = NO; 324 | label.userInteractionEnabled = NO; 325 | 326 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:label 327 | attribute:NSLayoutAttributeWidth 328 | relatedBy:0 329 | toItem:toast 330 | attribute:NSLayoutAttributeWidth 331 | multiplier:1 332 | constant:-20]; 333 | 334 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:label 335 | attribute:NSLayoutAttributeCenterX 336 | relatedBy:NSLayoutRelationEqual 337 | toItem:toast 338 | attribute:NSLayoutAttributeCenterX 339 | multiplier:1.0f 340 | constant:0]; 341 | 342 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:label 343 | attribute:NSLayoutAttributeTop 344 | relatedBy:NSLayoutRelationEqual 345 | toItem:titleLabel 346 | attribute:NSLayoutAttributeBottom 347 | multiplier:1.0f 348 | constant:-30.f]; 349 | 350 | NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:label 351 | attribute:NSLayoutAttributeBottom 352 | relatedBy:NSLayoutRelationEqual 353 | toItem:actionButton 354 | attribute:NSLayoutAttributeBottom 355 | multiplier:1.0f 356 | constant:-20.f]; 357 | 358 | 359 | [toast addConstraints:@[widthConstraint, constraintX, topConstraint, bottomConstraint]]; 360 | } 361 | 362 | + (void)applyTextfieldConstraintsForUsernameField:(UITextField *)usernameField 363 | toTitleLabel:(UILabel *)titleLabel 364 | onToast:(SWToast *)toast 365 | { 366 | [toast addSubview:usernameField]; 367 | usernameField.translatesAutoresizingMaskIntoConstraints = NO; 368 | usernameField.userInteractionEnabled = YES; 369 | float height = kTextfieldHeightUsername; 370 | float topDistance = kTextfieldTitleDistance; 371 | 372 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:usernameField 373 | attribute:NSLayoutAttributeWidth 374 | relatedBy:0 375 | toItem:toast 376 | attribute:NSLayoutAttributeWidth 377 | multiplier:1 378 | constant:-20]; 379 | 380 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:usernameField 381 | attribute:NSLayoutAttributeHeight 382 | relatedBy:0 383 | toItem:nil 384 | attribute:NSLayoutAttributeNotAnAttribute 385 | multiplier:1.0f 386 | constant:height]; 387 | 388 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:usernameField 389 | attribute:NSLayoutAttributeCenterX 390 | relatedBy:NSLayoutRelationEqual 391 | toItem:toast 392 | attribute:NSLayoutAttributeCenterX 393 | multiplier:1.0f 394 | constant:0]; 395 | 396 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:usernameField 397 | attribute:NSLayoutAttributeTop 398 | relatedBy:NSLayoutRelationEqual 399 | toItem:titleLabel 400 | attribute:NSLayoutAttributeBottom 401 | multiplier:1.0f 402 | constant:topDistance]; 403 | 404 | 405 | [toast addConstraints:@[widthConstraint, heightConstraint, constraintX, topConstraint]]; 406 | } 407 | 408 | + (void)applyTextfieldConstraintsForPasswordField:(UITextField *)passwordField 409 | toUsernameField:(UITextField *)usernameField 410 | onToast:(SWToast *)toast 411 | { 412 | [toast addSubview:passwordField]; 413 | passwordField.translatesAutoresizingMaskIntoConstraints = NO; 414 | passwordField.userInteractionEnabled = YES; 415 | float height = kTextfieldHeightPassword; 416 | 417 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:passwordField 418 | attribute:NSLayoutAttributeWidth 419 | relatedBy:0 420 | toItem:toast 421 | attribute:NSLayoutAttributeWidth 422 | multiplier:1 423 | constant:-20]; 424 | 425 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:passwordField 426 | attribute:NSLayoutAttributeHeight 427 | relatedBy:0 428 | toItem:nil 429 | attribute:NSLayoutAttributeNotAnAttribute 430 | multiplier:1.0f 431 | constant:height]; 432 | 433 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:passwordField 434 | attribute:NSLayoutAttributeCenterX 435 | relatedBy:NSLayoutRelationEqual 436 | toItem:toast 437 | attribute:NSLayoutAttributeCenterX 438 | multiplier:1.0f 439 | constant:0]; 440 | 441 | NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:passwordField 442 | attribute:NSLayoutAttributeTop 443 | relatedBy:NSLayoutRelationEqual 444 | toItem:usernameField 445 | attribute:NSLayoutAttributeBottom 446 | multiplier:1.0f 447 | constant:-30.f]; 448 | 449 | 450 | [toast addConstraints:@[widthConstraint, heightConstraint, constraintX, topConstraint]]; 451 | } 452 | 453 | + (void)applyButtonConstraintsForButton:(UIButton *)button 454 | onToast:(SWToast *)toast 455 | { 456 | [toast addSubview:button]; 457 | button.translatesAutoresizingMaskIntoConstraints = NO; 458 | button.userInteractionEnabled = YES; 459 | float height = kButtonHeightAction; 460 | 461 | NSLayoutConstraint *widthConstraint = [NSLayoutConstraint constraintWithItem:button 462 | attribute:NSLayoutAttributeWidth 463 | relatedBy:0 464 | toItem:toast 465 | attribute:NSLayoutAttributeWidth 466 | multiplier:1 467 | constant:-20]; 468 | 469 | 470 | NSLayoutConstraint *heightConstraint = [NSLayoutConstraint constraintWithItem:button 471 | attribute:NSLayoutAttributeHeight 472 | relatedBy:0 473 | toItem:nil 474 | attribute:NSLayoutAttributeNotAnAttribute 475 | multiplier:1.0f 476 | constant:height]; 477 | 478 | NSLayoutConstraint *constraintX = [NSLayoutConstraint constraintWithItem:button 479 | attribute:NSLayoutAttributeCenterX 480 | relatedBy:NSLayoutRelationEqual 481 | toItem:toast 482 | attribute:NSLayoutAttributeCenterX 483 | multiplier:1.0f 484 | constant:0]; 485 | 486 | NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:button 487 | attribute:NSLayoutAttributeBottom 488 | relatedBy:NSLayoutRelationEqual 489 | toItem:toast 490 | attribute:NSLayoutAttributeBottom 491 | multiplier:1.0f 492 | constant:0.0f]; 493 | 494 | [toast addConstraints:@[widthConstraint, heightConstraint, constraintX, bottomConstraint]]; 495 | } 496 | 497 | 498 | @end 499 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SWBufferedToast 2 | 3 | [![CI Status](http://img.shields.io/travis/Stephen Walsh/SWBufferedToast.svg?style=flat)](https://travis-ci.org/Stephen Walsh/SWBufferedToast) 4 | [![Version](https://img.shields.io/cocoapods/v/SWBufferedToast.svg?style=flat)](http://cocoapods.org/pods/SWBufferedToast) 5 | [![License](https://img.shields.io/cocoapods/l/SWBufferedToast.svg?style=flat)](http://cocoapods.org/pods/SWBufferedToast) 6 | [![Platform](https://img.shields.io/cocoapods/p/SWBufferedToast.svg?style=flat)](http://cocoapods.org/pods/SWBufferedToast) 7 | 8 | ## About 9 | 10 | SWBufferedToast is a simple alert-style class for presenting information to the user. 11 | An SWBufferedToast can be instantiated with one of three types: 12 | 13 | 14 | **1. Plain Toast** 15 | 16 | 17 | A simple dismissable alert with a title, description and action button. 18 | 19 | ![Alt text](https://github.com/sfwalsh/SWBufferedToast/blob/master/Screenshots/plainToast.png "Plain Toast") 20 | 21 | **2. Notice Toast** 22 | 23 | 24 | A non-dismissable alert used to notify the user of an ongoing task. This alert cannot be dismissed by the user, but can be dismissed using a timer or by calling toast.dismiss. 25 | 26 | ![Alt text](https://github.com/sfwalsh/SWBufferedToast/blob/master/Screenshots/noticeToast.png "Notice Toast") 27 | 28 | **3. Login Toast** 29 | 30 | 31 | A modal login window in the style of a toast. 32 | 33 | ![Alt text](https://github.com/sfwalsh/SWBufferedToast/blob/master/Screenshots/loginToast.png "Login Toast") 34 | 35 | 36 | All three alert types have a buffering animation that can be turned on and off as necessary. Additionally, you can supply your own images for this buffering animation. 37 | 38 | If you wish to use your own animation images for the buffering state please be sure to add them to the "Pods-SWBufferedToast-SWBufferedToast-SWBufferedToast" target. 39 | 40 | ## Usage 41 | 42 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 43 | 44 | ## Requirements 45 | 46 | A project with a deployment target of iOS 7.0 or later 47 | 48 | ## Installation 49 | 50 | SWBufferedToast is available through [CocoaPods](http://cocoapods.org). To install 51 | it, simply add the following line to your Podfile: 52 | 53 | ```ruby 54 | pod "SWBufferedToast" 55 | ``` 56 | 57 | ## Author 58 | 59 | Stephen Walsh, sw7891@hotmail.com 60 | 61 | ## License 62 | 63 | SWBufferedToast is available under the MIT license. See the LICENSE file for more info. 64 | -------------------------------------------------------------------------------- /SWBufferedToast.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SWBufferedToast" 3 | s.version = "0.1.5" 4 | s.summary = "A simple UI class for presenting useful information to the user." 5 | s.description = <<-DESC 6 | 7 | SWBufferedToast is a simple alert-style class for presenting information to the user. 8 | An SWBufferedToast can be instantiated with one of three types: 9 | 10 | Plain Toast 11 | A simple dismissable alert with a title, description and action button. 12 | 13 | Notice Toast 14 | An non-dismissable alert used to notify the user of an ongoing task. This alert cannot be dismissed by the user, but can be dismissed using a timer or by calling toast.dismiss. 15 | 16 | Login Toast 17 | A modal login window in the style of a toast. 18 | 19 | 20 | All three alert types have a buffering animation that can be turned on and off as necessary. Additionally, you can supply your own images for this buffering animation. 21 | 22 | If you wish to use your own animation images for the buffering state please be sure to add them to the "Pods-SWBufferedToast-SWBufferedToast-SWBufferedToast" target. 23 | 24 | DESC 25 | s.homepage = "https://github.com/sfwalsh/SWBufferedToast" 26 | # s.screenshots = "https://github.com/sfwalsh/SWBufferedToast/blob/master/Screenshots/plainToast.png", "https://github.com/sfwalsh/SWBufferedToast/blob/master/Screenshots/noticeToast.png", "https://github.com/sfwalsh/SWBufferedToast/blob/master/Screenshots/loginToast.png" 27 | s.license = 'MIT' 28 | s.author = { "Stephen Walsh" => "sw7891@hotmail.com" } 29 | s.source = { :git => "https://github.com/sfwalsh/SWBufferedToast.git", :tag => s.version.to_s } 30 | # s.social_media_url = 'https://twitter.com/Hapkido_ORourke' 31 | 32 | s.platform = :ios, '7.0' 33 | s.requires_arc = true 34 | 35 | s.source_files = 'Pod/Classes/**/*' 36 | s.resource_bundles = { 37 | 'SWBufferedToast' => ['Pod/Assets/*.png'] 38 | } 39 | 40 | # s.public_header_files = 'Pod/Classes/**/*.h' 41 | # s.frameworks = 'UIKit', 'MapKit' 42 | # s.dependency 'AFNetworking', '~> 2.3' 43 | end 44 | -------------------------------------------------------------------------------- /Screenshots/loginToast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Screenshots/loginToast.png -------------------------------------------------------------------------------- /Screenshots/noticeToast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Screenshots/noticeToast.png -------------------------------------------------------------------------------- /Screenshots/plainToast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfwalsh/SWBufferedToast/7c438cac5db6763c8a53073ea5a337592e207158/Screenshots/plainToast.png --------------------------------------------------------------------------------