From 04ec9f6db09e01cdff7d403aabdff4ea3bc03311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jercin=CC=81ski?= Date: Tue, 7 May 2013 14:11:43 +0200 Subject: [PATCH 1/4] Added support for button on TSMessageView --- Classes/TSMessage.h | 21 + Classes/TSMessage.m | 24 + .../Example/TSSecondViewController.h | 1 + .../Example/TSSecondViewController.m | 14 +- .../en.lproj/MainStoryboard.storyboard | 18 +- ExampleProject/Podfile.lock | 6 +- .../Pods/Local Podspecs/TSMessages.podspec | 4 +- ExampleProject/Pods/Manifest.lock | 6 +- ExampleProject/Pods/Pods-dummy.m | 1 + ExampleProject/Pods/Pods-environment.h | 20 + ExampleProject/Pods/Pods-prefix.pch | 2 +- ExampleProject/Pods/Pods-resources.sh | 4 +- ExampleProject/Pods/Pods.xcconfig | 1 + .../Pods/Pods.xcodeproj/project.pbxproj | 1383 +++++------------ Resources/Images/Button.png | Bin 0 -> 844 bytes Resources/Images/Button@2x.png | Bin 0 -> 2169 bytes Views/TSMessageView.h | 4 + Views/TSMessageView.m | 50 +- 18 files changed, 529 insertions(+), 1030 deletions(-) create mode 100644 ExampleProject/Pods/Pods-environment.h create mode 100644 Resources/Images/Button.png create mode 100644 Resources/Images/Button@2x.png diff --git a/Classes/TSMessage.h b/Classes/TSMessage.h index 6b0a7acc..0975f779 100755 --- a/Classes/TSMessage.h +++ b/Classes/TSMessage.h @@ -96,6 +96,27 @@ typedef enum { withCallback:(void (^)())callback atPosition:(TSMessageNotificationPosition)messagePosition; +/** Shows a notification message in a specific view controller + @param viewController The view controller to show the notification in. + @param title The title of the notification view + @param message The message that is displayed underneath the title + @param type The notification type (Message, Warning, Error, Success) + @param duration The duration of the notification being displayed + @param callback The block that should be executed, when the user tapped on the message + @param buttonTitle The title for button (optional) + @param buttonCallback The block that should be executed, when the user tapped on the button + @param position The position of the message on the screen + */ ++ (void)showNotificationInViewController:(UIViewController *)viewController + withTitle:(NSString *)title + withMessage:(NSString *)message + withType:(TSMessageNotificationType)type + withDuration:(NSTimeInterval)duration + withCallback:(void (^)())callback + withButtonTitle:(NSString *)buttonTitle + withButtonCallback:(void (^)())buttonCallback + atPosition:(TSMessageNotificationPosition)messagePosition; + /** Shows a predefined error message, that is displayed, when this action requires an internet connection */ + (void)showInternetError; diff --git a/Classes/TSMessage.m b/Classes/TSMessage.m index 9ead06b5..d2c48afe 100755 --- a/Classes/TSMessage.m +++ b/Classes/TSMessage.m @@ -105,6 +105,28 @@ + (void)showNotificationInViewController:(UIViewController *)viewController withDuration:(NSTimeInterval)duration withCallback:(void (^)())callback atPosition:(TSMessageNotificationPosition)messagePosition +{ + [self showNotificationInViewController:viewController + withTitle:title + withMessage:message + withType:type + withDuration:duration + withCallback:callback + withButtonTitle:nil + withButtonCallback:nil + atPosition:messagePosition]; +} + + ++ (void)showNotificationInViewController:(UIViewController *)viewController + withTitle:(NSString *)title + withMessage:(NSString *)message + withType:(TSMessageNotificationType)type + withDuration:(NSTimeInterval)duration + withCallback:(void (^)())callback + withButtonTitle:(NSString *)buttonTitle + withButtonCallback:(void (^)())buttonCallback + atPosition:(TSMessageNotificationPosition)messagePosition { for (TSMessageView *n in [TSMessage sharedMessage].messages) { @@ -121,6 +143,8 @@ + (void)showNotificationInViewController:(UIViewController *)viewController withDuration:duration inViewController:viewController withCallback:callback + withButtonTitle:buttonTitle + withButtonCallback:buttonCallback atPosition:messagePosition]; [[TSMessage sharedMessage].messages addObject:v]; diff --git a/ExampleProject/Example/TSSecondViewController.h b/ExampleProject/Example/TSSecondViewController.h index 29af459e..940d4bd6 100644 --- a/ExampleProject/Example/TSSecondViewController.h +++ b/ExampleProject/Example/TSSecondViewController.h @@ -12,6 +12,7 @@ @property (weak, nonatomic) IBOutlet UISwitch *descriptionToggle; @property (weak, nonatomic) IBOutlet UISwitch *longDurationToggle; +@property (weak, nonatomic) IBOutlet UISwitch *buttonToggle; - (IBAction)didTapError:(id)sender; diff --git a/ExampleProject/Example/TSSecondViewController.m b/ExampleProject/Example/TSSecondViewController.m index 4ec28de8..ee413b4f 100644 --- a/ExampleProject/Example/TSSecondViewController.m +++ b/ExampleProject/Example/TSSecondViewController.m @@ -20,6 +20,7 @@ - (IBAction)didTapError:(id)sender NSString *notificationDescription = (self.descriptionToggle.on ? NSLocalizedString(@"The internet connection seems to be down. Please check that!", nil) : nil); + CGFloat duration = (self.longDurationToggle.on ? TSSecondViewControllerLongDuration : 0.0); [TSMessage showNotificationInViewController:self @@ -58,13 +59,24 @@ - (IBAction)didTapMessage:(id)sender NSLocalizedString(@"This is some neutral notification.", nil) : nil); + NSString *buttonTitle = self.buttonToggle.on ? @"UPDATE" : nil; + CGFloat duration = (self.longDurationToggle.on ? TSSecondViewControllerLongDuration : 0.0); [TSMessage showNotificationInViewController:self withTitle:notificationTitle withMessage:notificationDescription withType:TSMessageNotificationTypeMessage - withDuration:duration]; + withDuration:duration + withCallback:nil + withButtonTitle:buttonTitle + withButtonCallback:^{ + [TSMessage showNotificationInViewController:self + withTitle:NSLocalizedString(@"Button tapped!", nil) + withMessage:nil + withType:TSMessageNotificationTypeSuccess]; + } + atPosition:TSMessageNotificationPositionTop]; } - (IBAction)didTapSuccess:(id)sender diff --git a/ExampleProject/Example/en.lproj/MainStoryboard.storyboard b/ExampleProject/Example/en.lproj/MainStoryboard.storyboard index 72b320f9..d8b86190 100644 --- a/ExampleProject/Example/en.lproj/MainStoryboard.storyboard +++ b/ExampleProject/Example/en.lproj/MainStoryboard.storyboard @@ -82,33 +82,45 @@ + + - + + - + + + + + + @@ -150,7 +162,9 @@ + + diff --git a/ExampleProject/Podfile.lock b/ExampleProject/Podfile.lock index 83956da7..fbc77ee4 100644 --- a/ExampleProject/Podfile.lock +++ b/ExampleProject/Podfile.lock @@ -1,6 +1,6 @@ PODS: - MLUIColorAdditions (1.0.0) - - TSMessages (0.9): + - TSMessages (0.9.1): - MLUIColorAdditions DEPENDENCIES: @@ -12,6 +12,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: MLUIColorAdditions: c128da8c87b724cdc6c9a1b4cfe8832ca62b8d2a - TSMessages: b210370220233cac2a903d134e15ffd66e052b25 + TSMessages: 916e168ec96b90fbe2756bc4e28c555a2abc83fc -COCOAPODS: 0.18.1 +COCOAPODS: 0.19.1 diff --git a/ExampleProject/Pods/Local Podspecs/TSMessages.podspec b/ExampleProject/Pods/Local Podspecs/TSMessages.podspec index 4dd1722f..9dec62bc 100644 --- a/ExampleProject/Pods/Local Podspecs/TSMessages.podspec +++ b/ExampleProject/Pods/Local Podspecs/TSMessages.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TSMessages" - s.version = "0.9" + s.version = "0.9.1" s.summary = "Easy to use and customizable messages/notifications for iOS à la Tweetbot." s.description = <<-DESC This framework provides an easy to use class to show little notification views on the top of the screen. (à la Tweetbot). @@ -14,7 +14,7 @@ There are 4 different types already set up for you: Success, Error, Warning, Mes s.author = { "Felix Krause" => "felix@toursprung.com" } - s.source = { :git => "https://github.com/toursprung/TSMessages.git", :tag => "0.9"} + s.source = { :git => "https://github.com/toursprung/TSMessages.git", :tag => "0.9.1"} s.platform = :ios, '5.0' diff --git a/ExampleProject/Pods/Manifest.lock b/ExampleProject/Pods/Manifest.lock index 83956da7..fbc77ee4 100644 --- a/ExampleProject/Pods/Manifest.lock +++ b/ExampleProject/Pods/Manifest.lock @@ -1,6 +1,6 @@ PODS: - MLUIColorAdditions (1.0.0) - - TSMessages (0.9): + - TSMessages (0.9.1): - MLUIColorAdditions DEPENDENCIES: @@ -12,6 +12,6 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: MLUIColorAdditions: c128da8c87b724cdc6c9a1b4cfe8832ca62b8d2a - TSMessages: b210370220233cac2a903d134e15ffd66e052b25 + TSMessages: 916e168ec96b90fbe2756bc4e28c555a2abc83fc -COCOAPODS: 0.18.1 +COCOAPODS: 0.19.1 diff --git a/ExampleProject/Pods/Pods-dummy.m b/ExampleProject/Pods/Pods-dummy.m index 99f32356..ade64bd1 100644 --- a/ExampleProject/Pods/Pods-dummy.m +++ b/ExampleProject/Pods/Pods-dummy.m @@ -1,3 +1,4 @@ +#import @interface PodsDummy_Pods : NSObject @end @implementation PodsDummy_Pods diff --git a/ExampleProject/Pods/Pods-environment.h b/ExampleProject/Pods/Pods-environment.h new file mode 100644 index 00000000..57f3acd0 --- /dev/null +++ b/ExampleProject/Pods/Pods-environment.h @@ -0,0 +1,20 @@ + +// To check if a library is compiled with CocoaPods you +// can use the `COCOAPODS` macro definition which is +// defined in the xcconfigs so it is available in +// headers also when they are imported in the client +// project. + + +// MLUIColorAdditions +#define COCOAPODS_POD_AVAILABLE_MLUIColorAdditions +#define COCOAPODS_VERSION_MAJOR_MLUIColorAdditions 1 +#define COCOAPODS_VERSION_MINOR_MLUIColorAdditions 0 +#define COCOAPODS_VERSION_PATCH_MLUIColorAdditions 0 + +// TSMessages +#define COCOAPODS_POD_AVAILABLE_TSMessages +#define COCOAPODS_VERSION_MAJOR_TSMessages 0 +#define COCOAPODS_VERSION_MINOR_TSMessages 9 +#define COCOAPODS_VERSION_PATCH_TSMessages 1 + diff --git a/ExampleProject/Pods/Pods-prefix.pch b/ExampleProject/Pods/Pods-prefix.pch index 20dded4d..951b0313 100644 --- a/ExampleProject/Pods/Pods-prefix.pch +++ b/ExampleProject/Pods/Pods-prefix.pch @@ -2,5 +2,5 @@ #import #endif -#import "Pods-header.h" +#import "Pods-environment.h" diff --git a/ExampleProject/Pods/Pods-resources.sh b/ExampleProject/Pods/Pods-resources.sh index 7415f417..6fb167ae 100755 --- a/ExampleProject/Pods/Pods-resources.sh +++ b/ExampleProject/Pods/Pods-resources.sh @@ -20,8 +20,8 @@ install_resource() xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd" ;; *) - echo "cp -R ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - cp -R "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + echo "rsync -av --exclude '*/.svn/*' ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -av --exclude '*/.svn/*' "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" ;; esac } diff --git a/ExampleProject/Pods/Pods.xcconfig b/ExampleProject/Pods/Pods.xcconfig index 39689d10..8473731a 100644 --- a/ExampleProject/Pods/Pods.xcconfig +++ b/ExampleProject/Pods/Pods.xcconfig @@ -1,4 +1,5 @@ ALWAYS_SEARCH_USER_PATHS = YES +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = ${PODS_HEADERS_SEARCH_PATHS} OTHER_LDFLAGS = -ObjC PODS_BUILD_HEADERS_SEARCH_PATHS = "${PODS_ROOT}/BuildHeaders" "${PODS_ROOT}/BuildHeaders/MLUIColorAdditions" "${PODS_ROOT}/BuildHeaders/TSMessages" diff --git a/ExampleProject/Pods/Pods.xcodeproj/project.pbxproj b/ExampleProject/Pods/Pods.xcodeproj/project.pbxproj index 7db11d2c..7841328f 100644 --- a/ExampleProject/Pods/Pods.xcodeproj/project.pbxproj +++ b/ExampleProject/Pods/Pods.xcodeproj/project.pbxproj @@ -1,1013 +1,370 @@ - - - - - archiveVersion - 1 - classes - - objectVersion - 46 - objects - - 031D96A373CC41E69DC2BC51 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - UIColor+MLColorAdditions.h - path - ../../Classes/UIColorAdditions/UIColor+MLColorAdditions.h - sourceTree - SOURCE_ROOT - - 0643A86572464478B8A84D76 - - includeInIndex - 1 - isa - PBXFileReference - name - design.json - path - ../../Resources/design.json - sourceTree - SOURCE_ROOT - - 0D0A408EB50145BE801E0FF6 - - children - - DE196C6652AE48E4BC87815E - - isa - PBXGroup - name - Resources - sourceTree - <group> - - 0F522104E7A041AFA2C5286B - - buildConfigurations - - 7DE575CAB4F2447390C23F9A - DF97EEAB20494FC7929EDBE8 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - 16BFF750CBE7426DB00C35D6 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundWarning@2x.png - path - ../../Resources/Images/NotificationBackgroundWarning@2x.png - sourceTree - SOURCE_ROOT - - 1A68ECAA47194B768D1D0D08 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - name - libPods.a - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - 1B7BE5CA205543ADAB4E601A - - buildActionMask - 2147483647 - files - - C49E732F3BFF4D68904D1687 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 1FA6D2DDC42A4BC6ADA9D3A2 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - UIColor+MLColorAdditions.m - path - MLUIColorAdditions/UIColor+MLColorAdditions.m - sourceTree - SOURCE_ROOT - - 26254B22A6724E66A41B19B2 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundMessage.png - path - ../../Resources/Images/NotificationBackgroundMessage.png - sourceTree - SOURCE_ROOT - - 2796AB61D6264895BDAF60E4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - UIColor+MLColorAdditions.h - path - MLUIColorAdditions/UIColor+MLColorAdditions.h - sourceTree - SOURCE_ROOT - - 2B47BCA0A28E4C52BF94FF0C - - buildConfigurationList - 0F522104E7A041AFA2C5286B - buildPhases - - F9BF25CE3B5C472AB93110FB - 1B7BE5CA205543ADAB4E601A - A7AF14EA1A2349328371DA4F - - buildRules - - dependencies - - isa - PBXNativeTarget - name - Pods - productName - Pods - productReference - 1A68ECAA47194B768D1D0D08 - productType - com.apple.product-type.library.static - - 2C133FDAB3A74CF7AB709E90 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - TSMessageView.h - path - ../../Views/TSMessageView.h - sourceTree - SOURCE_ROOT - - 313EC0F4B228428C99A3DF73 - - fileRef - A59EE1BB04824320B484CC63 - isa - PBXBuildFile - settings - - - 33303EB0DE7B47DE8DE39A26 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundWarning.png - path - ../../Resources/Images/NotificationBackgroundWarning.png - sourceTree - SOURCE_ROOT - - 38204C8F0D0642DE98C95F98 - - children - - 1A68ECAA47194B768D1D0D08 - - isa - PBXGroup - name - Products - sourceTree - <group> - - 3B27D1EBFB0940E8875D1887 - - attributes - - LastUpgradeCheck - 0450 - - buildConfigurationList - F8C1D264CCAE413385E43B77 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - 6C67F1DD87484884BA69A982 - productRefGroup - 38204C8F0D0642DE98C95F98 - projectReferences - - targets - - 2B47BCA0A28E4C52BF94FF0C - - - 43A6100A997E4C52BE57E265 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - TSMessageView.m - path - ../../Views/TSMessageView.m - sourceTree - SOURCE_ROOT - - 4B34F2B8155644A2894C9C0A - - fileRef - 43A6100A997E4C52BE57E265 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - 4BAC09D56CCD49C6B1AFDBBC - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - UIColor+MLColorAdditions.m - path - ../../Classes/UIColorAdditions/UIColor+MLColorAdditions.m - sourceTree - SOURCE_ROOT - - 5D9E9130B0DD402EB8950D60 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundError.png - path - ../../Resources/Images/NotificationBackgroundError.png - sourceTree - SOURCE_ROOT - - 66C0936E6D634A54AB7426F4 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods.xcconfig - path - Pods.xcconfig - sourceTree - SOURCE_ROOT - - 6C67F1DD87484884BA69A982 - - children - - D3669DE5E587424FB59C5703 - 8E6F987DE13A43CE8B6769F9 - E2968B7714F546AEB80016F6 - 38204C8F0D0642DE98C95F98 - 0D0A408EB50145BE801E0FF6 - 6FF6B8E002D14DC9A9F8B003 - 80EEDF141D21418EB8CB5E7F - - isa - PBXGroup - sourceTree - <group> - - 6FF6B8E002D14DC9A9F8B003 - - children - - 9668C65956574380BA9260E2 - - isa - PBXGroup - name - Targets Support Files - sourceTree - <group> - - 728214BC3D6E4AA898170E37 - - fileRef - EB464816925F473F958BCF76 - isa - PBXBuildFile - settings - - - 7BEBF56D8A624B34BA1A2713 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundSuccessIcon@2x.png - path - ../../Resources/Images/NotificationBackgroundSuccessIcon@2x.png - sourceTree - SOURCE_ROOT - - 7DE575CAB4F2447390C23F9A - - baseConfigurationReference - 66C0936E6D634A54AB7426F4 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - ARCHS - $(ARCHS_STANDARD_32_BIT) - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Pods-prefix.pch - GCC_VERSION - com.apple.compilers.llvm.clang.1_0 - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 5.1 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - PODS_HEADERS_SEARCH_PATHS - ${PODS_BUILD_HEADERS_SEARCH_PATHS} - PODS_ROOT - ${SRCROOT} - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - 80EEDF141D21418EB8CB5E7F - - includeInIndex - 1 - isa - PBXFileReference - name - Podfile - path - ../Podfile - sourceTree - SOURCE_ROOT - xcLanguageSpecificationIdentifier - xcode.lang.ruby - - 82AC4C95376F4D1AB7E028C8 - - fileRef - 4BAC09D56CCD49C6B1AFDBBC - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - 82FFFECD07454965883BF9A6 - - fileRef - 2C133FDAB3A74CF7AB709E90 - isa - PBXBuildFile - settings - - - 8403A3A8FA114C9D8E532D95 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - Foundation.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/Foundation.framework - sourceTree - DEVELOPER_DIR - - 8449595BD5AD4FB0980BFE02 - - includeInIndex - 1 - isa - PBXFileReference - name - Pods-prefix.pch - path - Pods-prefix.pch - sourceTree - SOURCE_ROOT - - 8E6F987DE13A43CE8B6769F9 - - children - - 9CEAD9124B154AACBF169B21 - - isa - PBXGroup - name - Local Pods - sourceTree - <group> - - 91F7B2EEB2D24845A5678DDC - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundWarningIcon.png - path - ../../Resources/Images/NotificationBackgroundWarningIcon.png - sourceTree - SOURCE_ROOT - - 92D2ABBF63784C258C5C2D31 - - children - - 2796AB61D6264895BDAF60E4 - 1FA6D2DDC42A4BC6ADA9D3A2 - - isa - PBXGroup - name - MLUIColorAdditions - sourceTree - <group> - - 9425DDA6F1AD4991A768E2F8 - - includeInIndex - 1 - isa - PBXFileReference - name - Pods-acknowledgements.markdown - path - Pods-acknowledgements.markdown - sourceTree - SOURCE_ROOT - - 9668C65956574380BA9260E2 - - children - - 66C0936E6D634A54AB7426F4 - FFA737C45575492A84D3F4B1 - 8449595BD5AD4FB0980BFE02 - CBE7AAB82EB94866BD5D7D30 - BEA7F279CD7D49518F61394C - 9425DDA6F1AD4991A768E2F8 - EB464816925F473F958BCF76 - - isa - PBXGroup - name - Pods - sourceTree - <group> - - 9CEAD9124B154AACBF169B21 - - children - - A59EE1BB04824320B484CC63 - E7B6AA7E40334910A0323956 - 031D96A373CC41E69DC2BC51 - 4BAC09D56CCD49C6B1AFDBBC - 2C133FDAB3A74CF7AB709E90 - 43A6100A997E4C52BE57E265 - - isa - PBXGroup - name - TSMessages - sourceTree - <group> - - A281FECD4E8F4A86B3F4DD56 - - fileRef - 2796AB61D6264895BDAF60E4 - isa - PBXBuildFile - settings - - - A2BF7B570CA64773A9E864FB - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundSuccessIcon.png - path - ../../Resources/Images/NotificationBackgroundSuccessIcon.png - sourceTree - SOURCE_ROOT - - A59EE1BB04824320B484CC63 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - TSMessage.h - path - ../../Classes/TSMessage.h - sourceTree - SOURCE_ROOT - - A7AF14EA1A2349328371DA4F - - buildActionMask - 2147483647 - files - - A281FECD4E8F4A86B3F4DD56 - 313EC0F4B228428C99A3DF73 - E2D3CDF0EBE94213A7FE90DB - 82FFFECD07454965883BF9A6 - - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - AB042BB03EA7430896F882CD - - fileRef - E7B6AA7E40334910A0323956 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - B108A08610A1448AA0B4EB90 - - fileRef - 1FA6D2DDC42A4BC6ADA9D3A2 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - B24CBBC741954B66B4E835DD - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundWarningIcon@2x.png - path - ../../Resources/Images/NotificationBackgroundWarningIcon@2x.png - sourceTree - SOURCE_ROOT - - BEA7F279CD7D49518F61394C - - includeInIndex - 1 - isa - PBXFileReference - name - Pods-acknowledgements.plist - path - Pods-acknowledgements.plist - sourceTree - SOURCE_ROOT - - C24396BF04AE412BBFBDB58E - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundErrorIcon.png - path - ../../Resources/Images/NotificationBackgroundErrorIcon.png - sourceTree - SOURCE_ROOT - - C49E732F3BFF4D68904D1687 - - fileRef - 8403A3A8FA114C9D8E532D95 - isa - PBXBuildFile - settings - - - CBE7AAB82EB94866BD5D7D30 - - includeInIndex - 1 - isa - PBXFileReference - name - Pods-resources.sh - path - Pods-resources.sh - sourceTree - SOURCE_ROOT - - CBEDDBFC7477490F8F7DBE70 - - buildSettings - - isa - XCBuildConfiguration - name - Debug - - CD104EF939064AE6BE4EE446 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundSuccess@2x.png - path - ../../Resources/Images/NotificationBackgroundSuccess@2x.png - sourceTree - SOURCE_ROOT - - D3669DE5E587424FB59C5703 - - children - - 8403A3A8FA114C9D8E532D95 - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - D4232DAE21E148918784D052 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundError@2x.png - path - ../../Resources/Images/NotificationBackgroundError@2x.png - sourceTree - SOURCE_ROOT - - D4AD11E9541B4493A300A5B1 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundSuccess.png - path - ../../Resources/Images/NotificationBackgroundSuccess.png - sourceTree - SOURCE_ROOT - - DE196C6652AE48E4BC87815E - - children - - 0643A86572464478B8A84D76 - 5D9E9130B0DD402EB8950D60 - D4232DAE21E148918784D052 - C24396BF04AE412BBFBDB58E - EB5C156986F248968D10300B - 26254B22A6724E66A41B19B2 - E79F898325FF430FABD2CD69 - D4AD11E9541B4493A300A5B1 - CD104EF939064AE6BE4EE446 - A2BF7B570CA64773A9E864FB - 7BEBF56D8A624B34BA1A2713 - 33303EB0DE7B47DE8DE39A26 - 16BFF750CBE7426DB00C35D6 - 91F7B2EEB2D24845A5678DDC - B24CBBC741954B66B4E835DD - - isa - PBXGroup - name - TSMessages - sourceTree - <group> - - DF97EEAB20494FC7929EDBE8 - - baseConfigurationReference - 66C0936E6D634A54AB7426F4 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - ARCHS - $(ARCHS_STANDARD_32_BIT) - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Pods-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_VERSION - com.apple.compilers.llvm.clang.1_0 - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 5.1 - OTHER_LDFLAGS - - PODS_HEADERS_SEARCH_PATHS - ${PODS_BUILD_HEADERS_SEARCH_PATHS} - PODS_ROOT - ${SRCROOT} - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - E2968B7714F546AEB80016F6 - - children - - 92D2ABBF63784C258C5C2D31 - - isa - PBXGroup - name - Pods - sourceTree - <group> - - E2D3CDF0EBE94213A7FE90DB - - fileRef - 031D96A373CC41E69DC2BC51 - isa - PBXBuildFile - settings - - - E79F898325FF430FABD2CD69 - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundMessage@2x.png - path - ../../Resources/Images/NotificationBackgroundMessage@2x.png - sourceTree - SOURCE_ROOT - - E7B6AA7E40334910A0323956 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - TSMessage.m - path - ../../Classes/TSMessage.m - sourceTree - SOURCE_ROOT - - EB464816925F473F958BCF76 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - Pods-dummy.m - path - Pods-dummy.m - sourceTree - SOURCE_ROOT - - EB5C156986F248968D10300B - - includeInIndex - 1 - isa - PBXFileReference - name - NotificationBackgroundErrorIcon@2x.png - path - ../../Resources/Images/NotificationBackgroundErrorIcon@2x.png - sourceTree - SOURCE_ROOT - - EF44786750964F6D99776208 - - buildSettings - - isa - XCBuildConfiguration - name - Release - - F8C1D264CCAE413385E43B77 - - buildConfigurations - - EF44786750964F6D99776208 - CBEDDBFC7477490F8F7DBE70 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - F9BF25CE3B5C472AB93110FB - - buildActionMask - 2147483647 - files - - B108A08610A1448AA0B4EB90 - AB042BB03EA7430896F882CD - 82AC4C95376F4D1AB7E028C8 - 4B34F2B8155644A2894C9C0A - 728214BC3D6E4AA898170E37 - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - FFA737C45575492A84D3F4B1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - Pods-header.h - path - Pods-header.h - sourceTree - SOURCE_ROOT - - - rootObject - 3B27D1EBFB0940E8875D1887 - - +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 14AAB9070B324770B9F0A517 /* UIColor+MLColorAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = F8652C748BAB4F389A5A4656 /* UIColor+MLColorAdditions.h */; }; + 41074BA6BC4F4512B75653A1 /* TSMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 6CD408D1327F4876B5A4DA62 /* TSMessage.m */; settings = {COMPILER_FLAGS = "-fobjc-arc -DOS_OBJECT_USE_OBJC=0"; }; }; + 4C837AF42CA045F99851FB94 /* TSMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 571262F3F2CB44AF92926F9A /* TSMessage.h */; }; + 571DD6A69F154A518B20E753 /* UIColor+MLColorAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = DB81EFA6D3FF4D95BD3850EB /* UIColor+MLColorAdditions.m */; settings = {COMPILER_FLAGS = "-fobjc-arc -DOS_OBJECT_USE_OBJC=0"; }; }; + 5EB8662B8D404ED3BBCF7E5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B4A6D38E662472F831C92AD /* Foundation.framework */; }; + 667705A06CDA47DBB097BCDD /* UIColor+MLColorAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = BB3A1E80D2F649009922C00A /* UIColor+MLColorAdditions.h */; }; + 6EBEF223767845728B7648AF /* UIColor+MLColorAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 035A3611F84848AF9B728803 /* UIColor+MLColorAdditions.m */; settings = {COMPILER_FLAGS = "-fobjc-arc -DOS_OBJECT_USE_OBJC=0"; }; }; + 7CAC7D3908E647889B7867B5 /* TSMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FF1854E4034442A9A8AA9BD /* TSMessageView.m */; settings = {COMPILER_FLAGS = "-fobjc-arc -DOS_OBJECT_USE_OBJC=0"; }; }; + 836CD614B9054AB5A159D8D6 /* TSMessageView.h in Headers */ = {isa = PBXBuildFile; fileRef = B6993672CCF6460487599F7E /* TSMessageView.h */; }; + C5F171B07115465199CF7DBA /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 02330E488B0F46BCBC4ACEF6 /* Pods-dummy.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 02330E488B0F46BCBC4ACEF6 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = SOURCE_ROOT; }; + 035A3611F84848AF9B728803 /* UIColor+MLColorAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIColor+MLColorAdditions.m"; path = "MLUIColorAdditions/UIColor+MLColorAdditions.m"; sourceTree = SOURCE_ROOT; }; + 0B4A6D38E662472F831C92AD /* Foundation.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 178D15C3713D437D9CE88D57 /* Pods-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-prefix.pch"; sourceTree = SOURCE_ROOT; }; + 2285073171904AF5AD8EDF35 /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 23637052F9524DA7B71CA2FD /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 279ACA25A2E040048598E6FF /* NotificationBackgroundWarning@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundWarning@2x.png"; path = "../../Resources/Images/NotificationBackgroundWarning@2x.png"; sourceTree = SOURCE_ROOT; }; + 2DCE67D8CB6E42458F244343 /* NotificationBackgroundSuccess@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundSuccess@2x.png"; path = "../../Resources/Images/NotificationBackgroundSuccess@2x.png"; sourceTree = SOURCE_ROOT; }; + 2EE8049D71E34802B253DA69 /* NotificationBackgroundMessage.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundMessage.png; path = ../../Resources/Images/NotificationBackgroundMessage.png; sourceTree = SOURCE_ROOT; }; + 310219EF75B14D03B6BAA671 /* Pods-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-environment.h"; sourceTree = SOURCE_ROOT; }; + 483D3DF0491F4D5783151774 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = SOURCE_ROOT; }; + 4ECC3779BA1F4D0D8CB6945F /* NotificationBackgroundWarningIcon@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundWarningIcon@2x.png"; path = "../../Resources/Images/NotificationBackgroundWarningIcon@2x.png"; sourceTree = SOURCE_ROOT; }; + 508E018B56F54ED6947D0815 /* NotificationBackgroundError.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundError.png; path = ../../Resources/Images/NotificationBackgroundError.png; sourceTree = SOURCE_ROOT; }; + 571262F3F2CB44AF92926F9A /* TSMessage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TSMessage.h; path = ../../Classes/TSMessage.h; sourceTree = SOURCE_ROOT; }; + 58C3126A1739264200055226 /* Button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Button.png; path = ../../Resources/Images/Button.png; sourceTree = ""; }; + 58C3126B1739264200055226 /* Button@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Button@2x.png"; path = "../../Resources/Images/Button@2x.png"; sourceTree = ""; }; + 64DF44AA64804B02819961D9 /* NotificationBackgroundErrorIcon@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundErrorIcon@2x.png"; path = "../../Resources/Images/NotificationBackgroundErrorIcon@2x.png"; sourceTree = SOURCE_ROOT; }; + 687DBA954A3A48D3BFC24645 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.xcconfig; sourceTree = SOURCE_ROOT; }; + 6CD408D1327F4876B5A4DA62 /* TSMessage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TSMessage.m; path = ../../Classes/TSMessage.m; sourceTree = SOURCE_ROOT; }; + 8B3E9BEF8532438BA89BF819 /* NotificationBackgroundSuccess.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundSuccess.png; path = ../../Resources/Images/NotificationBackgroundSuccess.png; sourceTree = SOURCE_ROOT; }; + 8FF1854E4034442A9A8AA9BD /* TSMessageView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TSMessageView.m; path = ../../Views/TSMessageView.m; sourceTree = SOURCE_ROOT; }; + 92A5BD00EC5F4B6F89BE2414 /* NotificationBackgroundSuccessIcon@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundSuccessIcon@2x.png"; path = "../../Resources/Images/NotificationBackgroundSuccessIcon@2x.png"; sourceTree = SOURCE_ROOT; }; + 99179B9F859346D791A394F7 /* NotificationBackgroundMessage@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundMessage@2x.png"; path = "../../Resources/Images/NotificationBackgroundMessage@2x.png"; sourceTree = SOURCE_ROOT; }; + 9F20C56CF7B44CD08CAA0320 /* NotificationBackgroundWarningIcon.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundWarningIcon.png; path = ../../Resources/Images/NotificationBackgroundWarningIcon.png; sourceTree = SOURCE_ROOT; }; + 9FD35E89ABF84C749B69BEF1 /* NotificationBackgroundSuccessIcon.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundSuccessIcon.png; path = ../../Resources/Images/NotificationBackgroundSuccessIcon.png; sourceTree = SOURCE_ROOT; }; + AC578324C9C140A98D4F123E /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = SOURCE_ROOT; }; + B6993672CCF6460487599F7E /* TSMessageView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TSMessageView.h; path = ../../Views/TSMessageView.h; sourceTree = SOURCE_ROOT; }; + BB3A1E80D2F649009922C00A /* UIColor+MLColorAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIColor+MLColorAdditions.h"; path = "../../Classes/UIColorAdditions/UIColor+MLColorAdditions.h"; sourceTree = SOURCE_ROOT; }; + C6F98B40E5A647D2901E0F42 /* design.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = design.json; path = ../../Resources/design.json; sourceTree = SOURCE_ROOT; }; + CABA16CB4DAA481B90EE4816 /* NotificationBackgroundError@2x.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = "NotificationBackgroundError@2x.png"; path = "../../Resources/Images/NotificationBackgroundError@2x.png"; sourceTree = SOURCE_ROOT; }; + DB81EFA6D3FF4D95BD3850EB /* UIColor+MLColorAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIColor+MLColorAdditions.m"; path = "../../Classes/UIColorAdditions/UIColor+MLColorAdditions.m"; sourceTree = SOURCE_ROOT; }; + DBC966835DB54CBBA5800E43 /* NotificationBackgroundErrorIcon.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundErrorIcon.png; path = ../../Resources/Images/NotificationBackgroundErrorIcon.png; sourceTree = SOURCE_ROOT; }; + DC963400EFCA4E0A814BD8A2 /* NotificationBackgroundWarning.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = NotificationBackgroundWarning.png; path = ../../Resources/Images/NotificationBackgroundWarning.png; sourceTree = SOURCE_ROOT; }; + DE25A3734C8D46069ADD91DA /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = SOURCE_ROOT; }; + F8652C748BAB4F389A5A4656 /* UIColor+MLColorAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIColor+MLColorAdditions.h"; path = "MLUIColorAdditions/UIColor+MLColorAdditions.h"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + CF94E48097A64777BBE0C698 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 5EB8662B8D404ED3BBCF7E5E /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 260EEAAD2F184B24B1CCA6E3 /* Pods */ = { + isa = PBXGroup; + children = ( + 33DB1A89F49A4D809ABB93D1 /* MLUIColorAdditions */, + ); + name = Pods; + sourceTree = ""; + }; + 2880D3C06C794DD4A930E615 /* TSMessages */ = { + isa = PBXGroup; + children = ( + 58C3126A1739264200055226 /* Button.png */, + 58C3126B1739264200055226 /* Button@2x.png */, + C6F98B40E5A647D2901E0F42 /* design.json */, + 508E018B56F54ED6947D0815 /* NotificationBackgroundError.png */, + CABA16CB4DAA481B90EE4816 /* NotificationBackgroundError@2x.png */, + DBC966835DB54CBBA5800E43 /* NotificationBackgroundErrorIcon.png */, + 64DF44AA64804B02819961D9 /* NotificationBackgroundErrorIcon@2x.png */, + 2EE8049D71E34802B253DA69 /* NotificationBackgroundMessage.png */, + 99179B9F859346D791A394F7 /* NotificationBackgroundMessage@2x.png */, + 8B3E9BEF8532438BA89BF819 /* NotificationBackgroundSuccess.png */, + 2DCE67D8CB6E42458F244343 /* NotificationBackgroundSuccess@2x.png */, + 9FD35E89ABF84C749B69BEF1 /* NotificationBackgroundSuccessIcon.png */, + 92A5BD00EC5F4B6F89BE2414 /* NotificationBackgroundSuccessIcon@2x.png */, + DC963400EFCA4E0A814BD8A2 /* NotificationBackgroundWarning.png */, + 279ACA25A2E040048598E6FF /* NotificationBackgroundWarning@2x.png */, + 9F20C56CF7B44CD08CAA0320 /* NotificationBackgroundWarningIcon.png */, + 4ECC3779BA1F4D0D8CB6945F /* NotificationBackgroundWarningIcon@2x.png */, + ); + name = TSMessages; + sourceTree = ""; + }; + 28EC721246634EA698FD2646 /* Pods */ = { + isa = PBXGroup; + children = ( + 687DBA954A3A48D3BFC24645 /* Pods.xcconfig */, + 310219EF75B14D03B6BAA671 /* Pods-environment.h */, + 178D15C3713D437D9CE88D57 /* Pods-prefix.pch */, + 483D3DF0491F4D5783151774 /* Pods-resources.sh */, + AC578324C9C140A98D4F123E /* Pods-acknowledgements.plist */, + DE25A3734C8D46069ADD91DA /* Pods-acknowledgements.markdown */, + 02330E488B0F46BCBC4ACEF6 /* Pods-dummy.m */, + ); + name = Pods; + sourceTree = ""; + }; + 33DB1A89F49A4D809ABB93D1 /* MLUIColorAdditions */ = { + isa = PBXGroup; + children = ( + F8652C748BAB4F389A5A4656 /* UIColor+MLColorAdditions.h */, + 035A3611F84848AF9B728803 /* UIColor+MLColorAdditions.m */, + ); + name = MLUIColorAdditions; + sourceTree = ""; + }; + 3F37C0AD58E241B9A8F182B0 /* TSMessages */ = { + isa = PBXGroup; + children = ( + 571262F3F2CB44AF92926F9A /* TSMessage.h */, + 6CD408D1327F4876B5A4DA62 /* TSMessage.m */, + BB3A1E80D2F649009922C00A /* UIColor+MLColorAdditions.h */, + DB81EFA6D3FF4D95BD3850EB /* UIColor+MLColorAdditions.m */, + B6993672CCF6460487599F7E /* TSMessageView.h */, + 8FF1854E4034442A9A8AA9BD /* TSMessageView.m */, + ); + name = TSMessages; + sourceTree = ""; + }; + 452562DFE0044EB08B4D6CD9 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 28EC721246634EA698FD2646 /* Pods */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 61862EB4CCC0474FA0605DC8 /* Local Pods */ = { + isa = PBXGroup; + children = ( + 3F37C0AD58E241B9A8F182B0 /* TSMessages */, + ); + name = "Local Pods"; + sourceTree = ""; + }; + 7D41090274D2477A92E93B43 /* Products */ = { + isa = PBXGroup; + children = ( + 23637052F9524DA7B71CA2FD /* libPods.a */, + ); + name = Products; + sourceTree = ""; + }; + 8A21D677476847D8973FA281 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 0B4A6D38E662472F831C92AD /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8C9551CE4EB64B7792E6621D = { + isa = PBXGroup; + children = ( + 8A21D677476847D8973FA281 /* Frameworks */, + 61862EB4CCC0474FA0605DC8 /* Local Pods */, + 260EEAAD2F184B24B1CCA6E3 /* Pods */, + 7D41090274D2477A92E93B43 /* Products */, + D0D7404585024D8488575760 /* Resources */, + 452562DFE0044EB08B4D6CD9 /* Targets Support Files */, + 2285073171904AF5AD8EDF35 /* Podfile */, + ); + sourceTree = ""; + }; + D0D7404585024D8488575760 /* Resources */ = { + isa = PBXGroup; + children = ( + 2880D3C06C794DD4A930E615 /* TSMessages */, + ); + name = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 9832CDB8DD0B442AADF529E4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 14AAB9070B324770B9F0A517 /* UIColor+MLColorAdditions.h in Headers */, + 4C837AF42CA045F99851FB94 /* TSMessage.h in Headers */, + 667705A06CDA47DBB097BCDD /* UIColor+MLColorAdditions.h in Headers */, + 836CD614B9054AB5A159D8D6 /* TSMessageView.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 4F69DD634000404C85E81FFB /* Pods */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3357C7BAE3604B1AAD2CE05A /* Build configuration list for PBXNativeTarget "Pods" */; + buildPhases = ( + 2D9610711737437188BFD615 /* Sources */, + CF94E48097A64777BBE0C698 /* Frameworks */, + 9832CDB8DD0B442AADF529E4 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Pods; + productName = Pods; + productReference = 23637052F9524DA7B71CA2FD /* libPods.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 14F3A24B5E5D4E06B4CBE976 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + }; + buildConfigurationList = 0D03A8E4CECA4016B4C0F8E6 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 8C9551CE4EB64B7792E6621D; + productRefGroup = 7D41090274D2477A92E93B43 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4F69DD634000404C85E81FFB /* Pods */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2D9610711737437188BFD615 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6EBEF223767845728B7648AF /* UIColor+MLColorAdditions.m in Sources */, + 41074BA6BC4F4512B75653A1 /* TSMessage.m in Sources */, + 571DD6A69F154A518B20E753 /* UIColor+MLColorAdditions.m in Sources */, + 7CAC7D3908E647889B7867B5 /* TSMessageView.m in Sources */, + C5F171B07115465199CF7DBA /* Pods-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0707B4113BFC4B7AAD704F73 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + }; + name = Debug; + }; + 352B453F30474E2195D709D2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 687DBA954A3A48D3BFC24645 /* Pods.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + DSTROOT = /tmp/xcodeproj.dst; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Pods-prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_LDFLAGS = ""; + PODS_HEADERS_SEARCH_PATHS = "${PODS_BUILD_HEADERS_SEARCH_PATHS}"; + PODS_ROOT = "${SRCROOT}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 8BBB82B9776F41109D5A00C6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + }; + name = Release; + }; + FEF6002A65A64944ADE18D2C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 687DBA954A3A48D3BFC24645 /* Pods.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = YES; + DSTROOT = /tmp/xcodeproj.dst; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Pods-prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INSTALL_PATH = "$(BUILT_PRODUCTS_DIR)"; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; + OTHER_CFLAGS = ( + "-DNS_BLOCK_ASSERTIONS=1", + "$(inherited)", + ); + OTHER_CPLUSPLUSFLAGS = ( + "-DNS_BLOCK_ASSERTIONS=1", + "$(inherited)", + ); + OTHER_LDFLAGS = ""; + PODS_HEADERS_SEARCH_PATHS = "${PODS_BUILD_HEADERS_SEARCH_PATHS}"; + PODS_ROOT = "${SRCROOT}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0D03A8E4CECA4016B4C0F8E6 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8BBB82B9776F41109D5A00C6 /* Release */, + 0707B4113BFC4B7AAD704F73 /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3357C7BAE3604B1AAD2CE05A /* Build configuration list for PBXNativeTarget "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FEF6002A65A64944ADE18D2C /* Release */, + 352B453F30474E2195D709D2 /* Debug */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 14F3A24B5E5D4E06B4CBE976 /* Project object */; +} diff --git a/Resources/Images/Button.png b/Resources/Images/Button.png new file mode 100644 index 0000000000000000000000000000000000000000..d59b415e56c7f3cd1f2d174a8cb019969f4b5311 GIT binary patch literal 844 zcmeAS@N?(olHy`uVBq!ia0vp^5bb+nz0dys<7M*IA&&+9-I+0i}r^N@Cqp zO?OtZ%fqL*Z*5)Dsaf1Sg~T&t!2G(iN?3S-r2O~eAL>q+poXsg{=feP85sWmFJJS&1{fFd zptx8Ii;3nRp-Iuvzb7)OZhf#Iu~ebWu`Ns`%j6rA!KbIJ0&YU8!h&X7U60=m$tdE zaW;@MoB7u3ueaFhG>vC%X?`y{@8gY^$?x!YpyS>&}>W zmVLo2^QK)b+G(>b_cvQvxX<#->^7&W1z7&@_5G7JGw=PJ|6OVC;$Ke9{>OV9{>OZKxwBG+5i9q z3`s;mRA>dvm`O}iK^%vx0gEk*1%ZUFl#E;!J0)Y zNce^ycx|;>9~KrC-gY<~m5q&!H`?0Tu61;D6onINgW9UBtaRAz_9lzP;zgD>$Q0o7 z`Q^wd2FLd#wgpfT36gO`MRIcTSA)UeD=jUp?(OZp90&yRW@l$@OG`_Z&CShB{G&OX zP#X&i3)Y#LnNwq9W9K_NJFgTK6;7?-{@OP-Ht6XyEwH$_XliY3y{gmc9wF-q5;$o#o4fsfe*v!3S!a29+1S<9 zbqVjPE@Vw0fkX&A7#bSN$F-hyFiO&UdU^^>CR2MzATu-5Gcq!A4i!4qfq))6gnS6J zA?wNQ9w33?;o&?~XjumWI`qH=yp=s60Tk{J4i4s`Lc=-`(2@Xl4fjI==#F~>0|RGK zp=KQjXbu(d`Fv*(Ud1}=>+5Q)Lg%px-9y%$Ie>y2ujm|9C|L&rDr~XOVSDWk2~eT0 zua7oy3f6&u5(lchzX_y4fN3D0Xm4-N#qOas)B{xTdcAZ8kh2a1(mWo|S)83)LIPC4 z%fW_K)RvZ(oC5+_nz9gH$~q8`k$_62av|%^ zGKzu|Guw&^3F|;W>U26!VN=dHhuFEvCiu1su*8R zY!GlF>&_6u@$3#}HXY`LtOEfNzFTD@^WBgDKHc4Mxmq$gGRLz)6Pg+qFg|RA>hr9#?c|;Ke6~sqtP1MvD(_o@BNG-*h))XHx zR#c=oaN^vV#zZHM960v}_y?Ric4mymw~idxwJ;iQn+~<-CSSOmT-a;fz0W=ST-ojI zt+}G2A~!cT7s9z!bgr+jZR6wP&ComtttJ@_I2?{&*=)8R=VhXEb#-MO9UX0w7;rkB z*_oM{AjDfl2L{S$z~yq~p!F^TG>}fG0~j!i&gJE$C6!7wvT7a-*zNY&iHV6i4u}p6 zn1_aj8YBj6Hd|(FY^)aIOGW46;=(jII2bA~FVFI3=O-}@3=a?2V8AFkFi@IIChM(M z>+FL8i^Y;bTKpI=h|c->xv{^$KPWL^GMQ$O79YgxMd$47%n*yk0=((adRIb^4CpW@ zG^eMh`rh8&x<3s}ClZNjh}VkF$;pYXySuwqVnDCgPsQVLFT|IK&hhcFmIhcg(0W%w zFp!Q$qaF-sMCa(}sHCf_s|E(9B?jQC3Il4$66rKJ3eN{_KOEt^>v4J!OD>3j=bar-jRH0C)8dXCB zX0{R*rBay=27~Usy*(OGh|Jd3mdb|%23SIQ17%3Zq}%QGuC1+c4#-7jadA5%s?4h(@9XD%jLKZ2yFnH86BF>=E};-pZ5kVt*xy?27{qJ91gRcE*6#D-CcP{ zM~4{|^A5)VbmmK_bYWrPJ?23iW#qy+=RuK(P#gBb70~)+d3m`F8jUO=uD-sis;UvS zTHSy{kGa4s6p92j;Xz|isZ`B@Kp+KeY<-k8@B%njR#qZ#7Q^K5V5QS+Z*MaTLYSa< zEM6s8eSKK7K5uMngrUt23TS|^3k_gbmMkhNis*DYH=a}_m@v!)4gNQ%0i~_OW7AVu zSlE-vWcs0p+h4XlvU>v*XalcDMn=Bk!YIlq2*)-WL7${R{V^lYVuZ06)8p}IsR3F- za=AP&?*~#iAd|`Z zKos;mF^tjY^?C;)kw|KFb(MGhJ!k}cZ$%w6TE;=CKq@GIza^Vf++a-#4tt= zV9d9m88`sD1c`Wjmy}T65eEV5iz_lG3OD*(;P}$(x!&9{7GrXMP7TzOuX%hv*7;8Z vyohPykLa3z@Z3!vV=^{1Jd_O1B?f*2b3}HBSw;&?00000NkvXXu0mjf;S9{c literal 0 HcmV?d00001 diff --git a/Views/TSMessageView.h b/Views/TSMessageView.h index 6288ac80..1cd11088 100755 --- a/Views/TSMessageView.h +++ b/Views/TSMessageView.h @@ -34,6 +34,8 @@ @param duration The duration this notification should be displayed (optional) @param viewController The view controller this message should be displayed in @param callback The block that should be executed, when the user tapped on the message + @param buttonTitle The title for button (optional) + @param buttonCallback The block that should be executed, when the user tapped on the button @param position The position of the message on the screen */ - (id)initWithTitle:(NSString *)title @@ -42,6 +44,8 @@ withDuration:(CGFloat)duration inViewController:(UIViewController *)viewController withCallback:(void (^)())callback + withButtonTitle:(NSString *)buttonTitle + withButtonCallback:(void (^)())buttonCallback atPosition:(TSMessageNotificationPosition)position; /** Fades out this notification view */ diff --git a/Views/TSMessageView.m b/Views/TSMessageView.m index a67403bd..1bcb9cee 100755 --- a/Views/TSMessageView.m +++ b/Views/TSMessageView.m @@ -19,18 +19,22 @@ @interface TSMessageView () @property (nonatomic, strong) NSString *title; @property (nonatomic, strong) NSString *content; +@property (nonatomic, strong) NSString *buttonTitle; @property (nonatomic, strong) UIViewController *viewController; /** Internal properties needed to resize the view on device rotation properly */ @property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *contentLabel; @property (nonatomic, strong) UIImageView *iconImageView; +@property (nonatomic, strong) UIButton *button; @property (nonatomic, strong) UIView *borderView; @property (nonatomic, strong) UIImageView *backgroundImageView; @property (nonatomic, assign) CGFloat textSpaceLeft; +@property (nonatomic, assign) CGFloat textSpaceRight; @property (copy) void (^callback)(); +@property (copy) void (^buttonCallback)(); - (CGFloat)updateHeightOfMessageView; - (void)layoutSubviews; @@ -46,6 +50,8 @@ - (id)initWithTitle:(NSString *)title withDuration:(CGFloat)duration inViewController:(UIViewController *)viewController withCallback:(void (^)())callback + withButtonTitle:(NSString *)buttonTitle + withButtonCallback:(void (^)())buttonCallback atPosition:(TSMessageNotificationPosition)position { if (!notificationDesign) @@ -60,10 +66,12 @@ - (id)initWithTitle:(NSString *)title { _title = title; _content = content; + _buttonTitle = buttonTitle; _duration = duration; _viewController = viewController; _messsagePosition = position; self.callback = callback; + self.buttonCallback = buttonCallback; CGFloat screenWidth = self.viewController.view.frame.size.width; NSDictionary *current; @@ -118,6 +126,8 @@ - (id)initWithTitle:(NSString *)title self.textSpaceLeft = 2 * TSMessageViewPadding; if (image) self.textSpaceLeft += image.size.width + 2 * TSMessageViewPadding; + if (buttonTitle) self.textSpaceRight = 75; + // Set up title label _titleLabel = [[UILabel alloc] init]; [self.titleLabel setText:title]; @@ -157,6 +167,25 @@ - (id)initWithTitle:(NSString *)title [self addSubview:self.iconImageView]; } + //Set up button (if set) + if ([buttonTitle length]) + { + self.button = [UIButton buttonWithType:UIButtonTypeCustom]; + self.button.frame = CGRectMake(screenWidth - TSMessageViewPadding - 70, 0, 70, 31); + + UIImage * img = [[UIImage imageNamed:@"Button"] resizableImageWithCapInsets:UIEdgeInsetsMake(15, 12, 15, 11)]; + + [self.button setBackgroundImage:img forState:UIControlStateNormal]; + [self.button setTitle:self.buttonTitle forState:UIControlStateNormal]; + [self.button setTitleShadowColor:self.titleLabel.shadowColor forState:UIControlStateNormal]; + [self.button setTitleColor:fontColor forState:UIControlStateNormal]; + self.button.titleLabel.font = [UIFont boldSystemFontOfSize:[[current valueForKey:@"titleFontSize"] floatValue]]; + self.button.titleLabel.shadowOffset = self.titleLabel.shadowOffset; + [self.button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; + + [self addSubview:self.button]; + } + // Add a border on the bottom _borderView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, // will be set later @@ -202,7 +231,7 @@ - (CGFloat)updateHeightOfMessageView self.titleLabel.frame = CGRectMake(self.textSpaceLeft, TSMessageViewPadding, - screenWidth - TSMessageViewPadding - self.textSpaceLeft, + screenWidth - TSMessageViewPadding - self.textSpaceLeft - self.textSpaceRight, 0.0); [self.titleLabel sizeToFit]; @@ -210,7 +239,7 @@ - (CGFloat)updateHeightOfMessageView { self.contentLabel.frame = CGRectMake(self.textSpaceLeft, self.titleLabel.frame.origin.y + self.titleLabel.frame.size.height + 5.0, - screenWidth - TSMessageViewPadding - self.textSpaceLeft, + screenWidth - TSMessageViewPadding - self.textSpaceLeft - self.textSpaceRight, 0.0); [self.contentLabel sizeToFit]; @@ -238,7 +267,11 @@ - (CGFloat)updateHeightOfMessageView round(currentHeight / 2.0)); } } - + + // z-align button + self.button.center = CGPointMake([self.button center].x, + round(currentHeight / 2.0)); + // Correct the border position CGRect borderFrame = self.borderView.frame; borderFrame.origin.y = currentHeight; @@ -278,4 +311,15 @@ - (void)fadeMeOut }); } +#pragma mark - UIButton target + +- (void)buttonTapped:(id) sender +{ + if (self.buttonCallback) { + self.buttonCallback(); + } + + [self fadeMeOut]; +} + @end From 3e97969ed2ef81fb03daa9053cbc2e6402596e92 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Tue, 7 May 2013 17:13:45 +0200 Subject: [PATCH 2/4] Added border to messages when displayed on the bottom Fixed automatic width of added button Fixed rotation when adding a button Updated example project --- Classes/TSMessage.m | 4 +- .../Example/TSSecondViewController.h | 3 +- .../Example/TSSecondViewController.m | 47 +- .../en.lproj/MainStoryboard.storyboard | 40 +- ExampleProject/Podfile.lock | 2 +- ExampleProject/Pods/Manifest.lock | 2 +- ExampleProject/Pods/Pods-dummy.m | 1 - ExampleProject/Pods/Pods-prefix.pch | 2 +- ExampleProject/Pods/Pods-resources.sh | 6 +- ExampleProject/Pods/Pods.xcconfig | 1 - .../Pods/Pods.xcodeproj/project.pbxproj | 1411 ++++++++++++----- .../xcschemes/xcschememanagement.plist | 15 + ...n.png => NotificationButtonBackground.png} | Bin ...ng => NotificationButtonBackground@2x.png} | Bin Views/TSMessageView.h | 2 +- Views/TSMessageView.m | 50 +- 16 files changed, 1165 insertions(+), 421 deletions(-) rename Resources/Images/{Button.png => NotificationButtonBackground.png} (100%) rename Resources/Images/{Button@2x.png => NotificationButtonBackground@2x.png} (100%) diff --git a/Classes/TSMessage.m b/Classes/TSMessage.m index d2c48afe..3fe360af 100755 --- a/Classes/TSMessage.m +++ b/Classes/TSMessage.m @@ -219,7 +219,7 @@ - (void)fadeInCurrentNotification } CGPoint toPoint; - if (currentView.messsagePosition == TSMessageNotificationPositionTop) + if (currentView.messagePosition == TSMessageNotificationPositionTop) { toPoint = CGPointMake(currentView.center.x, [[self class] navigationbarBottomOfViewController:currentView.viewController] + verticalOffset + CGRectGetHeight(currentView.frame) / 2.0); @@ -257,7 +257,7 @@ - (void)fadeOutNotification:(TSMessageView *)currentView object:currentView]; CGPoint fadeOutToPoint; - if (currentView.messsagePosition == TSMessageNotificationPositionTop) + if (currentView.messagePosition == TSMessageNotificationPositionTop) { fadeOutToPoint = CGPointMake(currentView.center.x, -CGRectGetHeight(currentView.frame) / 2.0);; } diff --git a/ExampleProject/Example/TSSecondViewController.h b/ExampleProject/Example/TSSecondViewController.h index 940d4bd6..1f8ad1c5 100644 --- a/ExampleProject/Example/TSSecondViewController.h +++ b/ExampleProject/Example/TSSecondViewController.h @@ -12,12 +12,13 @@ @property (weak, nonatomic) IBOutlet UISwitch *descriptionToggle; @property (weak, nonatomic) IBOutlet UISwitch *longDurationToggle; -@property (weak, nonatomic) IBOutlet UISwitch *buttonToggle; +@property (weak, nonatomic) IBOutlet UISwitch *onBottomToggle; - (IBAction)didTapError:(id)sender; - (IBAction)didTapWarning:(id)sender; - (IBAction)didTapMessage:(id)sender; - (IBAction)didTapSuccess:(id)sender; +- (IBAction)didTapButtonidsender:(id)sender; @end diff --git a/ExampleProject/Example/TSSecondViewController.m b/ExampleProject/Example/TSSecondViewController.m index ee413b4f..24a7e8f7 100644 --- a/ExampleProject/Example/TSSecondViewController.m +++ b/ExampleProject/Example/TSSecondViewController.m @@ -33,7 +33,8 @@ - (IBAction)didTapError:(id)sender withTitle:NSLocalizedString(@"You dismisses it", nil) withMessage:nil withType:TSMessageNotificationTypeSuccess]; - }]; + } + atPosition:self.onBottomToggle.on]; } - (IBAction)didTapWarning:(id)sender @@ -49,7 +50,9 @@ - (IBAction)didTapWarning:(id)sender withTitle:notificationTitle withMessage:notificationDescription withType:TSMessageNotificationTypeWarning - withDuration:duration]; + withDuration:duration + withCallback:nil + atPosition:self.onBottomToggle.on]; } - (IBAction)didTapMessage:(id)sender @@ -59,8 +62,6 @@ - (IBAction)didTapMessage:(id)sender NSLocalizedString(@"This is some neutral notification.", nil) : nil); - NSString *buttonTitle = self.buttonToggle.on ? @"UPDATE" : nil; - CGFloat duration = (self.longDurationToggle.on ? TSSecondViewControllerLongDuration : 0.0); [TSMessage showNotificationInViewController:self @@ -69,14 +70,7 @@ - (IBAction)didTapMessage:(id)sender withType:TSMessageNotificationTypeMessage withDuration:duration withCallback:nil - withButtonTitle:buttonTitle - withButtonCallback:^{ - [TSMessage showNotificationInViewController:self - withTitle:NSLocalizedString(@"Button tapped!", nil) - withMessage:nil - withType:TSMessageNotificationTypeSuccess]; - } - atPosition:TSMessageNotificationPositionTop]; + atPosition:self.onBottomToggle.on]; } - (IBAction)didTapSuccess:(id)sender @@ -92,7 +86,34 @@ - (IBAction)didTapSuccess:(id)sender withTitle:notificationTitle withMessage:notificationDescription withType:TSMessageNotificationTypeSuccess - withDuration:duration]; + withDuration:duration + withCallback:nil + atPosition:self.onBottomToggle.on]; +} + +- (IBAction)didTapButtonidsender:(id)sender +{ + NSString *notificationTitle = NSLocalizedString(@"New version available", nil); + NSString *notificationDescription = (self.descriptionToggle.on ? + NSLocalizedString(@"Please update our app. This is some neutral notification. lorem ipsum o sole mio wie geht es dir! jeej ksjd", nil) : + nil); + + CGFloat duration = (self.longDurationToggle.on ? TSSecondViewControllerLongDuration : 0.0); + + [TSMessage showNotificationInViewController:self + withTitle:notificationTitle + withMessage:notificationDescription + withType:TSMessageNotificationTypeMessage + withDuration:duration + withCallback:nil + withButtonTitle:@"Update" // that's the title of the added button + withButtonCallback:^{ + [TSMessage showNotificationInViewController:self + withTitle:NSLocalizedString(@"Button tapped!", nil) + withMessage:nil + withType:TSMessageNotificationTypeSuccess]; + } + atPosition:self.onBottomToggle.on]; } @end diff --git a/ExampleProject/Example/en.lproj/MainStoryboard.storyboard b/ExampleProject/Example/en.lproj/MainStoryboard.storyboard index d8b86190..454236ec 100644 --- a/ExampleProject/Example/en.lproj/MainStoryboard.storyboard +++ b/ExampleProject/Example/en.lproj/MainStoryboard.storyboard @@ -67,6 +67,19 @@ + - -