├── .gitignore ├── .travis.yml ├── Example ├── .idea │ ├── .name │ ├── Example.iml │ ├── encodings.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations │ │ ├── StatusBarNotificationCenter.xml │ │ └── StatusBarNotificationCenter_Example.xml │ ├── vcs.xml │ ├── workspace.xml │ └── xcode.xml ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── StatusBarNotificationCenter.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── StatusBarNotificationCenter.xcscheme │ └── Target Support Files │ │ ├── Pods-StatusBarNotificationCenter_Example │ │ ├── Info.plist │ │ ├── Pods-StatusBarNotificationCenter_Example-acknowledgements.markdown │ │ ├── Pods-StatusBarNotificationCenter_Example-acknowledgements.plist │ │ ├── Pods-StatusBarNotificationCenter_Example-dummy.m │ │ ├── Pods-StatusBarNotificationCenter_Example-frameworks.sh │ │ ├── Pods-StatusBarNotificationCenter_Example-resources.sh │ │ ├── Pods-StatusBarNotificationCenter_Example-umbrella.h │ │ ├── Pods-StatusBarNotificationCenter_Example.debug.xcconfig │ │ ├── Pods-StatusBarNotificationCenter_Example.modulemap │ │ └── Pods-StatusBarNotificationCenter_Example.release.xcconfig │ │ ├── Pods-StatusBarNotificationCenter_Tests │ │ ├── Info.plist │ │ ├── Pods-StatusBarNotificationCenter_Tests-acknowledgements.markdown │ │ ├── Pods-StatusBarNotificationCenter_Tests-acknowledgements.plist │ │ ├── Pods-StatusBarNotificationCenter_Tests-dummy.m │ │ ├── Pods-StatusBarNotificationCenter_Tests-frameworks.sh │ │ ├── Pods-StatusBarNotificationCenter_Tests-resources.sh │ │ ├── Pods-StatusBarNotificationCenter_Tests-umbrella.h │ │ ├── Pods-StatusBarNotificationCenter_Tests.debug.xcconfig │ │ ├── Pods-StatusBarNotificationCenter_Tests.modulemap │ │ └── Pods-StatusBarNotificationCenter_Tests.release.xcconfig │ │ └── StatusBarNotificationCenter │ │ ├── Info.plist │ │ ├── StatusBarNotificationCenter-dummy.m │ │ ├── StatusBarNotificationCenter-prefix.pch │ │ ├── StatusBarNotificationCenter-umbrella.h │ │ ├── StatusBarNotificationCenter.modulemap │ │ └── StatusBarNotificationCenter.xcconfig ├── StatusBarNotificationCenter.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── StatusBarNotificationCenter-Example.xcscheme ├── StatusBarNotificationCenter.xcworkspace │ └── contents.xcworkspacedata ├── StatusBarNotificationCenter │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── Main View Controller │ │ ├── Base.lproj │ │ └── Main.storyboard │ │ ├── NotificationView.xib │ │ └── ViewController.swift └── Tests │ ├── Info.plist │ └── Tests.swift ├── LICENSE ├── Pod ├── Configuration │ ├── NotificationCenterConfiguration.swift │ └── NotificationLabelConfiguration.swift └── Notification Center │ ├── BaseScrollLabel.swift │ ├── BaseViewController.swift │ ├── BaseWindow.swift │ ├── StatusBarNotificationCenter+Logic.swift │ ├── StatusBarNotificationCenter+Type.swift │ └── StatusBarNotificationCenter.swift ├── README.md ├── StatusBarNotificationCenter.podspec ├── _Pods.xcodeproj └── screenshots └── screenshoot.gif /.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 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.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/StatusBarNotificationCenter.xcworkspace -scheme StatusBarNotificationCenter-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c 15 | - pod lib lint --quick 16 | -------------------------------------------------------------------------------- /Example/.idea/.name: -------------------------------------------------------------------------------- 1 | StatusBarNotificationCenter -------------------------------------------------------------------------------- /Example/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Example/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/.idea/runConfigurations/StatusBarNotificationCenter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/.idea/runConfigurations/StatusBarNotificationCenter_Example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 27 | 28 | 29 | 30 | 31 | 38 | 39 | 40 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 73 | 74 | 79 | 80 | 81 | 82 | 83 | true 84 | 85 | 86 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 122 | 123 | 126 | 127 | 128 | 129 | 132 | 133 | 136 | 137 | 140 | 141 | 144 | 145 | 146 | 147 | 150 | 151 | 154 | 155 | 158 | 159 | 162 | 163 | 164 | 165 | 168 | 169 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 1442760959484 224 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | -------------------------------------------------------------------------------- /Example/.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | use_frameworks! 3 | 4 | target 'StatusBarNotificationCenter_Example', :exclusive => true do 5 | pod "StatusBarNotificationCenter", :path => "../" 6 | end 7 | 8 | target 'StatusBarNotificationCenter_Tests', :exclusive => true do 9 | pod "StatusBarNotificationCenter", :path => "../" 10 | 11 | 12 | end 13 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - StatusBarNotificationCenter (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - StatusBarNotificationCenter (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | StatusBarNotificationCenter: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | StatusBarNotificationCenter: e7d8055b5086352ecc09eea55d40975685ce85de 13 | 14 | COCOAPODS: 0.39.0.beta.4 15 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/StatusBarNotificationCenter.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StatusBarNotificationCenter", 3 | "version": "0.1.0", 4 | "summary": "A short description of StatusBarNotificationCenter.", 5 | "description": "", 6 | "homepage": "https://github.com//StatusBarNotificationCenter", 7 | "license": "MIT", 8 | "authors": { 9 | "Shannon Wu": "inatu@icloud.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com//StatusBarNotificationCenter.git", 13 | "tag": "0.1.0" 14 | }, 15 | "platforms": { 16 | "ios": "8.0" 17 | }, 18 | "requires_arc": true, 19 | "source_files": "Pod/Classes/**/*", 20 | "resource_bundles": { 21 | "StatusBarNotificationCenter": [ 22 | "Pod/Assets/*.png" 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - StatusBarNotificationCenter (0.1.0) 3 | 4 | DEPENDENCIES: 5 | - StatusBarNotificationCenter (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | StatusBarNotificationCenter: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | StatusBarNotificationCenter: e7d8055b5086352ecc09eea55d40975685ce85de 13 | 14 | COCOAPODS: 0.39.0.beta.4 15 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcshareddata/xcschemes/StatusBarNotificationCenter.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## StatusBarNotificationCenter 5 | 6 | Copyright (c) 2015 Shannon Wu 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-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-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 Shannon Wu <inatu@icloud.com> 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 | StatusBarNotificationCenter 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-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_StatusBarNotificationCenter_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_StatusBarNotificationCenter_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries 46 | local swift_runtime_libs 47 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 48 | for lib in $swift_runtime_libs; do 49 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 50 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 51 | code_sign_if_enabled "${destination}/${lib}" 52 | done 53 | } 54 | 55 | # Signs a framework with the provided identity 56 | code_sign_if_enabled() { 57 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 58 | # Use the current code_sign_identitiy 59 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 60 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 61 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 62 | fi 63 | } 64 | 65 | # Strip invalid architectures 66 | strip_invalid_archs() { 67 | binary="$1" 68 | # Get architectures for current file 69 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 70 | stripped="" 71 | for arch in $archs; do 72 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 73 | # Strip non-valid architectures in-place 74 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 75 | stripped="$stripped $arch" 76 | fi 77 | done 78 | if [[ "$stripped" ]]; then 79 | echo "Stripped $binary of architectures:$stripped" 80 | fi 81 | } 82 | 83 | 84 | if [[ "$CONFIGURATION" == "Debug" ]]; then 85 | install_framework "Pods-StatusBarNotificationCenter_Example/StatusBarNotificationCenter.framework" 86 | fi 87 | if [[ "$CONFIGURATION" == "Release" ]]; then 88 | install_framework "Pods-StatusBarNotificationCenter_Example/StatusBarNotificationCenter.framework" 89 | fi 90 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-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 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | 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}" 22 | 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}" 23 | ;; 24 | *.xib) 25 | 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}" 26 | 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}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun 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}" 95 | fi 96 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_StatusBarNotificationCenter_ExampleVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_StatusBarNotificationCenter_ExampleVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/StatusBarNotificationCenter.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "StatusBarNotificationCenter" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-StatusBarNotificationCenter_Example 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_StatusBarNotificationCenter_Example { 2 | umbrella header "Pods-StatusBarNotificationCenter_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/StatusBarNotificationCenter.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "StatusBarNotificationCenter" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-StatusBarNotificationCenter_Example 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## StatusBarNotificationCenter 5 | 6 | Copyright (c) 2015 Shannon Wu 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-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_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 Shannon Wu <inatu@icloud.com> 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 | StatusBarNotificationCenter 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-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_StatusBarNotificationCenter_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_StatusBarNotificationCenter_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries 46 | local swift_runtime_libs 47 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 48 | for lib in $swift_runtime_libs; do 49 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 50 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 51 | code_sign_if_enabled "${destination}/${lib}" 52 | done 53 | } 54 | 55 | # Signs a framework with the provided identity 56 | code_sign_if_enabled() { 57 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 58 | # Use the current code_sign_identitiy 59 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 60 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 61 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 62 | fi 63 | } 64 | 65 | # Strip invalid architectures 66 | strip_invalid_archs() { 67 | binary="$1" 68 | # Get architectures for current file 69 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 70 | stripped="" 71 | for arch in $archs; do 72 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 73 | # Strip non-valid architectures in-place 74 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 75 | stripped="$stripped $arch" 76 | fi 77 | done 78 | if [[ "$stripped" ]]; then 79 | echo "Stripped $binary of architectures:$stripped" 80 | fi 81 | } 82 | 83 | 84 | if [[ "$CONFIGURATION" == "Debug" ]]; then 85 | install_framework "Pods-StatusBarNotificationCenter_Tests/StatusBarNotificationCenter.framework" 86 | fi 87 | if [[ "$CONFIGURATION" == "Release" ]]; then 88 | install_framework "Pods-StatusBarNotificationCenter_Tests/StatusBarNotificationCenter.framework" 89 | fi 90 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_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 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | 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}" 22 | 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}" 23 | ;; 24 | *.xib) 25 | 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}" 26 | 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}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun 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}" 95 | fi 96 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_StatusBarNotificationCenter_TestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_StatusBarNotificationCenter_TestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/StatusBarNotificationCenter.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "StatusBarNotificationCenter" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-StatusBarNotificationCenter_Tests 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_StatusBarNotificationCenter_Tests { 2 | umbrella header "Pods-StatusBarNotificationCenter_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 3 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/StatusBarNotificationCenter.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "StatusBarNotificationCenter" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-StatusBarNotificationCenter_Tests 7 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/StatusBarNotificationCenter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/StatusBarNotificationCenter/StatusBarNotificationCenter-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_StatusBarNotificationCenter : NSObject 3 | @end 4 | @implementation PodsDummy_StatusBarNotificationCenter 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/StatusBarNotificationCenter/StatusBarNotificationCenter-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/StatusBarNotificationCenter/StatusBarNotificationCenter-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double StatusBarNotificationCenterVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char StatusBarNotificationCenterVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/StatusBarNotificationCenter/StatusBarNotificationCenter.modulemap: -------------------------------------------------------------------------------- 1 | framework module StatusBarNotificationCenter { 2 | umbrella header "StatusBarNotificationCenter-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/StatusBarNotificationCenter/StatusBarNotificationCenter.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/StatusBarNotificationCenter" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 32F7B67A2C7127439BA82080 /* Pods_StatusBarNotificationCenter_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D17F97D3ECE8520BB3B385AA /* Pods_StatusBarNotificationCenter_Example.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 12 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 13 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 14 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 15 | 613C45F71BAC66D60039C735 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 613C45F31BAC66D60039C735 /* Main.storyboard */; }; 16 | 613C45F81BAC66D60039C735 /* NotificationView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 613C45F51BAC66D60039C735 /* NotificationView.xib */; }; 17 | 613C45F91BAC66D60039C735 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 613C45F61BAC66D60039C735 /* ViewController.swift */; }; 18 | F8AC9A6203FD4162C8345001 /* Pods_StatusBarNotificationCenter_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 042595BFC79D65247D3A26B0 /* Pods_StatusBarNotificationCenter_Tests.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 27 | remoteInfo = StatusBarNotificationCenter; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 042595BFC79D65247D3A26B0 /* Pods_StatusBarNotificationCenter_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_StatusBarNotificationCenter_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 401B9497CA0DEFF37C8ABF93 /* StatusBarNotificationCenter.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = StatusBarNotificationCenter.podspec; path = ../StatusBarNotificationCenter.podspec; sourceTree = ""; }; 34 | 52F286239CC2F3FC56EEBF02 /* Pods-StatusBarNotificationCenter_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusBarNotificationCenter_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example.release.xcconfig"; sourceTree = ""; }; 35 | 607FACD01AFB9204008FA782 /* StatusBarNotificationCenter_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StatusBarNotificationCenter_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 38 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 39 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 40 | 607FACE51AFB9204008FA782 /* StatusBarNotificationCenter_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StatusBarNotificationCenter_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 43 | 613C45F41BAC66D60039C735 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 613C45F51BAC66D60039C735 /* NotificationView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NotificationView.xib; sourceTree = ""; }; 45 | 613C45F61BAC66D60039C735 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 46 | 8F58400749F62295D00DF979 /* Pods-StatusBarNotificationCenter_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusBarNotificationCenter_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests.release.xcconfig"; sourceTree = ""; }; 47 | A79502685DE23C1D134C75EA /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 48 | C37CD0F85E0D1CAB9A985903 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 49 | D17F97D3ECE8520BB3B385AA /* Pods_StatusBarNotificationCenter_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_StatusBarNotificationCenter_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | E430C9156CBD01B44C80FC14 /* Pods-StatusBarNotificationCenter_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusBarNotificationCenter_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests.debug.xcconfig"; sourceTree = ""; }; 51 | FF62CAFE03B8F8673A0C7E5F /* Pods-StatusBarNotificationCenter_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusBarNotificationCenter_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example.debug.xcconfig"; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 32F7B67A2C7127439BA82080 /* Pods_StatusBarNotificationCenter_Example.framework in Frameworks */, 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | F8AC9A6203FD4162C8345001 /* Pods_StatusBarNotificationCenter_Tests.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | /* End PBXFrameworksBuildPhase section */ 72 | 73 | /* Begin PBXGroup section */ 74 | 607FACC71AFB9204008FA782 = { 75 | isa = PBXGroup; 76 | children = ( 77 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 78 | 607FACD21AFB9204008FA782 /* Example for StatusBarNotificationCenter */, 79 | 607FACE81AFB9204008FA782 /* Tests */, 80 | 607FACD11AFB9204008FA782 /* Products */, 81 | B03BE34C990D4E0A8383936D /* Pods */, 82 | 9F13D8788827B7072C3DA014 /* Frameworks */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 607FACD11AFB9204008FA782 /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 607FACD01AFB9204008FA782 /* StatusBarNotificationCenter_Example.app */, 90 | 607FACE51AFB9204008FA782 /* StatusBarNotificationCenter_Tests.xctest */, 91 | ); 92 | name = Products; 93 | sourceTree = ""; 94 | }; 95 | 607FACD21AFB9204008FA782 /* Example for StatusBarNotificationCenter */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 613C45F21BAC66D60039C735 /* Main View Controller */, 99 | 607FACD31AFB9204008FA782 /* Supporting Files */, 100 | ); 101 | name = "Example for StatusBarNotificationCenter"; 102 | path = StatusBarNotificationCenter; 103 | sourceTree = ""; 104 | }; 105 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 109 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 110 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 111 | 607FACD41AFB9204008FA782 /* Info.plist */, 112 | ); 113 | name = "Supporting Files"; 114 | sourceTree = ""; 115 | }; 116 | 607FACE81AFB9204008FA782 /* Tests */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 120 | 607FACE91AFB9204008FA782 /* Supporting Files */, 121 | ); 122 | path = Tests; 123 | sourceTree = ""; 124 | }; 125 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 607FACEA1AFB9204008FA782 /* Info.plist */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 401B9497CA0DEFF37C8ABF93 /* StatusBarNotificationCenter.podspec */, 137 | C37CD0F85E0D1CAB9A985903 /* README.md */, 138 | A79502685DE23C1D134C75EA /* LICENSE */, 139 | ); 140 | name = "Podspec Metadata"; 141 | sourceTree = ""; 142 | }; 143 | 613C45F21BAC66D60039C735 /* Main View Controller */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 613C45F31BAC66D60039C735 /* Main.storyboard */, 147 | 613C45F51BAC66D60039C735 /* NotificationView.xib */, 148 | 613C45F61BAC66D60039C735 /* ViewController.swift */, 149 | ); 150 | path = "Main View Controller"; 151 | sourceTree = ""; 152 | }; 153 | 9F13D8788827B7072C3DA014 /* Frameworks */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | D17F97D3ECE8520BB3B385AA /* Pods_StatusBarNotificationCenter_Example.framework */, 157 | 042595BFC79D65247D3A26B0 /* Pods_StatusBarNotificationCenter_Tests.framework */, 158 | ); 159 | name = Frameworks; 160 | sourceTree = ""; 161 | }; 162 | B03BE34C990D4E0A8383936D /* Pods */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | FF62CAFE03B8F8673A0C7E5F /* Pods-StatusBarNotificationCenter_Example.debug.xcconfig */, 166 | 52F286239CC2F3FC56EEBF02 /* Pods-StatusBarNotificationCenter_Example.release.xcconfig */, 167 | E430C9156CBD01B44C80FC14 /* Pods-StatusBarNotificationCenter_Tests.debug.xcconfig */, 168 | 8F58400749F62295D00DF979 /* Pods-StatusBarNotificationCenter_Tests.release.xcconfig */, 169 | ); 170 | name = Pods; 171 | sourceTree = ""; 172 | }; 173 | /* End PBXGroup section */ 174 | 175 | /* Begin PBXNativeTarget section */ 176 | 607FACCF1AFB9204008FA782 /* StatusBarNotificationCenter_Example */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "StatusBarNotificationCenter_Example" */; 179 | buildPhases = ( 180 | CEA4DDC49396839CD5E578DA /* Check Pods Manifest.lock */, 181 | 607FACCC1AFB9204008FA782 /* Sources */, 182 | 607FACCD1AFB9204008FA782 /* Frameworks */, 183 | 607FACCE1AFB9204008FA782 /* Resources */, 184 | 9759EE4666B17D26B3ACAF58 /* Embed Pods Frameworks */, 185 | B6E824777C61367E881985F0 /* Copy Pods Resources */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = StatusBarNotificationCenter_Example; 192 | productName = StatusBarNotificationCenter; 193 | productReference = 607FACD01AFB9204008FA782 /* StatusBarNotificationCenter_Example.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | 607FACE41AFB9204008FA782 /* StatusBarNotificationCenter_Tests */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "StatusBarNotificationCenter_Tests" */; 199 | buildPhases = ( 200 | D261F132015AD642EFF9CA2E /* Check Pods Manifest.lock */, 201 | 607FACE11AFB9204008FA782 /* Sources */, 202 | 607FACE21AFB9204008FA782 /* Frameworks */, 203 | 607FACE31AFB9204008FA782 /* Resources */, 204 | 0C9026CFDB9E0BDE0397E077 /* Embed Pods Frameworks */, 205 | 3EAC56312346E4CF817AA67A /* Copy Pods Resources */, 206 | ); 207 | buildRules = ( 208 | ); 209 | dependencies = ( 210 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 211 | ); 212 | name = StatusBarNotificationCenter_Tests; 213 | productName = Tests; 214 | productReference = 607FACE51AFB9204008FA782 /* StatusBarNotificationCenter_Tests.xctest */; 215 | productType = "com.apple.product-type.bundle.unit-test"; 216 | }; 217 | /* End PBXNativeTarget section */ 218 | 219 | /* Begin PBXProject section */ 220 | 607FACC81AFB9204008FA782 /* Project object */ = { 221 | isa = PBXProject; 222 | attributes = { 223 | LastSwiftUpdateCheck = 0710; 224 | LastUpgradeCheck = 0800; 225 | ORGANIZATIONNAME = CocoaPods; 226 | TargetAttributes = { 227 | 607FACCF1AFB9204008FA782 = { 228 | CreatedOnToolsVersion = 6.3.1; 229 | LastSwiftMigration = 0800; 230 | }; 231 | 607FACE41AFB9204008FA782 = { 232 | CreatedOnToolsVersion = 6.3.1; 233 | LastSwiftMigration = 0800; 234 | TestTargetID = 607FACCF1AFB9204008FA782; 235 | }; 236 | }; 237 | }; 238 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "StatusBarNotificationCenter" */; 239 | compatibilityVersion = "Xcode 3.2"; 240 | developmentRegion = English; 241 | hasScannedForEncodings = 0; 242 | knownRegions = ( 243 | en, 244 | Base, 245 | ); 246 | mainGroup = 607FACC71AFB9204008FA782; 247 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 248 | projectDirPath = ""; 249 | projectRoot = ""; 250 | targets = ( 251 | 607FACCF1AFB9204008FA782 /* StatusBarNotificationCenter_Example */, 252 | 607FACE41AFB9204008FA782 /* StatusBarNotificationCenter_Tests */, 253 | ); 254 | }; 255 | /* End PBXProject section */ 256 | 257 | /* Begin PBXResourcesBuildPhase section */ 258 | 607FACCE1AFB9204008FA782 /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 613C45F71BAC66D60039C735 /* Main.storyboard in Resources */, 263 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 264 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 265 | 613C45F81BAC66D60039C735 /* NotificationView.xib in Resources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | 607FACE31AFB9204008FA782 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXResourcesBuildPhase section */ 277 | 278 | /* Begin PBXShellScriptBuildPhase section */ 279 | 0C9026CFDB9E0BDE0397E077 /* Embed Pods Frameworks */ = { 280 | isa = PBXShellScriptBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | inputPaths = ( 285 | ); 286 | name = "Embed Pods Frameworks"; 287 | outputPaths = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | shellPath = /bin/sh; 291 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests-frameworks.sh\"\n"; 292 | showEnvVarsInLog = 0; 293 | }; 294 | 3EAC56312346E4CF817AA67A /* Copy Pods Resources */ = { 295 | isa = PBXShellScriptBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | ); 299 | inputPaths = ( 300 | ); 301 | name = "Copy Pods Resources"; 302 | outputPaths = ( 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Tests/Pods-StatusBarNotificationCenter_Tests-resources.sh\"\n"; 307 | showEnvVarsInLog = 0; 308 | }; 309 | 9759EE4666B17D26B3ACAF58 /* Embed Pods Frameworks */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputPaths = ( 315 | ); 316 | name = "Embed Pods Frameworks"; 317 | outputPaths = ( 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | shellPath = /bin/sh; 321 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-frameworks.sh\"\n"; 322 | showEnvVarsInLog = 0; 323 | }; 324 | B6E824777C61367E881985F0 /* Copy Pods Resources */ = { 325 | isa = PBXShellScriptBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | ); 329 | inputPaths = ( 330 | ); 331 | name = "Copy Pods Resources"; 332 | outputPaths = ( 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | shellPath = /bin/sh; 336 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StatusBarNotificationCenter_Example/Pods-StatusBarNotificationCenter_Example-resources.sh\"\n"; 337 | showEnvVarsInLog = 0; 338 | }; 339 | CEA4DDC49396839CD5E578DA /* Check Pods Manifest.lock */ = { 340 | isa = PBXShellScriptBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | ); 344 | inputPaths = ( 345 | ); 346 | name = "Check Pods Manifest.lock"; 347 | outputPaths = ( 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | shellPath = /bin/sh; 351 | 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"; 352 | showEnvVarsInLog = 0; 353 | }; 354 | D261F132015AD642EFF9CA2E /* Check Pods Manifest.lock */ = { 355 | isa = PBXShellScriptBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | ); 359 | inputPaths = ( 360 | ); 361 | name = "Check Pods Manifest.lock"; 362 | outputPaths = ( 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | shellPath = /bin/sh; 366 | 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"; 367 | showEnvVarsInLog = 0; 368 | }; 369 | /* End PBXShellScriptBuildPhase section */ 370 | 371 | /* Begin PBXSourcesBuildPhase section */ 372 | 607FACCC1AFB9204008FA782 /* Sources */ = { 373 | isa = PBXSourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | 613C45F91BAC66D60039C735 /* ViewController.swift in Sources */, 377 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 378 | ); 379 | runOnlyForDeploymentPostprocessing = 0; 380 | }; 381 | 607FACE11AFB9204008FA782 /* Sources */ = { 382 | isa = PBXSourcesBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 386 | ); 387 | runOnlyForDeploymentPostprocessing = 0; 388 | }; 389 | /* End PBXSourcesBuildPhase section */ 390 | 391 | /* Begin PBXTargetDependency section */ 392 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 393 | isa = PBXTargetDependency; 394 | target = 607FACCF1AFB9204008FA782 /* StatusBarNotificationCenter_Example */; 395 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 396 | }; 397 | /* End PBXTargetDependency section */ 398 | 399 | /* Begin PBXVariantGroup section */ 400 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 401 | isa = PBXVariantGroup; 402 | children = ( 403 | 607FACDF1AFB9204008FA782 /* Base */, 404 | ); 405 | name = LaunchScreen.xib; 406 | sourceTree = ""; 407 | }; 408 | 613C45F31BAC66D60039C735 /* Main.storyboard */ = { 409 | isa = PBXVariantGroup; 410 | children = ( 411 | 613C45F41BAC66D60039C735 /* Base */, 412 | ); 413 | name = Main.storyboard; 414 | sourceTree = ""; 415 | }; 416 | /* End PBXVariantGroup section */ 417 | 418 | /* Begin XCBuildConfiguration section */ 419 | 607FACED1AFB9204008FA782 /* Debug */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ALWAYS_SEARCH_USER_PATHS = NO; 423 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 424 | CLANG_CXX_LIBRARY = "libc++"; 425 | CLANG_ENABLE_MODULES = YES; 426 | CLANG_ENABLE_OBJC_ARC = YES; 427 | CLANG_WARN_BOOL_CONVERSION = YES; 428 | CLANG_WARN_CONSTANT_CONVERSION = YES; 429 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 430 | CLANG_WARN_EMPTY_BODY = YES; 431 | CLANG_WARN_ENUM_CONVERSION = YES; 432 | CLANG_WARN_INFINITE_RECURSION = YES; 433 | CLANG_WARN_INT_CONVERSION = YES; 434 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 435 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 436 | CLANG_WARN_UNREACHABLE_CODE = YES; 437 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 438 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 439 | COPY_PHASE_STRIP = NO; 440 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 441 | ENABLE_STRICT_OBJC_MSGSEND = YES; 442 | ENABLE_TESTABILITY = YES; 443 | GCC_C_LANGUAGE_STANDARD = gnu99; 444 | GCC_DYNAMIC_NO_PIC = NO; 445 | GCC_NO_COMMON_BLOCKS = YES; 446 | GCC_OPTIMIZATION_LEVEL = 0; 447 | GCC_PREPROCESSOR_DEFINITIONS = ( 448 | "DEBUG=1", 449 | "$(inherited)", 450 | ); 451 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 452 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 453 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 454 | GCC_WARN_UNDECLARED_SELECTOR = YES; 455 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 456 | GCC_WARN_UNUSED_FUNCTION = YES; 457 | GCC_WARN_UNUSED_VARIABLE = YES; 458 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 459 | MTL_ENABLE_DEBUG_INFO = YES; 460 | ONLY_ACTIVE_ARCH = YES; 461 | SDKROOT = iphoneos; 462 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 463 | SWIFT_VERSION = 3.0; 464 | }; 465 | name = Debug; 466 | }; 467 | 607FACEE1AFB9204008FA782 /* Release */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ALWAYS_SEARCH_USER_PATHS = NO; 471 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 472 | CLANG_CXX_LIBRARY = "libc++"; 473 | CLANG_ENABLE_MODULES = YES; 474 | CLANG_ENABLE_OBJC_ARC = YES; 475 | CLANG_WARN_BOOL_CONVERSION = YES; 476 | CLANG_WARN_CONSTANT_CONVERSION = YES; 477 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 478 | CLANG_WARN_EMPTY_BODY = YES; 479 | CLANG_WARN_ENUM_CONVERSION = YES; 480 | CLANG_WARN_INFINITE_RECURSION = YES; 481 | CLANG_WARN_INT_CONVERSION = YES; 482 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 483 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 484 | CLANG_WARN_UNREACHABLE_CODE = YES; 485 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 486 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 487 | COPY_PHASE_STRIP = NO; 488 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 489 | ENABLE_NS_ASSERTIONS = NO; 490 | ENABLE_STRICT_OBJC_MSGSEND = YES; 491 | GCC_C_LANGUAGE_STANDARD = gnu99; 492 | GCC_NO_COMMON_BLOCKS = YES; 493 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 494 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 495 | GCC_WARN_UNDECLARED_SELECTOR = YES; 496 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 497 | GCC_WARN_UNUSED_FUNCTION = YES; 498 | GCC_WARN_UNUSED_VARIABLE = YES; 499 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 500 | MTL_ENABLE_DEBUG_INFO = NO; 501 | SDKROOT = iphoneos; 502 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 503 | SWIFT_VERSION = 3.0; 504 | VALIDATE_PRODUCT = YES; 505 | }; 506 | name = Release; 507 | }; 508 | 607FACF01AFB9204008FA782 /* Debug */ = { 509 | isa = XCBuildConfiguration; 510 | baseConfigurationReference = FF62CAFE03B8F8673A0C7E5F /* Pods-StatusBarNotificationCenter_Example.debug.xcconfig */; 511 | buildSettings = { 512 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 513 | INFOPLIST_FILE = StatusBarNotificationCenter/Info.plist; 514 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 515 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 516 | MODULE_NAME = ExampleApp; 517 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 518 | PRODUCT_NAME = "$(TARGET_NAME)"; 519 | SWIFT_VERSION = 3.0; 520 | TARGETED_DEVICE_FAMILY = "1,2"; 521 | }; 522 | name = Debug; 523 | }; 524 | 607FACF11AFB9204008FA782 /* Release */ = { 525 | isa = XCBuildConfiguration; 526 | baseConfigurationReference = 52F286239CC2F3FC56EEBF02 /* Pods-StatusBarNotificationCenter_Example.release.xcconfig */; 527 | buildSettings = { 528 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 529 | INFOPLIST_FILE = StatusBarNotificationCenter/Info.plist; 530 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 531 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 532 | MODULE_NAME = ExampleApp; 533 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 534 | PRODUCT_NAME = "$(TARGET_NAME)"; 535 | SWIFT_VERSION = 3.0; 536 | TARGETED_DEVICE_FAMILY = "1,2"; 537 | }; 538 | name = Release; 539 | }; 540 | 607FACF31AFB9204008FA782 /* Debug */ = { 541 | isa = XCBuildConfiguration; 542 | baseConfigurationReference = E430C9156CBD01B44C80FC14 /* Pods-StatusBarNotificationCenter_Tests.debug.xcconfig */; 543 | buildSettings = { 544 | BUNDLE_LOADER = "$(TEST_HOST)"; 545 | FRAMEWORK_SEARCH_PATHS = ( 546 | "$(SDKROOT)/Developer/Library/Frameworks", 547 | "$(inherited)", 548 | ); 549 | GCC_PREPROCESSOR_DEFINITIONS = ( 550 | "DEBUG=1", 551 | "$(inherited)", 552 | ); 553 | INFOPLIST_FILE = Tests/Info.plist; 554 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 555 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 556 | PRODUCT_NAME = "$(TARGET_NAME)"; 557 | SWIFT_VERSION = 3.0; 558 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StatusBarNotificationCenter_Example.app/StatusBarNotificationCenter_Example"; 559 | }; 560 | name = Debug; 561 | }; 562 | 607FACF41AFB9204008FA782 /* Release */ = { 563 | isa = XCBuildConfiguration; 564 | baseConfigurationReference = 8F58400749F62295D00DF979 /* Pods-StatusBarNotificationCenter_Tests.release.xcconfig */; 565 | buildSettings = { 566 | BUNDLE_LOADER = "$(TEST_HOST)"; 567 | FRAMEWORK_SEARCH_PATHS = ( 568 | "$(SDKROOT)/Developer/Library/Frameworks", 569 | "$(inherited)", 570 | ); 571 | INFOPLIST_FILE = Tests/Info.plist; 572 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 573 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 574 | PRODUCT_NAME = "$(TARGET_NAME)"; 575 | SWIFT_VERSION = 3.0; 576 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/StatusBarNotificationCenter_Example.app/StatusBarNotificationCenter_Example"; 577 | }; 578 | name = Release; 579 | }; 580 | /* End XCBuildConfiguration section */ 581 | 582 | /* Begin XCConfigurationList section */ 583 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "StatusBarNotificationCenter" */ = { 584 | isa = XCConfigurationList; 585 | buildConfigurations = ( 586 | 607FACED1AFB9204008FA782 /* Debug */, 587 | 607FACEE1AFB9204008FA782 /* Release */, 588 | ); 589 | defaultConfigurationIsVisible = 0; 590 | defaultConfigurationName = Release; 591 | }; 592 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "StatusBarNotificationCenter_Example" */ = { 593 | isa = XCConfigurationList; 594 | buildConfigurations = ( 595 | 607FACF01AFB9204008FA782 /* Debug */, 596 | 607FACF11AFB9204008FA782 /* Release */, 597 | ); 598 | defaultConfigurationIsVisible = 0; 599 | defaultConfigurationName = Release; 600 | }; 601 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "StatusBarNotificationCenter_Tests" */ = { 602 | isa = XCConfigurationList; 603 | buildConfigurations = ( 604 | 607FACF31AFB9204008FA782 /* Debug */, 605 | 607FACF41AFB9204008FA782 /* Release */, 606 | ); 607 | defaultConfigurationIsVisible = 0; 608 | defaultConfigurationName = Release; 609 | }; 610 | /* End XCConfigurationList section */ 611 | }; 612 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 613 | } 614 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter.xcodeproj/xcshareddata/xcschemes/StatusBarNotificationCenter-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // StatusBarNotificationCenter 4 | // 5 | // Created by Shannon Wu on 09/18/2015. 6 | // Copyright (c) 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import StatusBarNotificationCenter 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | return true 21 | } 22 | 23 | func applicationWillResignActive(_ application: UIApplication) { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | func applicationDidEnterBackground(_ application: UIApplication) { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | func applicationWillEnterForeground(_ application: UIApplication) { 34 | // 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. 35 | } 36 | 37 | func applicationDidBecomeActive(_ application: UIApplication) { 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 | func applicationWillTerminate(_ application: UIApplication) { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/Main View Controller/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 128 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 164 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 188 | 189 | 190 | 191 | 192 | 193 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 214 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/Main View Controller/NotificationView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/StatusBarNotificationCenter/Main View Controller/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/16/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import StatusBarNotificationCenter 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var durationLabel: UILabel! 15 | @IBOutlet weak var notificationTextField: UITextField! 16 | @IBOutlet weak var durationSlider: UISlider! 17 | @IBOutlet weak var segFromStyle: UISegmentedControl! 18 | @IBOutlet weak var segToStyle: UISegmentedControl! 19 | @IBOutlet weak var segNotificationType: UISegmentedControl! 20 | @IBOutlet weak var segAnimationType: UISegmentedControl! 21 | @IBOutlet weak var heightLabel: UILabel! 22 | @IBOutlet weak var multiLine: UISwitch! 23 | @IBOutlet weak var isCustomView: UISwitch! 24 | @IBOutlet weak var concurrentNotificationNumberLabel: UILabel! 25 | @IBOutlet weak var concurrentNotificationNumberSlider: UISlider! 26 | 27 | @IBOutlet weak var heightSlider: UISlider! 28 | 29 | let notificationQ = DispatchQueue(label: "ViewControllerNotificationQ", attributes: DispatchQueue.Attributes.concurrent) 30 | 31 | var notificationCenter: StatusBarNotificationCenter! 32 | 33 | override func viewDidLoad() { 34 | let labelText = "\(durationSlider.value) seconds" 35 | durationLabel.text = labelText 36 | notificationTextField.text = "Hello, Programmer" 37 | } 38 | 39 | @IBAction func durationValueChanged(_ sender: UISlider) { 40 | let labelText = "\(sender.value) seconds" 41 | durationLabel.text = labelText 42 | } 43 | 44 | @IBAction func heightValueChanged(_ sender: UISlider) { 45 | let labelText = sender.value == 0 ? "Standard Height" : "\(sender.value) of the screen height" 46 | heightLabel.text = labelText 47 | } 48 | 49 | @IBAction func notificationNumberChanged(_ sender: UISlider) { 50 | let labelText = "\(Int(concurrentNotificationNumberSlider.value))" 51 | concurrentNotificationNumberLabel.text = labelText 52 | } 53 | 54 | 55 | @IBAction func showNotification(_ sender: UIButton) { 56 | var notificationCenterConfiguration = NotificationCenterConfiguration(baseWindow: view.window!) 57 | notificationCenterConfiguration.animateInDirection = StatusBarNotificationCenter.AnimationDirection(rawValue: segFromStyle.selectedSegmentIndex)! 58 | notificationCenterConfiguration.animateOutDirection = StatusBarNotificationCenter.AnimationDirection(rawValue: segToStyle.selectedSegmentIndex)! 59 | notificationCenterConfiguration.animationType = StatusBarNotificationCenter.AnimationType(rawValue: segAnimationType.selectedSegmentIndex)! 60 | notificationCenterConfiguration.style = StatusBarNotificationCenter.Style(rawValue: segNotificationType.selectedSegmentIndex)! 61 | notificationCenterConfiguration.height = (UIScreen.main.bounds.height * CGFloat(heightSlider.value)) 62 | notificationCenterConfiguration.animateInLength = 0.25 63 | notificationCenterConfiguration.animateOutLength = 0.75 64 | notificationCenterConfiguration.style = StatusBarNotificationCenter.Style(rawValue: segNotificationType.selectedSegmentIndex)! 65 | notificationQ.async { () -> Void in 66 | for i in 1...Int(self.concurrentNotificationNumberSlider.value) { 67 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(Double(i) * drand48() * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: { () -> Void in 68 | if self.isCustomView.isOn { 69 | let nibContents = Bundle.main.loadNibNamed("NotificationView", owner: self, options: nil) 70 | let view = nibContents?.first as! UIView 71 | StatusBarNotificationCenter.showStatusBarNotificationWithView(view, forDuration: TimeInterval(self.durationSlider.value), withNotificationCenterConfiguration: notificationCenterConfiguration) 72 | } else { 73 | var notificationLabelConfiguration = NotificationLabelConfiguration() 74 | notificationLabelConfiguration.font = UIFont.systemFont(ofSize: 14.0) 75 | notificationLabelConfiguration.multiline = self.multiLine.isOn 76 | notificationLabelConfiguration.backgroundColor = self.view.tintColor 77 | notificationLabelConfiguration.textColor = UIColor.black 78 | StatusBarNotificationCenter.showStatusBarNotificationWithMessage(self.notificationTextField.text! + "\(i)", forDuration: TimeInterval(self.durationSlider.value), withNotificationCenterConfiguration: notificationCenterConfiguration, andNotificationLabelConfiguration: notificationLabelConfiguration) 79 | } 80 | 81 | }) 82 | 83 | } 84 | } 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import StatusBarNotificationCenter 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measure() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Shannon Wu 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/Configuration/NotificationCenterConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationCenterConfiguration.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/18/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | * Customize the overall configuration information of the notification, most of the property's default value is OK for most circumstance, but you can customize it if you want 13 | */ 14 | public struct NotificationCenterConfiguration { 15 | /// The window below the notification window, you must set this property, or the notification will not work correctly 16 | var baseWindow: UIWindow 17 | /// The style of the notification, default to status bar notification 18 | public var style = StatusBarNotificationCenter.Style.statusBar 19 | /// The animation type of the notification, default to overlay 20 | public var animationType = StatusBarNotificationCenter.AnimationType.overlay 21 | /// The animate in direction of the notification, default to top 22 | public var animateInDirection = StatusBarNotificationCenter.AnimationDirection.top 23 | /// The animate out direction of the notification, default to top 24 | public var animateOutDirection = StatusBarNotificationCenter.AnimationDirection.top 25 | /// Whether the user can tap on the notification to dismiss the notification, default to true 26 | public var dismissible = true 27 | /// The animate in time of the notification 28 | public var animateInLength: TimeInterval = 0.25 29 | /// The animate out time of the notification 30 | public var animateOutLength: TimeInterval = 0.25 31 | /// The height of the notification view, if you want to use a custom height, set the style of the notification to custom, or it will use the status bar and navigation bar height 32 | public var height: CGFloat = 0 33 | /// If the status bar is hidden, if it is hidden, the hight of the navigation style notification height is the height of the navigation bar, default to false 34 | public var statusBarIsHidden: Bool = false 35 | /// The height of the navigation bar, default to 44.0 points 36 | public var navigationBarHeight: CGFloat = 44.0 37 | /// Should allow the user to interact with the content outside the notification 38 | public var userInteractionEnabled = true 39 | /// The window level of the notification window 40 | public var level: CGFloat = UIWindowLevelNormal 41 | 42 | /** 43 | Initializer 44 | 45 | - parameter baseWindow: the base window of the notification 46 | 47 | - returns: a default NotificationCenterConfiguration instance 48 | */ 49 | public init(baseWindow: UIWindow) { 50 | self.baseWindow = baseWindow 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pod/Configuration/NotificationLabelConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationLabelConfiguration.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/18/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | * If you use the default label to show the notification, you should send a customized configuration struct, the dufault implementation is a nonscrollabel label, with one line to show the information 13 | */ 14 | public struct NotificationLabelConfiguration { 15 | /// if the label should scroll the content, default to false 16 | public var scrollabel = true 17 | /// If you set the scrollabel property to true, you can use this property to customize the scroll delay, default delay is 1 second 18 | public var scrollDelay: TimeInterval = 1.0 19 | /// If you set the scrollabel property to true, you can use this property to customize the scroll speed, default speed is 40 points per second 20 | public var scrollSpeed: CGFloat = 40.0 21 | /// Set the padding of the message label, default to 10.0 points 22 | public var padding: CGFloat = 10.0 23 | /// if the label should be multiline implementation, default to false 24 | public var multiline = false 25 | /// The background color of the notification view, default to black color 26 | public var backgroundColor = UIColor.black 27 | /// The text color of the notification view, default to white color 28 | public var textColor = UIColor.white 29 | /// The font of the notification label, defalt to a system font of size 14.0, if you pass the attributed string, this property will be ignored 30 | public var font = UIFont.systemFont(ofSize: StatusBarNotificationCenter.defaultMessageLabelFontSize) 31 | /// this property is not nil, the label will use the attributed string to show the message 32 | public var attributedText: NSAttributedString? = nil 33 | 34 | /** 35 | Init a new default notification label configuration 36 | 37 | - returns: a new default notification label configuration 38 | */ 39 | public init() { 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Pod/Notification Center/BaseScrollLabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseScrollLabel.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/17/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// A subclass of UILabel to implement the scrolling trait 12 | class BaseScrollLabel: UILabel { 13 | //MARK: - Properties 14 | 15 | var messageImage = UIImageView() 16 | var scrollable: Bool = true 17 | var scrollSpeed: CGFloat = 40.0 18 | var scrollDelay: TimeInterval = 1.0 19 | var padding: CGFloat = 10.0 20 | 21 | var fullWidth: CGFloat { 22 | guard let message = text else { return 0 } 23 | return (message as NSString).size(attributes: [NSFontAttributeName : font]).width 24 | } 25 | 26 | var scrollOffset: CGFloat { 27 | if (numberOfLines != 1) || !scrollable { return 0 } 28 | let insetRect = bounds.insetBy(dx: padding, dy: 0) 29 | return max(0, fullWidth - insetRect.width) 30 | } 31 | 32 | var scrollTime: TimeInterval { 33 | return (scrollOffset > 0) ? TimeInterval(scrollOffset / scrollSpeed) + scrollDelay : 0 34 | } 35 | 36 | override func drawText(in rect: CGRect) { 37 | var rect = rect 38 | if scrollOffset > 0 { 39 | rect.size.width = fullWidth + padding * 2 40 | 41 | UIGraphicsBeginImageContextWithOptions(rect.size, false, UIScreen.main.scale) 42 | super.drawText(in: rect) 43 | messageImage.image = UIGraphicsGetImageFromCurrentImageContext() 44 | UIGraphicsEndImageContext() 45 | 46 | messageImage.sizeToFit() 47 | addSubview(messageImage) 48 | 49 | UIView.animate(withDuration: scrollTime - scrollDelay, delay: scrollDelay, options: .beginFromCurrentState, animations: { () -> Void in 50 | self.messageImage.transform = CGAffineTransform(translationX: -self.scrollOffset, y: 0) 51 | }, completion: { (finished) -> Void in 52 | // 53 | }) 54 | 55 | } else { 56 | messageImage.removeFromSuperview() 57 | super.drawText(in: rect.insetBy(dx: padding, dy: padding)) 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Pod/Notification Center/BaseViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/17/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// The view controller object of the notification window 12 | class BaseViewController: UIViewController { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Pod/Notification Center/BaseWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseWindow.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/17/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// The window of the notification center 12 | class BaseWindow: UIWindow { 13 | weak var notificationCenter: StatusBarNotificationCenter! 14 | 15 | override init(frame: CGRect) { 16 | super.init(frame: frame) 17 | 18 | backgroundColor = UIColor.clear 19 | isUserInteractionEnabled = true 20 | isHidden = true 21 | windowLevel = UIWindowLevelNormal 22 | rootViewController = BaseViewController() 23 | } 24 | 25 | required init?(coder aDecoder: NSCoder) { 26 | fatalError("init(coder:) has not been implemented") 27 | } 28 | 29 | func resetRootViewController() { 30 | if let rootViewController = rootViewController as? BaseViewController { 31 | for view in rootViewController.view.subviews { 32 | view.removeFromSuperview() 33 | } 34 | } 35 | } 36 | 37 | override func hitTest(_ pt: CGPoint, with event: UIEvent?) -> UIView? { 38 | if pt.y > 0 && pt.y < (notificationCenter.internalnotificationViewHeight) { 39 | return super.hitTest(pt, with: event) 40 | } 41 | return nil 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Pod/Notification Center/StatusBarNotificationCenter+Logic.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarNotificationCenter+Public Interface.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/17/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Notification center logic 12 | extension StatusBarNotificationCenter { 13 | //MARK: - Notification Management 14 | /** 15 | Show a status bar notification with custom view, and dismiss it automatically 16 | 17 | - parameter view: the custom view of the notification 18 | - parameter duration: the showing time of the notification 19 | - parameter notificationCenterConfiguration: the notification configuration 20 | */ 21 | public class func showStatusBarNotificationWithView(_ view: UIView, forDuration duration: TimeInterval, withNotificationCenterConfiguration notificationCenterConfiguration: NotificationCenterConfiguration) { 22 | let notification = Notification(view: view, message:nil, notificationCenterConfiguration: notificationCenterConfiguration, viewSource: .customView, notificationLabelConfiguration: nil, duration: duration, completionHandler: nil) 23 | StatusBarNotificationCenter.center.processNotification(notification) 24 | } 25 | 26 | /** 27 | Show a status bar notification with custom view, you can pass a completion hander to be invoked when the notification is showed, but you must dismiss it yourself 28 | 29 | - parameter view: the custom view of the notification 30 | - parameter notificationCenterConfiguration: the notification configuration 31 | - parameter completionHandler: the block to be invoked when the notification is being showed 32 | */ 33 | public class func showStatusBarNotificationWithView(_ view: UIView, withNotificationCenterConfiguration notificationCenterConfiguration: NotificationCenterConfiguration, whenComplete completionHandler: ((Void) -> Void)? = nil) { 34 | let notification = Notification(view: view, message:nil, notificationCenterConfiguration: notificationCenterConfiguration, viewSource: .customView, notificationLabelConfiguration: nil, duration: nil, completionHandler: completionHandler) 35 | StatusBarNotificationCenter.center.processNotification(notification) 36 | } 37 | 38 | /** 39 | Show a status bar notification with a label, and dismiss it automatically 40 | 41 | - parameter message: the message to be showed 42 | - parameter duration: the showing time of the notification 43 | - parameter notificationCenterConfiguration: the notification configuration 44 | - parameter andNotificationLabelConfiguration: the label configuration 45 | */ 46 | public class func showStatusBarNotificationWithMessage(_ message: String?, forDuration duration: TimeInterval, withNotificationCenterConfiguration notificationCenterConfiguration: NotificationCenterConfiguration, andNotificationLabelConfiguration notificationLabelConfiguration: NotificationLabelConfiguration) { 47 | let notification = Notification(view: nil, message:message, notificationCenterConfiguration: notificationCenterConfiguration, viewSource: .label, notificationLabelConfiguration: notificationLabelConfiguration, duration: duration, completionHandler: nil) 48 | StatusBarNotificationCenter.center.processNotification(notification) 49 | } 50 | 51 | /** 52 | Show a status bar notification with a label, you can pass a completion hander to be invoked when the notification is showed, but you must dismiss it yourself 53 | 54 | - parameter message: the message to be showed 55 | - parameter notificationCenterConfiguration: the notification configuration 56 | - parameter andNotificationLabelConfiguration: the label configuration 57 | - parameter completionHandler: the block to be invoked when the notification is being showed 58 | */ 59 | public class func showStatusBarNotificationWithMessage(_ message: String?, withNotificationCenterConfiguration notificationCenterConfiguration: NotificationCenterConfiguration, andNotificationLabelConfiguration notificationLabelConfiguration: NotificationLabelConfiguration, whenComplete completionHandler: ((Void) -> Void)? = nil) { 60 | let notification = Notification(view: nil, message:message, notificationCenterConfiguration: notificationCenterConfiguration, viewSource: .label, notificationLabelConfiguration: notificationLabelConfiguration, duration: nil, completionHandler: completionHandler) 61 | StatusBarNotificationCenter.center.processNotification(notification) 62 | } 63 | 64 | /** 65 | A helper method to precess the notification 66 | 67 | - parameter notification: the notification to be processed 68 | */ 69 | func processNotification(_ notification: Notification) { 70 | notificationQ.async { () -> Void in 71 | StatusBarNotificationCenter.center.notifications.append(notification) 72 | StatusBarNotificationCenter.center.showNotification() 73 | } 74 | } 75 | 76 | /** 77 | This is the hub of all notifications, just use a semaphore to manage the showing process 78 | */ 79 | func showNotification() { 80 | if (self.notificationSemaphore.wait(timeout: DispatchTime.distantFuture) == .success) { 81 | DispatchQueue.main.sync(execute: { () -> Void in 82 | if self.notifications.count > 0 { 83 | let currentNotification = self.notifications.removeFirst() 84 | 85 | self.notificationCenterConfiguration = currentNotification.notificationCenterConfiguration 86 | self.notificationLabelConfiguration = currentNotification.notificationLabelConfiguration 87 | self.notificationWindow.resetRootViewController() 88 | switch currentNotification.viewSource { 89 | case .customView: 90 | self.viewSource = .customView 91 | 92 | if let duration = currentNotification.duration { 93 | self.showStatusBarNotificationWithView(currentNotification.view, forDuration: duration) 94 | } else { 95 | self.showStatusBarNotificationWithView(currentNotification.view, completion: currentNotification.completionHandler) 96 | } 97 | case .label: 98 | self.viewSource = .label 99 | 100 | if let duration = currentNotification.duration { 101 | self.showStatusBarNotificationWithMessage(currentNotification.message, forDuration: duration) 102 | } else { 103 | self.showStatusBarNotificationWithMessage(currentNotification.message, completion: currentNotification.completionHandler) 104 | } 105 | } 106 | } else { 107 | return 108 | } 109 | }) 110 | } 111 | } 112 | 113 | func showStatusBarNotificationWithMessage(_ message: String?, completion: (() -> Void)?) { 114 | 115 | self.createMessageLabelWithMessage(message) 116 | self.createSnapshotView() 117 | notificationWindow.windowLevel = notificationCenterConfiguration.level 118 | 119 | if let messageLabel = self.messageLabel { 120 | self.notificationWindow.rootViewController?.view.addSubview(messageLabel) 121 | self.notificationWindow.rootViewController?.view.bringSubview(toFront: messageLabel) 122 | } 123 | self.notificationWindow.isHidden = false 124 | 125 | NotificationCenter.default.addObserver(self, selector: #selector(StatusBarNotificationCenter.screenOrientationChanged), name: NSNotification.Name.UIApplicationDidChangeStatusBarOrientation, object: nil) 126 | 127 | UIView.animate(withDuration: self.animateInLength, animations: { () -> Void in 128 | self.animateInFrameChange() 129 | }, completion: { (finished) -> Void in 130 | let delayInSeconds = lround(self.messageLabel.scrollTime) 131 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(delayInSeconds), execute: { () -> Void in 132 | if let completion = completion { 133 | completion() 134 | } 135 | }) 136 | }) 137 | 138 | } 139 | 140 | func showStatusBarNotificationWithMessage(_ message: String?, forDuration duration: TimeInterval) { 141 | self.showStatusBarNotificationWithMessage(message) { () -> Void in 142 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(lround(duration)), execute: { () -> Void in 143 | self.dismissNotification() 144 | }) 145 | } 146 | } 147 | 148 | func showStatusBarNotificationWithView(_ view: UIView, completion: ((Void) -> Void)?) { 149 | 150 | self.notificationWindow.isHidden = false 151 | 152 | self.customView = view 153 | self.notificationWindow.rootViewController?.view.addSubview(view) 154 | self.notificationWindow.rootViewController?.view.bringSubview(toFront: view) 155 | self.createSnapshotView() 156 | 157 | NotificationCenter.default.addObserver(self, selector: #selector(StatusBarNotificationCenter.screenOrientationChanged), name: NSNotification.Name.UIApplicationDidChangeStatusBarOrientation, object: nil) 158 | 159 | UIView.animate(withDuration: self.animateInLength, animations: { () -> Void in 160 | self.animateInFrameChange() 161 | }, completion: { (finished) -> Void in 162 | completion?() 163 | }) 164 | 165 | } 166 | 167 | func showStatusBarNotificationWithView(_ view: UIView, forDuration duration: TimeInterval) { 168 | self.showStatusBarNotificationWithView(view) { () -> Void in 169 | DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(lround(duration)), execute: { () -> Void in 170 | self.dismissNotification() 171 | }) 172 | } 173 | } 174 | 175 | /** 176 | Dismiss the currently showing notification, and you can pass a completion handler, if you want to dismiss the currently showing notification 177 | 178 | - parameter completion: completion handler to invoke when the dismiss procedure finished 179 | */ 180 | public class func dismissNotificationWithCompletion(_ completion: (() -> Void)?) { 181 | StatusBarNotificationCenter.center.dismissNotificationWithCompletion(completion) 182 | } 183 | 184 | func dismissNotificationWithCompletion(_ completion: (() -> Void)?) { 185 | guard notificationCenterConfiguration != nil else { return } 186 | 187 | self.middleFrameChange() 188 | UIView.animate(withDuration: self.animateOutLength, animations: { () -> Void in 189 | self.animateOutFrameChange() 190 | }, completion: { (finished) -> Void in 191 | self.notificationWindow.isHidden = true 192 | self.messageLabel = nil 193 | self.snapshotView = nil 194 | self.customView = nil 195 | 196 | self.notificationLabelConfiguration = nil 197 | self.notificationCenterConfiguration = nil 198 | 199 | NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIApplicationDidChangeStatusBarOrientation, object: nil) 200 | 201 | if let completion = completion { 202 | completion() 203 | } 204 | 205 | self.notificationSemaphore.signal() 206 | }) 207 | } 208 | 209 | func dismissNotification() { 210 | if self.dismissible { 211 | self.dismissNotificationWithCompletion(nil) 212 | } 213 | } 214 | 215 | 216 | //MARK: - Handle Change 217 | 218 | func notificationTapped(_ tapGesture: UITapGestureRecognizer) { 219 | dismissNotification() 220 | } 221 | 222 | func screenOrientationChanged() { 223 | switch viewSource { 224 | case .label: 225 | messageLabel?.frame = notificationViewFrame 226 | case .customView: 227 | customView?.frame = notificationViewFrame 228 | } 229 | } 230 | 231 | //MARK: - Helper animation state 232 | 233 | func animateInFrameChange() { 234 | let view: UIView? 235 | switch viewSource { 236 | case .label: 237 | view = messageLabel 238 | case .customView: 239 | view = customView 240 | } 241 | 242 | view?.frame = notificationViewFrame 243 | 244 | switch animateInDirection { 245 | case .top: 246 | snapshotView?.frame = notificationViewBottomFrame 247 | case .left: 248 | snapshotView?.frame = notificationViewRightFrame 249 | case .right: 250 | snapshotView?.frame = notificationViewLeftFrame 251 | case .bottom: 252 | snapshotView?.frame = notificationViewTopFrame 253 | } 254 | } 255 | 256 | func middleFrameChange() { 257 | switch animateOutDirection { 258 | case .top: 259 | snapshotView?.frame = notificationViewBottomFrame 260 | case .left: 261 | snapshotView?.frame = notificationViewRightFrame 262 | case .right: 263 | snapshotView?.frame = notificationViewLeftFrame 264 | case .bottom: 265 | snapshotView?.frame = notificationViewTopFrame 266 | } 267 | } 268 | 269 | func animateOutFrameChange() { 270 | let view: UIView? 271 | switch viewSource { 272 | case .label: 273 | view = messageLabel 274 | case .customView: 275 | view = customView 276 | } 277 | 278 | snapshotView?.frame = notificationViewFrame 279 | switch animateOutDirection { 280 | case .top: 281 | view?.frame = notificationViewTopFrame 282 | case .left: 283 | view?.frame = notificationViewLeftFrame 284 | case .right: 285 | view?.frame = notificationViewRightFrame 286 | case .bottom: 287 | view?.frame = notificationViewBottomFrame 288 | } 289 | } 290 | 291 | //MARK: - Helper view creation 292 | 293 | func createMessageLabelWithMessage(_ message: String?) { 294 | messageLabel = BaseScrollLabel() 295 | messageLabel?.text = message 296 | messageLabel?.textAlignment = .center 297 | messageLabel?.font = messageLabelFont 298 | messageLabel?.numberOfLines = messageLabelMultiline ? 0 : 1 299 | messageLabel?.textColor = messageLabelTextColor 300 | messageLabel?.backgroundColor = messageLabelBackgroundColor 301 | messageLabel?.scrollable = messageLabelScrollable 302 | messageLabel?.scrollSpeed = messageLabelScrollSpeed 303 | messageLabel?.scrollDelay = messageLabelScrollDelay 304 | messageLabel?.padding = messageLabelPadding 305 | if let messageLabelAttributedText = messageLabelAttributedText { 306 | messageLabel?.attributedText = messageLabelAttributedText 307 | } 308 | setupNotificationView(messageLabel) 309 | } 310 | 311 | func setupNotificationView(_ view: UIView?) { 312 | view?.clipsToBounds = true 313 | view?.isUserInteractionEnabled = true 314 | 315 | if self.dismissible { 316 | let tapGesture = UITapGestureRecognizer(target: self, action: #selector(StatusBarNotificationCenter.notificationTapped(_:))) 317 | view?.addGestureRecognizer(tapGesture) 318 | } 319 | 320 | switch animateInDirection { 321 | case .top: 322 | view?.frame = notificationViewTopFrame 323 | case .left: 324 | view?.frame = notificationViewLeftFrame 325 | case .right: 326 | view?.frame = notificationViewRightFrame 327 | case .bottom: 328 | view?.frame = notificationViewBottomFrame 329 | } 330 | } 331 | 332 | func createSnapshotView() { 333 | if animationType != .replace { return } 334 | 335 | snapshotView = UIView(frame: notificationViewFrame) 336 | snapshotView!.clipsToBounds = true 337 | snapshotView!.backgroundColor = UIColor.clear 338 | 339 | let view = baseWindow.snapshotView(afterScreenUpdates: true) 340 | snapshotView!.addSubview(view!) 341 | notificationWindow.rootViewController?.view.addSubview(snapshotView!) 342 | notificationWindow.rootViewController?.view.sendSubview(toBack: snapshotView!) 343 | } 344 | } 345 | -------------------------------------------------------------------------------- /Pod/Notification Center/StatusBarNotificationCenter+Type.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarNotification+Type.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/15/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Notification center types 12 | extension StatusBarNotificationCenter { 13 | //MARK: - Types 14 | 15 | /** 16 | Notification Style 17 | - StatusBar: Covers the status bar portion of the screen 18 | - NavigationBar: Covers the status bar and navigation bar portions of the screen 19 | */ 20 | public enum Style: NSInteger { 21 | /** 22 | * Covers the statusbar portion of the screen, if the status bar is hidden, cover the status bar height of the screen 23 | */ 24 | case statusBar 25 | /** 26 | * Covers the status bar and navigation bar portion of the screen 27 | */ 28 | case navigationBar 29 | /** 30 | * Cover part of the screen, based on the height of the configuration 31 | */ 32 | case custom 33 | } 34 | 35 | /** 36 | The direction of animation for the notification 37 | 38 | - Top: Animate in from the top or animate out to the top 39 | - Bottom: Animate in from the bottom or animate out to the bottom 40 | - Left: Animate in from the left or animate out to the left 41 | - Right: Animate in from the right or animate out to the right 42 | */ 43 | public enum AnimationDirection: NSInteger { 44 | /** 45 | * Animate in from the top or animate out to the top 46 | */ 47 | case top 48 | /** 49 | * Animate in from the bottom or animate out to the bottom 50 | */ 51 | case bottom 52 | /** 53 | * Animate in from the left or animate out to the left 54 | */ 55 | case left 56 | /** 57 | * Animate in from the right or animate out to the right 58 | */ 59 | case right 60 | } 61 | 62 | /** 63 | Determines whether the notification moves the existing content out of the way or simply overlays it. 64 | 65 | - Replace: Moves existing content out of the way 66 | - Overlay: Ovelays existing content 67 | */ 68 | public enum AnimationType: NSInteger { 69 | /** 70 | * Moves existing content out of the way 71 | */ 72 | case replace 73 | /** 74 | * Ovelays existing content 75 | */ 76 | case overlay 77 | } 78 | 79 | /** 80 | The view source of the notification 81 | 82 | - CustomView: Use a custom view to show the notification 83 | - Label: Use the default label to show the notification 84 | */ 85 | enum ViewSource: NSInteger { 86 | /** 87 | * Use a custom view to show the notification 88 | */ 89 | case customView 90 | /** 91 | * Use the default label to show the notification 92 | */ 93 | case label 94 | } 95 | 96 | /** 97 | * This is the base element of the notification queue 98 | */ 99 | struct Notification { 100 | /// This is the notification center configuration object 101 | let notificationCenterConfiguration: NotificationCenterConfiguration 102 | /// This the notification label configuration object 103 | let notificationLabelConfiguration: NotificationLabelConfiguration? 104 | /// This is the duration of the notification 105 | let duration: TimeInterval? 106 | /// The view source of the notification 107 | let viewSource: ViewSource 108 | /// The view of the notification, if the view source is a custom view 109 | let view: UIView! 110 | /// The completion handler to be called when the show process is done 111 | let completionHandler: ((Void) -> Void)? 112 | /// The message of the notification, if the view source is a label 113 | let message: String! 114 | 115 | 116 | /** 117 | Init a new notification object 118 | 119 | - parameter notificationCenterConfiguration: This is the notification center configuration object 120 | - parameter viewSource: The view source of the notification 121 | - parameter notificationLabelConfiguration: This the notification label configuration object 122 | - parameter duration: This is the duration of the notification 123 | - parameter completionHandler: The completion handler to be called when the show process is done 124 | 125 | - returns: a newly initialtiated notification 126 | */ 127 | init(view: UIView?, message: String?, notificationCenterConfiguration: NotificationCenterConfiguration, viewSource: ViewSource, notificationLabelConfiguration:NotificationLabelConfiguration?, duration: TimeInterval?, completionHandler: ((Void) -> Void)?) { 128 | self.view = view 129 | self.message = message 130 | self.notificationCenterConfiguration = notificationCenterConfiguration 131 | self.notificationLabelConfiguration = notificationLabelConfiguration 132 | self.duration = duration 133 | self.viewSource = viewSource 134 | self.completionHandler = completionHandler 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Pod/Notification Center/StatusBarNotificationCenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // File.swift 3 | // StatusBarNotification 4 | // 5 | // Created by Shannon Wu on 9/16/15. 6 | // Copyright © 2015 Shannon Wu. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// This is the base class of the notification center object, mainly to define properties 12 | open class StatusBarNotificationCenter: NSObject { 13 | //MARK: - Initializers 14 | 15 | fileprivate override init() { 16 | super.init() 17 | 18 | notificationWindow.notificationCenter = self 19 | } 20 | 21 | /// The single status bar notification center 22 | class var center: StatusBarNotificationCenter { 23 | struct SingletonWrapper { 24 | static let singleton = StatusBarNotificationCenter() 25 | } 26 | return SingletonWrapper.singleton 27 | } 28 | 29 | //MARK: - Snapshoot View 30 | var snapshotView: UIView? 31 | 32 | //MARK: Message Label 33 | var messageLabel: BaseScrollLabel! 34 | var messageLabelScrollable: Bool { 35 | if let notificationLabelConfiguration = notificationLabelConfiguration { 36 | return notificationLabelConfiguration.scrollabel 37 | } else { 38 | fatalError("Cannot reach this branch") 39 | } 40 | } 41 | var messageLabelBackgroundColor: UIColor { 42 | if let notificationLabelConfiguration = notificationLabelConfiguration { 43 | return notificationLabelConfiguration.backgroundColor 44 | } else { 45 | fatalError("Cannot reach this branch") 46 | } 47 | } 48 | var messageLabelTextColor: UIColor { 49 | if let notificationLabelConfiguration = notificationLabelConfiguration { 50 | return notificationLabelConfiguration.textColor 51 | } else { 52 | fatalError("Cannot reach this branch") 53 | } 54 | } 55 | var messageLabelMultiline: Bool { 56 | if let notificationLabelConfiguration = notificationLabelConfiguration { 57 | return notificationLabelConfiguration.multiline 58 | } else { 59 | fatalError("Cannot reach this branch") 60 | } 61 | } 62 | var messageLabelFont: UIFont { 63 | if let notificationLabelConfiguration = notificationLabelConfiguration { 64 | return notificationLabelConfiguration.font 65 | } else { 66 | fatalError("Cannot reach this branch") 67 | } 68 | } 69 | var messageLabelScrollSpeed: CGFloat { 70 | if let notificationLabelConfiguration = notificationLabelConfiguration { 71 | return notificationLabelConfiguration.scrollSpeed 72 | } else { 73 | fatalError("Cannot reach this branch") 74 | } 75 | } 76 | var messageLabelScrollDelay: TimeInterval { 77 | if let notificationLabelConfiguration = notificationLabelConfiguration { 78 | return notificationLabelConfiguration.scrollDelay 79 | } else { 80 | fatalError("Cannot reach this branch") 81 | } 82 | } 83 | var messageLabelPadding: CGFloat { 84 | if let notificationLabelConfiguration = notificationLabelConfiguration { 85 | return notificationLabelConfiguration.padding 86 | } else { 87 | fatalError("Cannot reach this branch") 88 | } 89 | } 90 | var messageLabelAttributedText: NSAttributedString? { 91 | if let notificationLabelConfiguration = notificationLabelConfiguration { 92 | return notificationLabelConfiguration.attributedText 93 | } else { 94 | fatalError("Cannot reach this branch") 95 | } 96 | } 97 | /// The default message label font size, default to 14.0 points, if you want to use the default label and want to change its font size, you can use this property to configure it 98 | static var defaultMessageLabelFontSize: CGFloat = 14 99 | 100 | //MARK: Notification View 101 | var notificationViewWidth: CGFloat { 102 | return baseWindow.bounds.width 103 | } 104 | 105 | var notificationViewHeight: CGFloat { 106 | if let notificationCenterConfiguration = notificationCenterConfiguration { 107 | return notificationCenterConfiguration.height 108 | } else { 109 | fatalError("Cannot reach this branch") 110 | } 111 | } 112 | var internalnotificationViewHeight: CGFloat { 113 | switch notificationStyle { 114 | case .statusBar: 115 | return statusBarHeight 116 | case .navigationBar: 117 | if statusBarIsHidden { 118 | return navigationBarHeight 119 | } else { 120 | return statusBarHeight + navigationBarHeight 121 | } 122 | case .custom: 123 | return notificationViewHeight 124 | } 125 | } 126 | 127 | var notificationViewFrame: CGRect { 128 | return CGRect(x: 0, y: 0, width: notificationViewWidth, height: internalnotificationViewHeight) 129 | } 130 | var notificationViewTopFrame: CGRect { 131 | return CGRect(x: 0, y: -internalnotificationViewHeight, width: notificationViewWidth, height: internalnotificationViewHeight) 132 | } 133 | var notificationViewLeftFrame: CGRect { 134 | return CGRect(x: -notificationViewWidth, y: 0, width: notificationViewWidth, height: internalnotificationViewHeight) 135 | } 136 | var notificationViewRightFrame: CGRect { 137 | return CGRect(x: notificationViewWidth, y: 0, width: notificationViewWidth, height: internalnotificationViewHeight) 138 | } 139 | var notificationViewBottomFrame: CGRect { 140 | return CGRect(x: 0, y: internalnotificationViewHeight, width: notificationViewWidth, height: 0) 141 | } 142 | 143 | //MARK: Custom View 144 | var viewSource: ViewSource = .label 145 | var customView: UIView? { 146 | didSet { 147 | if customView != nil { 148 | setupNotificationView(customView) 149 | } 150 | } 151 | } 152 | 153 | //MARK: Status Bar 154 | var statusBarIsHidden: Bool = false 155 | var statusBarHeight: CGFloat { 156 | return 20.0 157 | } 158 | 159 | //MARK: Navigation Bar 160 | var navigationBarHeight: CGFloat { 161 | if let notificationCenterConfiguration = notificationCenterConfiguration { 162 | return notificationCenterConfiguration.navigationBarHeight 163 | } else { 164 | fatalError("Cannot reach this branch") 165 | } 166 | } 167 | 168 | //MARK: Animation Parameter 169 | var notificationStyle: Style { 170 | if let notificationCenterConfiguration = notificationCenterConfiguration { 171 | return notificationCenterConfiguration.style 172 | } else { 173 | fatalError("Cannot reach this branch") 174 | } 175 | } 176 | var animateInDirection: AnimationDirection { 177 | if let notificationCenterConfiguration = notificationCenterConfiguration { 178 | return notificationCenterConfiguration.animateInDirection 179 | } else { 180 | fatalError("Cannot reach this branch") 181 | } 182 | } 183 | var animateOutDirection: AnimationDirection { 184 | if let notificationCenterConfiguration = notificationCenterConfiguration { 185 | return notificationCenterConfiguration.animateOutDirection 186 | } else { 187 | fatalError("Cannot reach this branch") 188 | } 189 | } 190 | var animationType: AnimationType { 191 | if let notificationCenterConfiguration = notificationCenterConfiguration { 192 | return notificationCenterConfiguration.animationType 193 | } else { 194 | fatalError("Cannot reach this branch") 195 | } 196 | } 197 | 198 | //MARK: - Window 199 | let notificationWindow = BaseWindow(frame: UIScreen.main.bounds) 200 | 201 | var baseWindow: UIWindow { 202 | if let notificationCenterConfiguration = notificationCenterConfiguration { 203 | return notificationCenterConfiguration.baseWindow 204 | } else { 205 | fatalError("Cannot reach this branch") 206 | } 207 | } 208 | 209 | //MARK: - Notification 210 | var notificationCenterConfiguration: NotificationCenterConfiguration! 211 | var notificationLabelConfiguration: NotificationLabelConfiguration! 212 | 213 | var dismissible: Bool { 214 | if let notificationCenterConfiguration = notificationCenterConfiguration { 215 | return notificationCenterConfiguration.dismissible 216 | } else { 217 | return false 218 | } 219 | } 220 | var animateInLength: TimeInterval { 221 | if let notificationCenterConfiguration = notificationCenterConfiguration { 222 | return notificationCenterConfiguration.animateInLength 223 | } else { 224 | fatalError("Cannot reach this branch") 225 | } 226 | } 227 | var animateOutLength: TimeInterval { 228 | if let notificationCenterConfiguration = notificationCenterConfiguration { 229 | return notificationCenterConfiguration.animateOutLength 230 | } else { 231 | fatalError("Cannot reach this branch") 232 | } 233 | } 234 | 235 | //MARK: - Notification Queue Management 236 | /// A notification array 237 | var notifications = [Notification]() 238 | /// Create a notification Queue to track the notifications 239 | let notificationQ = DispatchQueue(label: "notificationQueue", attributes: []) 240 | /// Create a semaphore to show the notification in a one-after one basis 241 | let notificationSemaphore = DispatchSemaphore(value: 1) 242 | 243 | 244 | //MARK: - User Interaction 245 | 246 | var userInteractionEnabled: Bool { 247 | return notificationCenterConfiguration.userInteractionEnabled 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StatusBarNotificationCenter 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/StatusBarNotificationCenter.svg?style=flat)](http://cocoapods.org/pods/StatusBarNotificationCenter) 4 | [![License](https://img.shields.io/cocoapods/l/StatusBarNotificationCenter.svg?style=flat)](http://cocoapods.org/pods/StatusBarNotificationCenter) 5 | [![Platform](https://img.shields.io/cocoapods/p/StatusBarNotificationCenter.svg?style=flat)](http://cocoapods.org/pods/StatusBarNotificationCenter) 6 | 7 | ![screenshot](screenshots/screenshoot.gif) 8 | 9 | You may also want to check this short [Youtube Video] (https://youtu.be/Qk2vhrBAyps?list=PLy5xoZi6fpzJ0z2xtlqL9Hz86IrpZuksG) to see what it can generally do 10 | 11 | You can also check this short [Youtube Video] (https://youtu.be/vtMWcWVtxZ8) to learn more about its implementation detail 12 | 13 | `StatusBarNotificationCenter` is a library that can be used in your application to show customized status bar notification. 14 | 15 | **NOTE:**During out software development, we want to find a library that can show notification from the status bar, This project learned many thought from the popular [`CWStatusBarNotification`](https://github.com/cezarywojcik/CWStatusBarNotification) library, but with much cleaner code implementation(in my own option) and fully written in **Swift 2.0**, and more extendable, and also it comes with more customisation options, and support multitasking and split view comes with iOS9+ . You can check it if you want to find a custom status bar notification library. 16 | 17 | ## Key Feature 18 | 1. Support split view of iPad Air and iPad Pro 19 | 2. Support concurrency, with version 1.1.0, you can just test it with the demo application 20 | 3. Highly customizable with a simple architecture, just a main class with a few class methods 21 | 4. Fully documented 22 | 23 | **Now, you can let the users interact with the app during the notification is showing by setting the userInteractionEnabled flag of thee StatusBarNotificationCenter configuration, and you can check the latest commit to say how easy it is to add this functionality** 24 | 25 | ## A few words 26 | This library is just a center class with a window and a view controller, and the center maintains an notification queue, I think our main aim is to build a stable and maintainable architecture, I want to add as many functionality as well, but I really like simple architecture, so there has to be some balance, and I am a programmer just for a few months, so there maybe some thing that maybe not appropriate, if you have some advice, please contant me with my email, you can easily add your custom view to this library, if you have something great to share, please open an issue or submit a pull request, thanks for your support. 27 | 28 | ## Example 29 | 30 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 31 | 32 | This example is best run with an iPad air or iPad Pro in portrait mode, and you can test the split view 33 | 34 | ##Requirements 35 | Because the demonstration code is written with UIStackView, so you need Xcode 7.0+ and iOS 9.0+ to run the demo, But I think this library can be used with devices with system version 7.0+, because the API is rather basic, and you can modify the source code with little effort to accompany with your minimum deployment target. 36 | 37 | Works on iPhone and iPad 38 | 39 | ## Installation 40 | 41 | StatusBarNotificationCenter is available through [CocoaPods](http://cocoapods.org). To install 42 | it, simply add the following line to your Podfile, because this is written in Swift 2.0, you may also need to insert `use_frameworks!` in your Podfile: 43 | 44 | ```ruby 45 | pod "StatusBarNotificationCenter" 46 | ``` 47 | ##Usage 48 | 49 | First, you need to import the `StatusBarNotificationCenter` framework 50 | 51 | Second, you must supply a `NotificationCenterConfiguration` object, the default implementation is below: 52 | 53 | ```swift 54 | /** 55 | * Customize the overall configuration information of the notification, most of the property's default value is OK for most circumstance, but you can customize it if you want 56 | */ 57 | public struct NotificationCenterConfiguration { 58 | /// The window below the notification window, you must set this property, or the notification will not work correctly 59 | var baseWindow: UIWindow 60 | /// The style of the notification, default to status bar notification 61 | public var style = StatusBarNotificationCenter.Style.StatusBar 62 | /// The animation type of the notification, default to overlay 63 | public var animationType = StatusBarNotificationCenter.AnimationType.Overlay 64 | /// The animate in direction of the notification, default to top 65 | public var animateInDirection = StatusBarNotificationCenter.AnimationDirection.Top 66 | /// The animate out direction of the notification, default to top 67 | public var animateOutDirection = StatusBarNotificationCenter.AnimationDirection.Top 68 | /// Whether the user can tap on the notification to dismiss the notification, default to true 69 | public var dismissible = true 70 | /// The animate in time of the notification 71 | public var animateInLength: NSTimeInterval = 0.25 72 | /// The animate out time of the notification 73 | public var animateOutLength: NSTimeInterval = 0.25 74 | /// The height of the notification view, if you want to use a custom height, set the style of the notification to custom, or it will use the status bar and navigation bar height 75 | public var height: CGFloat = 0 76 | /// If the status bar is hidden, if it is hidden, the hight of the navigation style notification height is the height of the navigation bar, default to false 77 | public var statusBarIsHidden: Bool = false 78 | /// The height of the navigation bar, default to 44.0 points 79 | public var navigationBarHeight: CGFloat = 44.0 80 | /// Should allow the user to interact with the content outside the notification 81 | public var userInteractionEnabled = true 82 | 83 | /** 84 | Initializer 85 | 86 | - parameter baseWindow: the base window of the notification 87 | 88 | - returns: a default NotificationCenterConfiguration instance 89 | */ 90 | public init(baseWindow: UIWindow) { 91 | self.baseWindow = baseWindow 92 | } 93 | } 94 | ``` 95 | 96 | **NOTE:** when you want to show a notification, you must supply the baseWindow of this notification, this property is mainly used to capture a snapshot of the your applications underlining view, the ordinary window will be your application's view's window: 97 | ```swift 98 | view.window! 99 | ``` 100 | 101 | If you want to show the notification with a custom view, you can just can the class method with the configuration object 102 | ```swift 103 | StatusBarNotificationCenter.showStatusBarNotificationWithView(view, forDuration: NSTimeInterval(durationSlider.value), withNotificationCenterConfiguration: notificationCenterConfiguration) 104 | ``` 105 | this method will display the notification, and last for a time of your specification, and if your configuration object's dismissible property is true, the user can dismiss the notification with a tap on the status bar, if you want to display the notification, and dismiss it manually, you can call the method below instead of this one 106 | ```swift 107 | func showStatusBarNotificationWithView(view: UIView, withNotificationCenterConfiguration notificationCenterConfiguration: NotificationCenterConfiguration, whenComplete completionHandler: Void -> Void) 108 | ``` 109 | and you can supply a completion hander which will be called when the display complete, but you must dismiss it yourself, and if your configuration object's dismissible property is true, the user can dismiss the notification with a tap on the status bar 110 | 111 | if you want to display the notification with the string value, you must also pass a `NotificationLabelConfiguration` object, the default implementation of this object is below: 112 | ```swift 113 | /** 114 | * If you use the default label to show the notification, you should send a customized configuration struct, the dufault implementation is a non-scrollabel label, with one line to show the information 115 | */ 116 | public struct NotificationLabelConfiguration { 117 | /// if the label should scroll the content, default to false 118 | public var scrollabel = true 119 | /// If you set the scrollable property to true, you can use this property to customize the scroll delay, default delay is 1 second 120 | public var scrollDelay: NSTimeInterval = 1.0 121 | /// If you set the scrollabel property to true, you can use this property to customize the scroll speed, default speed is 40 points per second 122 | public var scrollSpeed: CGFloat = 40.0 123 | /// Set the padding of the message label, default to 10.0 points 124 | public var padding: CGFloat = 10.0 125 | /// if the label should be multiline implementation, default to false 126 | public var multiline = false 127 | /// The background color of the notification view, default to black color 128 | public var backgroundColor = UIColor.blackColor() 129 | /// The text color of the notification view, default to white color 130 | public var textColor = UIColor.whiteColor() 131 | /// The font of the notification label, default to a system font of size 14.0, if you pass the attributed string, this property will be ignored 132 | public var font = UIFont.systemFontOfSize(StatusBarNotificationCenter.defaultMessageLabelFontSize) 133 | /// this property is not nil, the label will use the attributed string to show the message 134 | public var attributedText: NSAttributedString? = nil 135 | 136 | /** 137 | Init a new default notification label configuration 138 | 139 | - returns: a new default notification label configuration 140 | */ 141 | public init() { 142 | 143 | } 144 | } 145 | ``` 146 | The configuration is rather obvious, you can call the following method to invoke the notification 147 | ```swift 148 | StatusBarNotificationCenter.showStatusBarNotificationWithMessage(notificationTextField.text, forDuration: NSTimeInterval(durationSlider.value), withNotificationCenterConfiguration: notificationCenterConfiguration, andNotificationLabelConfiguration: notificationLabelConfiguration) 149 | ``` 150 | and there is also a similar method below, the usage is similar to the notification with a custom view 151 | ```swift 152 | func showStatusBarNotificationWithMessage(message: String?, withNotificationCenterConfiguration notificationCenterConfiguration: NotificationCenterConfiguration, andNotificationLabelConfiguration notificationLabelConfiguration: NotificationLabelConfiguration, whenComplete completionHandler: Void -> Void) 153 | ``` 154 | ### Additional Remarks 155 | This library is not yet fully tested, if you find some bugs, please submit an issue; especially, this library is not multi thread tested, though I think with some modification, it will work correctly, if you find, please don't hesitate to tell me, or submit a pull request. 156 | 157 | And really a big thanks to the work of [`CWStatusBarNotification`](https://github.com/cezarywojcik/CWStatusBarNotification) , I think you can compare the two library if you decide to use a status bar notification, originally, I want to modify that repo, but I think write a library from the beginning is a better idea. 158 | 159 | ## Author 160 | 161 | Shannon Wu 162 | you can contact me by [Email](inatu@icloud.com), or [twitter](https://twitter.com/inatu_) or [Weibo](http://weibo.com/igenuis/profile?rightmod=1&wvr=6&mod=personinfo) 163 | 164 | ## License 165 | 166 | StatusBarNotificationCenter is available under the MIT license. See the LICENSE file for more info. 167 | -------------------------------------------------------------------------------- /StatusBarNotificationCenter.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "StatusBarNotificationCenter" 3 | s.version = "1.1.4" 4 | s.summary = "a library that can be used in your application to show customised status bar notification." 5 | 6 | s.description = <<-DESC 7 | During out software development, we want to find a library that can show notification from the status bar, This project learned many thought from the popular CWStatusBarNotificationlibrary, but with much cleaner code implementation(in my own option) and fully written in Swift 2.0, and more extendable, and also it comes with more customisation options, and support multitasking and split view comes with iOS9+ . You can check it if you want to find a custom status bar notification library. 8 | Key Feature: 9 | 1. Support split view in iPad Air and iPad Pro 10 | 2. Support Concurrency 11 | 3. Highly customizable 12 | 4. Simple architecture 13 | **Now, you can let the users interact with the app during the notification is showing by setting the userInteractionEnabled flag of thee StatusBarNotificationCenter configuration, and you can check the latest commit to say how easy it is to add this functionality** 14 | ![screenshot](screenshots/screenshoot.gif) 15 | DESC 16 | s.homepage = "https://github.com/36Kr-Mobile/StatusBarNotificationCenter.git" 17 | s.license = 'MIT' 18 | s.author = { "Shannon Wu" => "inatu@icloud.com" } 19 | s.source = { :git => "https://github.com/36Kr-Mobile/StatusBarNotificationCenter.git", :tag => s.version.to_s } 20 | s.platform = :ios, '8.0' 21 | s.requires_arc = true 22 | s.source_files = 'Pod/**/*' 23 | s.frameworks = 'UIKit' 24 | end 25 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /screenshots/screenshoot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/36Kr-Mobile/StatusBarNotificationCenter/ffd6aa04abeb868d0a34bb803316f9e7920ddb8d/screenshots/screenshoot.gif --------------------------------------------------------------------------------