├── .gitignore ├── LICENSE ├── README.md ├── STBubbleTableViewCellDemo ├── STBubbleTableViewCellDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── STBubbleTableViewCellDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Images │ ├── Bubble-0.png │ ├── Bubble-0@2x.png │ ├── Bubble-1.png │ ├── Bubble-1@2x.png │ ├── Bubble-2.png │ ├── Bubble-2@2x.png │ ├── Bubble-3.png │ ├── Bubble-3@2x.png │ ├── Bubble-4.png │ ├── Bubble-4@2x.png │ ├── Bubble-5.png │ ├── Bubble-5@2x.png │ ├── Bubble-6.png │ ├── Bubble-6@2x.png │ ├── Bubble-7.png │ ├── Bubble-7@2x.png │ ├── Bubble-8.png │ ├── Bubble-8@2x.png │ ├── Bubble-9.png │ └── Bubble-9@2x.png │ ├── Message.h │ ├── Message.m │ ├── STBubbleTableViewCell │ ├── STBubbleTableViewCell.h │ └── STBubbleTableViewCell.m │ ├── STBubbleTableViewCellDemo-Info.plist │ ├── STBubbleTableViewCellDemo-Prefix.pch │ ├── STBubbleTableViewCellDemoViewController.h │ ├── STBubbleTableViewCellDemoViewController.m │ ├── SkyTrix.png │ ├── en.lproj │ └── InfoPlist.strings │ ├── jonnotie.png │ └── main.m └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Cedric Vandendriessche 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | STBubbleTableViewCell 2 | ===================== 3 | 4 | STBubbleTableViewCell is a UITableViewCell subclass for easily displaying chat conversations. 5 | 6 | ## Screenshot 7 | 8 | ![screenshot](https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/master/screenshot.png) 9 | 10 | ## Features 11 | - Avatar support 12 | - 10 different colors 13 | - Easily position bubble left or right 14 | - Tap & hold to copy contents 15 | - Change color on selection 16 | - Works with both iPhone and iPad (portrait/landscape) 17 | - Delegate method for tapped avatar 18 | - Datasource method for margin from side -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 82727A5317C8F16900AD496B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82727A5217C8F16900AD496B /* UIKit.framework */; }; 11 | 82727A5517C8F16900AD496B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82727A5417C8F16900AD496B /* Foundation.framework */; }; 12 | 82727A5717C8F16900AD496B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82727A5617C8F16900AD496B /* CoreGraphics.framework */; }; 13 | 82727A5D17C8F16900AD496B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 82727A5B17C8F16900AD496B /* InfoPlist.strings */; }; 14 | 82727A5F17C8F16900AD496B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 82727A5E17C8F16900AD496B /* main.m */; }; 15 | 82727A6317C8F16900AD496B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 82727A6217C8F16900AD496B /* AppDelegate.m */; }; 16 | 82727A6517C8F16900AD496B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A6417C8F16900AD496B /* Default.png */; }; 17 | 82727A6717C8F16900AD496B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A6617C8F16900AD496B /* Default@2x.png */; }; 18 | 82727A6917C8F16900AD496B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A6817C8F16900AD496B /* Default-568h@2x.png */; }; 19 | 82727A7217C8F1AC00AD496B /* STBubbleTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 82727A7117C8F1AC00AD496B /* STBubbleTableViewCell.m */; }; 20 | 82727A7617C8F2C500AD496B /* jonnotie.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7417C8F2C500AD496B /* jonnotie.png */; }; 21 | 82727A7717C8F2C500AD496B /* SkyTrix.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7517C8F2C500AD496B /* SkyTrix.png */; }; 22 | 82727A8D17C8F2D100AD496B /* Bubble-0.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7917C8F2D100AD496B /* Bubble-0.png */; }; 23 | 82727A8E17C8F2D100AD496B /* Bubble-0@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7A17C8F2D100AD496B /* Bubble-0@2x.png */; }; 24 | 82727A8F17C8F2D100AD496B /* Bubble-1.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7B17C8F2D100AD496B /* Bubble-1.png */; }; 25 | 82727A9017C8F2D100AD496B /* Bubble-1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7C17C8F2D100AD496B /* Bubble-1@2x.png */; }; 26 | 82727A9117C8F2D100AD496B /* Bubble-2.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7D17C8F2D100AD496B /* Bubble-2.png */; }; 27 | 82727A9217C8F2D100AD496B /* Bubble-2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7E17C8F2D100AD496B /* Bubble-2@2x.png */; }; 28 | 82727A9317C8F2D100AD496B /* Bubble-3.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A7F17C8F2D100AD496B /* Bubble-3.png */; }; 29 | 82727A9417C8F2D100AD496B /* Bubble-3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8017C8F2D100AD496B /* Bubble-3@2x.png */; }; 30 | 82727A9517C8F2D100AD496B /* Bubble-4.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8117C8F2D100AD496B /* Bubble-4.png */; }; 31 | 82727A9617C8F2D100AD496B /* Bubble-4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8217C8F2D100AD496B /* Bubble-4@2x.png */; }; 32 | 82727A9717C8F2D100AD496B /* Bubble-5.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8317C8F2D100AD496B /* Bubble-5.png */; }; 33 | 82727A9817C8F2D100AD496B /* Bubble-5@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8417C8F2D100AD496B /* Bubble-5@2x.png */; }; 34 | 82727A9917C8F2D100AD496B /* Bubble-6.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8517C8F2D100AD496B /* Bubble-6.png */; }; 35 | 82727A9A17C8F2D100AD496B /* Bubble-6@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8617C8F2D100AD496B /* Bubble-6@2x.png */; }; 36 | 82727A9B17C8F2D100AD496B /* Bubble-7.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8717C8F2D100AD496B /* Bubble-7.png */; }; 37 | 82727A9C17C8F2D100AD496B /* Bubble-7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8817C8F2D100AD496B /* Bubble-7@2x.png */; }; 38 | 82727A9D17C8F2D100AD496B /* Bubble-8.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8917C8F2D100AD496B /* Bubble-8.png */; }; 39 | 82727A9E17C8F2D100AD496B /* Bubble-8@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8A17C8F2D100AD496B /* Bubble-8@2x.png */; }; 40 | 82727A9F17C8F2D100AD496B /* Bubble-9.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8B17C8F2D100AD496B /* Bubble-9.png */; }; 41 | 82727AA017C8F2D100AD496B /* Bubble-9@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 82727A8C17C8F2D100AD496B /* Bubble-9@2x.png */; }; 42 | 82727AA917C8F3F200AD496B /* STBubbleTableViewCellDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 82727AA817C8F3F100AD496B /* STBubbleTableViewCellDemoViewController.m */; }; 43 | 82727AAC17C8F40B00AD496B /* Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 82727AAB17C8F40B00AD496B /* Message.m */; }; 44 | /* End PBXBuildFile section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 82727A4F17C8F16900AD496B /* STBubbleTableViewCellDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = STBubbleTableViewCellDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 82727A5217C8F16900AD496B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 49 | 82727A5417C8F16900AD496B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 50 | 82727A5617C8F16900AD496B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 51 | 82727A5A17C8F16900AD496B /* STBubbleTableViewCellDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "STBubbleTableViewCellDemo-Info.plist"; sourceTree = ""; }; 52 | 82727A5C17C8F16900AD496B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 53 | 82727A5E17C8F16900AD496B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 54 | 82727A6017C8F16900AD496B /* STBubbleTableViewCellDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "STBubbleTableViewCellDemo-Prefix.pch"; sourceTree = ""; }; 55 | 82727A6117C8F16900AD496B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 56 | 82727A6217C8F16900AD496B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 57 | 82727A6417C8F16900AD496B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 58 | 82727A6617C8F16900AD496B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 59 | 82727A6817C8F16900AD496B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 60 | 82727A7017C8F1AC00AD496B /* STBubbleTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STBubbleTableViewCell.h; sourceTree = ""; }; 61 | 82727A7117C8F1AC00AD496B /* STBubbleTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STBubbleTableViewCell.m; sourceTree = ""; }; 62 | 82727A7417C8F2C500AD496B /* jonnotie.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = jonnotie.png; sourceTree = ""; }; 63 | 82727A7517C8F2C500AD496B /* SkyTrix.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SkyTrix.png; sourceTree = ""; }; 64 | 82727A7917C8F2D100AD496B /* Bubble-0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-0.png"; sourceTree = ""; }; 65 | 82727A7A17C8F2D100AD496B /* Bubble-0@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-0@2x.png"; sourceTree = ""; }; 66 | 82727A7B17C8F2D100AD496B /* Bubble-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-1.png"; sourceTree = ""; }; 67 | 82727A7C17C8F2D100AD496B /* Bubble-1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-1@2x.png"; sourceTree = ""; }; 68 | 82727A7D17C8F2D100AD496B /* Bubble-2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-2.png"; sourceTree = ""; }; 69 | 82727A7E17C8F2D100AD496B /* Bubble-2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-2@2x.png"; sourceTree = ""; }; 70 | 82727A7F17C8F2D100AD496B /* Bubble-3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-3.png"; sourceTree = ""; }; 71 | 82727A8017C8F2D100AD496B /* Bubble-3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-3@2x.png"; sourceTree = ""; }; 72 | 82727A8117C8F2D100AD496B /* Bubble-4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-4.png"; sourceTree = ""; }; 73 | 82727A8217C8F2D100AD496B /* Bubble-4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-4@2x.png"; sourceTree = ""; }; 74 | 82727A8317C8F2D100AD496B /* Bubble-5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-5.png"; sourceTree = ""; }; 75 | 82727A8417C8F2D100AD496B /* Bubble-5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-5@2x.png"; sourceTree = ""; }; 76 | 82727A8517C8F2D100AD496B /* Bubble-6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-6.png"; sourceTree = ""; }; 77 | 82727A8617C8F2D100AD496B /* Bubble-6@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-6@2x.png"; sourceTree = ""; }; 78 | 82727A8717C8F2D100AD496B /* Bubble-7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-7.png"; sourceTree = ""; }; 79 | 82727A8817C8F2D100AD496B /* Bubble-7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-7@2x.png"; sourceTree = ""; }; 80 | 82727A8917C8F2D100AD496B /* Bubble-8.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-8.png"; sourceTree = ""; }; 81 | 82727A8A17C8F2D100AD496B /* Bubble-8@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-8@2x.png"; sourceTree = ""; }; 82 | 82727A8B17C8F2D100AD496B /* Bubble-9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-9.png"; sourceTree = ""; }; 83 | 82727A8C17C8F2D100AD496B /* Bubble-9@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Bubble-9@2x.png"; sourceTree = ""; }; 84 | 82727AA717C8F3F100AD496B /* STBubbleTableViewCellDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STBubbleTableViewCellDemoViewController.h; path = STBubbleTableViewCellDemo/STBubbleTableViewCellDemoViewController.h; sourceTree = SOURCE_ROOT; }; 85 | 82727AA817C8F3F100AD496B /* STBubbleTableViewCellDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = STBubbleTableViewCellDemoViewController.m; path = STBubbleTableViewCellDemo/STBubbleTableViewCellDemoViewController.m; sourceTree = SOURCE_ROOT; }; 86 | 82727AAA17C8F40B00AD496B /* Message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = ""; }; 87 | 82727AAB17C8F40B00AD496B /* Message.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Message.m; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 82727A4C17C8F16900AD496B /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | 82727A5317C8F16900AD496B /* UIKit.framework in Frameworks */, 96 | 82727A5517C8F16900AD496B /* Foundation.framework in Frameworks */, 97 | 82727A5717C8F16900AD496B /* CoreGraphics.framework in Frameworks */, 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | /* End PBXFrameworksBuildPhase section */ 102 | 103 | /* Begin PBXGroup section */ 104 | 82727A4617C8F16900AD496B = { 105 | isa = PBXGroup; 106 | children = ( 107 | 82727A5817C8F16900AD496B /* STBubbleTableViewCellDemo */, 108 | 82727A5117C8F16900AD496B /* Frameworks */, 109 | 82727A5017C8F16900AD496B /* Products */, 110 | ); 111 | sourceTree = ""; 112 | }; 113 | 82727A5017C8F16900AD496B /* Products */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 82727A4F17C8F16900AD496B /* STBubbleTableViewCellDemo.app */, 117 | ); 118 | name = Products; 119 | sourceTree = ""; 120 | }; 121 | 82727A5117C8F16900AD496B /* Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 82727A5217C8F16900AD496B /* UIKit.framework */, 125 | 82727A5417C8F16900AD496B /* Foundation.framework */, 126 | 82727A5617C8F16900AD496B /* CoreGraphics.framework */, 127 | ); 128 | name = Frameworks; 129 | sourceTree = ""; 130 | }; 131 | 82727A5817C8F16900AD496B /* STBubbleTableViewCellDemo */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 82727A6F17C8F1AC00AD496B /* STBubbleTableViewCell */, 135 | 82727AA717C8F3F100AD496B /* STBubbleTableViewCellDemoViewController.h */, 136 | 82727AA817C8F3F100AD496B /* STBubbleTableViewCellDemoViewController.m */, 137 | 82727AAA17C8F40B00AD496B /* Message.h */, 138 | 82727AAB17C8F40B00AD496B /* Message.m */, 139 | 82727A6117C8F16900AD496B /* AppDelegate.h */, 140 | 82727A6217C8F16900AD496B /* AppDelegate.m */, 141 | 82727A7317C8F2A000AD496B /* Resources */, 142 | 82727A5917C8F16900AD496B /* Supporting Files */, 143 | ); 144 | path = STBubbleTableViewCellDemo; 145 | sourceTree = ""; 146 | }; 147 | 82727A5917C8F16900AD496B /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 82727A5A17C8F16900AD496B /* STBubbleTableViewCellDemo-Info.plist */, 151 | 82727A5B17C8F16900AD496B /* InfoPlist.strings */, 152 | 82727A5E17C8F16900AD496B /* main.m */, 153 | 82727A6017C8F16900AD496B /* STBubbleTableViewCellDemo-Prefix.pch */, 154 | 82727A6417C8F16900AD496B /* Default.png */, 155 | 82727A6617C8F16900AD496B /* Default@2x.png */, 156 | 82727A6817C8F16900AD496B /* Default-568h@2x.png */, 157 | ); 158 | name = "Supporting Files"; 159 | sourceTree = ""; 160 | }; 161 | 82727A6F17C8F1AC00AD496B /* STBubbleTableViewCell */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 82727A7017C8F1AC00AD496B /* STBubbleTableViewCell.h */, 165 | 82727A7117C8F1AC00AD496B /* STBubbleTableViewCell.m */, 166 | ); 167 | path = STBubbleTableViewCell; 168 | sourceTree = ""; 169 | }; 170 | 82727A7317C8F2A000AD496B /* Resources */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 82727A7817C8F2D100AD496B /* Images */, 174 | 82727A7417C8F2C500AD496B /* jonnotie.png */, 175 | 82727A7517C8F2C500AD496B /* SkyTrix.png */, 176 | ); 177 | name = Resources; 178 | sourceTree = ""; 179 | }; 180 | 82727A7817C8F2D100AD496B /* Images */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 82727A7917C8F2D100AD496B /* Bubble-0.png */, 184 | 82727A7A17C8F2D100AD496B /* Bubble-0@2x.png */, 185 | 82727A7B17C8F2D100AD496B /* Bubble-1.png */, 186 | 82727A7C17C8F2D100AD496B /* Bubble-1@2x.png */, 187 | 82727A7D17C8F2D100AD496B /* Bubble-2.png */, 188 | 82727A7E17C8F2D100AD496B /* Bubble-2@2x.png */, 189 | 82727A7F17C8F2D100AD496B /* Bubble-3.png */, 190 | 82727A8017C8F2D100AD496B /* Bubble-3@2x.png */, 191 | 82727A8117C8F2D100AD496B /* Bubble-4.png */, 192 | 82727A8217C8F2D100AD496B /* Bubble-4@2x.png */, 193 | 82727A8317C8F2D100AD496B /* Bubble-5.png */, 194 | 82727A8417C8F2D100AD496B /* Bubble-5@2x.png */, 195 | 82727A8517C8F2D100AD496B /* Bubble-6.png */, 196 | 82727A8617C8F2D100AD496B /* Bubble-6@2x.png */, 197 | 82727A8717C8F2D100AD496B /* Bubble-7.png */, 198 | 82727A8817C8F2D100AD496B /* Bubble-7@2x.png */, 199 | 82727A8917C8F2D100AD496B /* Bubble-8.png */, 200 | 82727A8A17C8F2D100AD496B /* Bubble-8@2x.png */, 201 | 82727A8B17C8F2D100AD496B /* Bubble-9.png */, 202 | 82727A8C17C8F2D100AD496B /* Bubble-9@2x.png */, 203 | ); 204 | path = Images; 205 | sourceTree = ""; 206 | }; 207 | /* End PBXGroup section */ 208 | 209 | /* Begin PBXNativeTarget section */ 210 | 82727A4E17C8F16900AD496B /* STBubbleTableViewCellDemo */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = 82727A6C17C8F16900AD496B /* Build configuration list for PBXNativeTarget "STBubbleTableViewCellDemo" */; 213 | buildPhases = ( 214 | 82727A4B17C8F16900AD496B /* Sources */, 215 | 82727A4C17C8F16900AD496B /* Frameworks */, 216 | 82727A4D17C8F16900AD496B /* Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | ); 222 | name = STBubbleTableViewCellDemo; 223 | productName = STBubbleTableViewCellDemo; 224 | productReference = 82727A4F17C8F16900AD496B /* STBubbleTableViewCellDemo.app */; 225 | productType = "com.apple.product-type.application"; 226 | }; 227 | /* End PBXNativeTarget section */ 228 | 229 | /* Begin PBXProject section */ 230 | 82727A4717C8F16900AD496B /* Project object */ = { 231 | isa = PBXProject; 232 | attributes = { 233 | LastUpgradeCheck = 0460; 234 | ORGANIZATIONNAME = FreshCreations; 235 | }; 236 | buildConfigurationList = 82727A4A17C8F16900AD496B /* Build configuration list for PBXProject "STBubbleTableViewCellDemo" */; 237 | compatibilityVersion = "Xcode 3.2"; 238 | developmentRegion = English; 239 | hasScannedForEncodings = 0; 240 | knownRegions = ( 241 | en, 242 | ); 243 | mainGroup = 82727A4617C8F16900AD496B; 244 | productRefGroup = 82727A5017C8F16900AD496B /* Products */; 245 | projectDirPath = ""; 246 | projectRoot = ""; 247 | targets = ( 248 | 82727A4E17C8F16900AD496B /* STBubbleTableViewCellDemo */, 249 | ); 250 | }; 251 | /* End PBXProject section */ 252 | 253 | /* Begin PBXResourcesBuildPhase section */ 254 | 82727A4D17C8F16900AD496B /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | 82727A5D17C8F16900AD496B /* InfoPlist.strings in Resources */, 259 | 82727A6517C8F16900AD496B /* Default.png in Resources */, 260 | 82727A6717C8F16900AD496B /* Default@2x.png in Resources */, 261 | 82727A6917C8F16900AD496B /* Default-568h@2x.png in Resources */, 262 | 82727A7617C8F2C500AD496B /* jonnotie.png in Resources */, 263 | 82727A7717C8F2C500AD496B /* SkyTrix.png in Resources */, 264 | 82727A8D17C8F2D100AD496B /* Bubble-0.png in Resources */, 265 | 82727A8E17C8F2D100AD496B /* Bubble-0@2x.png in Resources */, 266 | 82727A8F17C8F2D100AD496B /* Bubble-1.png in Resources */, 267 | 82727A9017C8F2D100AD496B /* Bubble-1@2x.png in Resources */, 268 | 82727A9117C8F2D100AD496B /* Bubble-2.png in Resources */, 269 | 82727A9217C8F2D100AD496B /* Bubble-2@2x.png in Resources */, 270 | 82727A9317C8F2D100AD496B /* Bubble-3.png in Resources */, 271 | 82727A9417C8F2D100AD496B /* Bubble-3@2x.png in Resources */, 272 | 82727A9517C8F2D100AD496B /* Bubble-4.png in Resources */, 273 | 82727A9617C8F2D100AD496B /* Bubble-4@2x.png in Resources */, 274 | 82727A9717C8F2D100AD496B /* Bubble-5.png in Resources */, 275 | 82727A9817C8F2D100AD496B /* Bubble-5@2x.png in Resources */, 276 | 82727A9917C8F2D100AD496B /* Bubble-6.png in Resources */, 277 | 82727A9A17C8F2D100AD496B /* Bubble-6@2x.png in Resources */, 278 | 82727A9B17C8F2D100AD496B /* Bubble-7.png in Resources */, 279 | 82727A9C17C8F2D100AD496B /* Bubble-7@2x.png in Resources */, 280 | 82727A9D17C8F2D100AD496B /* Bubble-8.png in Resources */, 281 | 82727A9E17C8F2D100AD496B /* Bubble-8@2x.png in Resources */, 282 | 82727A9F17C8F2D100AD496B /* Bubble-9.png in Resources */, 283 | 82727AA017C8F2D100AD496B /* Bubble-9@2x.png in Resources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | /* End PBXResourcesBuildPhase section */ 288 | 289 | /* Begin PBXSourcesBuildPhase section */ 290 | 82727A4B17C8F16900AD496B /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | 82727A5F17C8F16900AD496B /* main.m in Sources */, 295 | 82727A6317C8F16900AD496B /* AppDelegate.m in Sources */, 296 | 82727A7217C8F1AC00AD496B /* STBubbleTableViewCell.m in Sources */, 297 | 82727AA917C8F3F200AD496B /* STBubbleTableViewCellDemoViewController.m in Sources */, 298 | 82727AAC17C8F40B00AD496B /* Message.m in Sources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | /* End PBXSourcesBuildPhase section */ 303 | 304 | /* Begin PBXVariantGroup section */ 305 | 82727A5B17C8F16900AD496B /* InfoPlist.strings */ = { 306 | isa = PBXVariantGroup; 307 | children = ( 308 | 82727A5C17C8F16900AD496B /* en */, 309 | ); 310 | name = InfoPlist.strings; 311 | sourceTree = ""; 312 | }; 313 | /* End PBXVariantGroup section */ 314 | 315 | /* Begin XCBuildConfiguration section */ 316 | 82727A6A17C8F16900AD496B /* Debug */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | ALWAYS_SEARCH_USER_PATHS = NO; 320 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 321 | CLANG_CXX_LIBRARY = "libc++"; 322 | CLANG_ENABLE_OBJC_ARC = YES; 323 | CLANG_WARN_CONSTANT_CONVERSION = YES; 324 | CLANG_WARN_EMPTY_BODY = YES; 325 | CLANG_WARN_ENUM_CONVERSION = YES; 326 | CLANG_WARN_INT_CONVERSION = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 329 | COPY_PHASE_STRIP = NO; 330 | GCC_C_LANGUAGE_STANDARD = gnu99; 331 | GCC_DYNAMIC_NO_PIC = NO; 332 | GCC_OPTIMIZATION_LEVEL = 0; 333 | GCC_PREPROCESSOR_DEFINITIONS = ( 334 | "DEBUG=1", 335 | "$(inherited)", 336 | ); 337 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 342 | ONLY_ACTIVE_ARCH = YES; 343 | SDKROOT = iphoneos; 344 | TARGETED_DEVICE_FAMILY = "1,2"; 345 | }; 346 | name = Debug; 347 | }; 348 | 82727A6B17C8F16900AD496B /* Release */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ALWAYS_SEARCH_USER_PATHS = NO; 352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 353 | CLANG_CXX_LIBRARY = "libc++"; 354 | CLANG_ENABLE_OBJC_ARC = YES; 355 | CLANG_WARN_CONSTANT_CONVERSION = YES; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 365 | GCC_WARN_UNUSED_VARIABLE = YES; 366 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 367 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 368 | SDKROOT = iphoneos; 369 | TARGETED_DEVICE_FAMILY = "1,2"; 370 | VALIDATE_PRODUCT = YES; 371 | }; 372 | name = Release; 373 | }; 374 | 82727A6D17C8F16900AD496B /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 378 | GCC_PREFIX_HEADER = "STBubbleTableViewCellDemo/STBubbleTableViewCellDemo-Prefix.pch"; 379 | INFOPLIST_FILE = "STBubbleTableViewCellDemo/STBubbleTableViewCellDemo-Info.plist"; 380 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | WRAPPER_EXTENSION = app; 383 | }; 384 | name = Debug; 385 | }; 386 | 82727A6E17C8F16900AD496B /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 390 | GCC_PREFIX_HEADER = "STBubbleTableViewCellDemo/STBubbleTableViewCellDemo-Prefix.pch"; 391 | INFOPLIST_FILE = "STBubbleTableViewCellDemo/STBubbleTableViewCellDemo-Info.plist"; 392 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 393 | PRODUCT_NAME = "$(TARGET_NAME)"; 394 | WRAPPER_EXTENSION = app; 395 | }; 396 | name = Release; 397 | }; 398 | /* End XCBuildConfiguration section */ 399 | 400 | /* Begin XCConfigurationList section */ 401 | 82727A4A17C8F16900AD496B /* Build configuration list for PBXProject "STBubbleTableViewCellDemo" */ = { 402 | isa = XCConfigurationList; 403 | buildConfigurations = ( 404 | 82727A6A17C8F16900AD496B /* Debug */, 405 | 82727A6B17C8F16900AD496B /* Release */, 406 | ); 407 | defaultConfigurationIsVisible = 0; 408 | defaultConfigurationName = Release; 409 | }; 410 | 82727A6C17C8F16900AD496B /* Build configuration list for PBXNativeTarget "STBubbleTableViewCellDemo" */ = { 411 | isa = XCConfigurationList; 412 | buildConfigurations = ( 413 | 82727A6D17C8F16900AD496B /* Debug */, 414 | 82727A6E17C8F16900AD496B /* Release */, 415 | ); 416 | defaultConfigurationIsVisible = 0; 417 | defaultConfigurationName = Release; 418 | }; 419 | /* End XCConfigurationList section */ 420 | }; 421 | rootObject = 82727A4717C8F16900AD496B /* Project object */; 422 | } 423 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | @property (nonatomic, strong) UINavigationController *navigationController; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "STBubbleTableViewCellDemoViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | 18 | STBubbleTableViewCellDemoViewController *demoViewController = [STBubbleTableViewCellDemoViewController new]; 19 | self.navigationController = [[UINavigationController alloc] initWithRootViewController:demoViewController]; 20 | self.window.rootViewController = self.navigationController; 21 | 22 | [self.window makeKeyAndVisible]; 23 | return YES; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Default-568h@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Default.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Default@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-0.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-0@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-0@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-1.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-1@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-2.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-2@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-3.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-3@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-4.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-4@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-5.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-5@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-6.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-6@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-7.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-7@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-8.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-8@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-8@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-9.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-9@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Images/Bubble-9@2x.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Message.h: -------------------------------------------------------------------------------- 1 | // 2 | // Message.h 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Message : NSObject 12 | 13 | + (instancetype)messageWithString:(NSString *)message; 14 | + (instancetype)messageWithString:(NSString *)message image:(UIImage *)image; 15 | 16 | - (instancetype)initWithString:(NSString *)message; 17 | - (instancetype)initWithString:(NSString *)message image:(UIImage *)image; 18 | 19 | @property (nonatomic, copy) NSString *message; 20 | @property (nonatomic, strong) UIImage *avatar; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/Message.m: -------------------------------------------------------------------------------- 1 | // 2 | // Message.m 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import "Message.h" 10 | 11 | @implementation Message 12 | 13 | + (instancetype)messageWithString:(NSString *)message 14 | { 15 | return [Message messageWithString:message image:nil]; 16 | } 17 | 18 | + (instancetype)messageWithString:(NSString *)message image:(UIImage *)image 19 | { 20 | return [[Message alloc] initWithString:message image:image]; 21 | } 22 | 23 | - (instancetype)initWithString:(NSString *)message 24 | { 25 | return [self initWithString:message image:nil]; 26 | } 27 | 28 | - (instancetype)initWithString:(NSString *)message image:(UIImage *)image 29 | { 30 | self = [super init]; 31 | if(self) 32 | { 33 | _message = message; 34 | _avatar = image; 35 | } 36 | return self; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/STBubbleTableViewCell/STBubbleTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // STBubbleTableViewCell.h 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol STBubbleTableViewCellDataSource, STBubbleTableViewCellDelegate; 12 | 13 | extern const CGFloat STBubbleWidthOffset; // Extra width added to bubble 14 | extern const CGFloat STBubbleImageSize; // The size of the image 15 | 16 | typedef NS_ENUM(NSUInteger, AuthorType) { 17 | STBubbleTableViewCellAuthorTypeSelf = 0, 18 | STBubbleTableViewCellAuthorTypeOther 19 | }; 20 | 21 | typedef NS_ENUM(NSUInteger, BubbleColor) { 22 | STBubbleTableViewCellBubbleColorGreen = 0, 23 | STBubbleTableViewCellBubbleColorGray = 1, 24 | STBubbleTableViewCellBubbleColorAqua = 2, // Default value of selectedBubbleColor 25 | STBubbleTableViewCellBubbleColorBrown = 3, 26 | STBubbleTableViewCellBubbleColorGraphite = 4, 27 | STBubbleTableViewCellBubbleColorOrange = 5, 28 | STBubbleTableViewCellBubbleColorPink = 6, 29 | STBubbleTableViewCellBubbleColorPurple = 7, 30 | STBubbleTableViewCellBubbleColorRed = 8, 31 | STBubbleTableViewCellBubbleColorYellow = 9 32 | }; 33 | 34 | @interface STBubbleTableViewCell : UITableViewCell 35 | 36 | @property (nonatomic, strong, readonly) UIImageView *bubbleView; 37 | @property (nonatomic, assign) AuthorType authorType; 38 | @property (nonatomic, assign) BubbleColor bubbleColor; 39 | @property (nonatomic, assign) BubbleColor selectedBubbleColor; 40 | @property (nonatomic, assign) BOOL canCopyContents; // Defaults to YES 41 | @property (nonatomic, assign) BOOL selectionAdjustsColor; // Defaults to YES 42 | @property (nonatomic, weak) id dataSource; 43 | @property (nonatomic, weak) id delegate; 44 | 45 | @end 46 | 47 | @protocol STBubbleTableViewCellDataSource 48 | @optional 49 | - (CGFloat)minInsetForCell:(STBubbleTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 50 | @end 51 | 52 | @protocol STBubbleTableViewCellDelegate 53 | @optional 54 | - (void)tappedImageOfCell:(STBubbleTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 55 | @end 56 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/STBubbleTableViewCell/STBubbleTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // STBubbleTableViewCell.m 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import "STBubbleTableViewCell.h" 10 | #import 11 | 12 | const CGFloat STBubbleWidthOffset = 30.0f; 13 | const CGFloat STBubbleImageSize = 50.0f; 14 | 15 | @implementation STBubbleTableViewCell 16 | 17 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 18 | { 19 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 20 | if (self) 21 | { 22 | self.selectionStyle = UITableViewCellSelectionStyleNone; 23 | self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 24 | 25 | _bubbleView = [[UIImageView alloc] initWithFrame:CGRectZero]; 26 | _bubbleView.userInteractionEnabled = YES; 27 | [self.contentView addSubview:_bubbleView]; 28 | 29 | self.textLabel.backgroundColor = [UIColor clearColor]; 30 | self.textLabel.numberOfLines = 0; 31 | self.textLabel.lineBreakMode = NSLineBreakByWordWrapping; 32 | self.textLabel.textColor = [UIColor blackColor]; 33 | self.textLabel.font = [UIFont systemFontOfSize:14.0]; 34 | 35 | self.imageView.userInteractionEnabled = YES; 36 | self.imageView.layer.cornerRadius = 5.0; 37 | self.imageView.layer.masksToBounds = YES; 38 | 39 | UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)]; 40 | [_bubbleView addGestureRecognizer:longPressRecognizer]; 41 | 42 | UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)]; 43 | [self.imageView addGestureRecognizer:tapRecognizer]; 44 | 45 | // Defaults 46 | _selectedBubbleColor = STBubbleTableViewCellBubbleColorAqua; 47 | _canCopyContents = YES; 48 | _selectionAdjustsColor = YES; 49 | } 50 | 51 | return self; 52 | } 53 | 54 | - (void)updateFramesForAuthorType:(AuthorType)type 55 | { 56 | [self setImageForBubbleColor:self.bubbleColor]; 57 | 58 | CGFloat minInset = 0.0f; 59 | if([self.dataSource respondsToSelector:@selector(minInsetForCell:atIndexPath:)]) 60 | { 61 | minInset = [self.dataSource minInsetForCell:self atIndexPath:[[self tableView] indexPathForCell:self]]; 62 | } 63 | 64 | CGSize size; 65 | if(self.imageView.image) 66 | { 67 | size = [self.textLabel.text boundingRectWithSize:CGSizeMake(self.frame.size.width - minInset - STBubbleWidthOffset - STBubbleImageSize - 8.0f, CGFLOAT_MAX) 68 | options:NSStringDrawingUsesLineFragmentOrigin 69 | attributes:@{NSFontAttributeName:self.textLabel.font} 70 | context:nil].size; 71 | } 72 | else 73 | { 74 | size = [self.textLabel.text boundingRectWithSize:CGSizeMake(self.frame.size.width - minInset - STBubbleWidthOffset, CGFLOAT_MAX) 75 | options:NSStringDrawingUsesLineFragmentOrigin 76 | attributes:@{NSFontAttributeName:self.textLabel.font} 77 | context:nil].size; 78 | } 79 | 80 | // You can always play with these values if you need to 81 | if(type == STBubbleTableViewCellAuthorTypeSelf) 82 | { 83 | if(self.imageView.image) 84 | { 85 | self.bubbleView.frame = CGRectMake(self.frame.size.width - (size.width + STBubbleWidthOffset) - STBubbleImageSize - 8.0f, self.frame.size.height - (size.height + 15.0f), size.width + STBubbleWidthOffset, size.height + 15.0f); 86 | self.imageView.frame = CGRectMake(self.frame.size.width - STBubbleImageSize - 5.0f, self.frame.size.height - STBubbleImageSize - 2.0f, STBubbleImageSize, STBubbleImageSize); 87 | self.textLabel.frame = CGRectMake(self.frame.size.width - (size.width + STBubbleWidthOffset - 10.0f) - STBubbleImageSize - 8.0f, self.frame.size.height - (size.height + 15.0f) + 6.0f, size.width + STBubbleWidthOffset - 23.0f, size.height); 88 | } 89 | else 90 | { 91 | self.bubbleView.frame = CGRectMake(self.frame.size.width - (size.width + STBubbleWidthOffset), 0.0f, size.width + STBubbleWidthOffset, size.height + 15.0f); 92 | self.imageView.frame = CGRectZero; 93 | self.textLabel.frame = CGRectMake(self.frame.size.width - (size.width + STBubbleWidthOffset - 10.0f), 6.0f, size.width + STBubbleWidthOffset - 23.0f, size.height); 94 | } 95 | 96 | self.textLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; 97 | self.bubbleView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin; 98 | self.bubbleView.transform = CGAffineTransformIdentity; 99 | } 100 | else 101 | { 102 | if(self.imageView.image) 103 | { 104 | self.bubbleView.frame = CGRectMake(STBubbleImageSize + 8.0f, self.frame.size.height - (size.height + 15.0f), size.width + STBubbleWidthOffset, size.height + 15.0f); 105 | self.imageView.frame = CGRectMake(5.0, self.frame.size.height - STBubbleImageSize - 2.0f, STBubbleImageSize, STBubbleImageSize); 106 | self.textLabel.frame = CGRectMake(STBubbleImageSize + 8.0f + 16.0f, self.frame.size.height - (size.height + 15.0f) + 6.0f, size.width + STBubbleWidthOffset - 23.0f, size.height); 107 | } 108 | else 109 | { 110 | self.bubbleView.frame = CGRectMake(0.0f, 0.0f, size.width + STBubbleWidthOffset, size.height + 15.0f); 111 | self.imageView.frame = CGRectZero; 112 | self.textLabel.frame = CGRectMake(16.0f, 6.0f, size.width + STBubbleWidthOffset - 23.0f, size.height); 113 | } 114 | 115 | self.textLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; 116 | self.bubbleView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin; 117 | self.bubbleView.transform = CGAffineTransformIdentity; 118 | self.bubbleView.transform = CGAffineTransformMakeScale(-1.0f, 1.0f); 119 | } 120 | } 121 | 122 | - (void)setImageForBubbleColor:(BubbleColor)color 123 | { 124 | self.bubbleView.image = [[UIImage imageNamed:[NSString stringWithFormat:@"Bubble-%lu.png", (long)color]] resizableImageWithCapInsets:UIEdgeInsetsMake(12.0f, 15.0f, 16.0f, 18.0f)]; 125 | } 126 | 127 | - (void)layoutSubviews 128 | { 129 | [self updateFramesForAuthorType:self.authorType]; 130 | } 131 | 132 | - (UITableView *)tableView 133 | { 134 | UIView *tableView = self.superview; 135 | 136 | while(tableView) 137 | { 138 | if([tableView isKindOfClass:[UITableView class]]) 139 | { 140 | return (UITableView *)tableView; 141 | } 142 | 143 | tableView = tableView.superview; 144 | } 145 | 146 | return nil; 147 | } 148 | 149 | #pragma mark - Setters 150 | 151 | - (void)setAuthorType:(AuthorType)type 152 | { 153 | _authorType = type; 154 | [self updateFramesForAuthorType:_authorType]; 155 | } 156 | 157 | - (void)setBubbleColor:(BubbleColor)color 158 | { 159 | _bubbleColor = color; 160 | [self setImageForBubbleColor:_bubbleColor]; 161 | } 162 | 163 | #pragma mark - UIGestureRecognizer methods 164 | 165 | - (void)longPress:(UILongPressGestureRecognizer *)gestureRecognizer 166 | { 167 | if(gestureRecognizer.state == UIGestureRecognizerStateBegan) 168 | { 169 | if(self.canCopyContents) 170 | { 171 | UIMenuController *menuController = [UIMenuController sharedMenuController]; 172 | [self becomeFirstResponder]; 173 | [menuController setTargetRect:self.bubbleView.frame inView:self]; 174 | [menuController setMenuVisible:YES animated:YES]; 175 | 176 | if(self.selectionAdjustsColor) 177 | { 178 | [self setImageForBubbleColor:self.selectedBubbleColor]; 179 | } 180 | 181 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willHideMenuController:) name:UIMenuControllerWillHideMenuNotification object:nil]; 182 | } 183 | } 184 | } 185 | 186 | - (void)tap:(UITapGestureRecognizer *)gestureRecognizer 187 | { 188 | if([self.delegate respondsToSelector:@selector(tappedImageOfCell:atIndexPath:)]) 189 | { 190 | [self.delegate tappedImageOfCell:self atIndexPath:[[self tableView] indexPathForCell:self]]; 191 | } 192 | } 193 | 194 | #pragma mark - UIMenuController methods 195 | 196 | - (BOOL)canPerformAction:(SEL)selector withSender:(id)sender 197 | { 198 | if(selector == @selector(copy:)) 199 | { 200 | return YES; 201 | } 202 | 203 | return NO; 204 | } 205 | 206 | - (BOOL)canBecomeFirstResponder 207 | { 208 | return YES; 209 | } 210 | 211 | - (void)copy:(id)sender 212 | { 213 | [[UIPasteboard generalPasteboard] setString:self.textLabel.text]; 214 | } 215 | 216 | - (void)willHideMenuController:(NSNotification *)notification 217 | { 218 | [self setImageForBubbleColor:self.bubbleColor]; 219 | [[NSNotificationCenter defaultCenter] removeObserver:self name:UIMenuControllerWillHideMenuNotification object:nil]; 220 | } 221 | 222 | @end 223 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.FreshCreations.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'STBubbleTableViewCellDemo' target in the 'STBubbleTableViewCellDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/STBubbleTableViewCellDemoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // STBubbleTableViewCellDemoViewController.h 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface STBubbleTableViewCellDemoViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/STBubbleTableViewCellDemoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // STBubbleTableViewCellDemoViewController.m 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import "STBubbleTableViewCellDemoViewController.h" 10 | #import "STBubbleTableViewCell.h" 11 | #import "Message.h" 12 | 13 | @interface STBubbleTableViewCellDemoViewController () 14 | @property (nonatomic, strong) NSMutableArray *messages; 15 | @end 16 | 17 | @implementation STBubbleTableViewCellDemoViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | 23 | self.title = @"Messages"; 24 | 25 | self.messages = [[NSMutableArray alloc] initWithObjects: 26 | [Message messageWithString:@"How is that bubble component of yours coming along?" image:[UIImage imageNamed:@"jonnotie.png"]], 27 | [Message messageWithString:@"Great, I just finished avatar support." image:[UIImage imageNamed:@"SkyTrix.png"]], 28 | [Message messageWithString:@"That is awesome! I hope people will like that addition." image:[UIImage imageNamed:@"jonnotie.png"]], 29 | [Message messageWithString:@"Now you see me.." image:[UIImage imageNamed:@"SkyTrix.png"]], 30 | [Message messageWithString:@"And now you don't. :)"], 31 | nil]; 32 | 33 | self.tableView.backgroundColor = [UIColor colorWithRed:219.0f/255.0f green:226.0f/255.0f blue:237.0f/255.0f alpha:1.0f]; 34 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 35 | 36 | // Some decoration 37 | CGSize screenSize = [[UIScreen mainScreen] applicationFrame].size; 38 | UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, screenSize.width, 55.0f)]; 39 | 40 | UIButton *callButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 41 | callButton.frame = CGRectMake(10.0f, 10.0f, (screenSize.width / 2.0f) - 10.0f, 35.0f); 42 | callButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin; 43 | [callButton setTitle:@"Call" forState:UIControlStateNormal]; 44 | 45 | UIButton *contactButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 46 | contactButton.frame = CGRectMake((screenSize.width / 2.0f) + 10.0f, 10.0f, (screenSize.width / 2.0f) - 20.0f, 35.0f); 47 | contactButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin; 48 | [contactButton setTitle:@"Contact Info" forState:UIControlStateNormal]; 49 | 50 | [headerView addSubview:callButton]; 51 | [headerView addSubview:contactButton]; 52 | 53 | self.tableView.tableHeaderView = headerView; 54 | } 55 | 56 | #pragma mark - UITableViewDatasource methods 57 | 58 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 59 | { 60 | return 1; 61 | } 62 | 63 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 64 | { 65 | return [self.messages count]; 66 | } 67 | 68 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 69 | { 70 | static NSString *CellIdentifier = @"Bubble Cell"; 71 | 72 | STBubbleTableViewCell *cell = (STBubbleTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 73 | if (cell == nil) 74 | { 75 | cell = [[STBubbleTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 76 | cell.backgroundColor = self.tableView.backgroundColor; 77 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 78 | 79 | cell.dataSource = self; 80 | cell.delegate = self; 81 | } 82 | 83 | Message *message = [self.messages objectAtIndex:indexPath.row]; 84 | 85 | cell.textLabel.font = [UIFont systemFontOfSize:14.0f]; 86 | cell.textLabel.text = message.message; 87 | cell.imageView.image = message.avatar; 88 | 89 | // Put your own logic here to determine the author 90 | if(indexPath.row % 2 != 0 || indexPath.row == 4) 91 | { 92 | cell.authorType = STBubbleTableViewCellAuthorTypeSelf; 93 | cell.bubbleColor = STBubbleTableViewCellBubbleColorGreen; 94 | } 95 | else 96 | { 97 | cell.authorType = STBubbleTableViewCellAuthorTypeOther; 98 | cell.bubbleColor = STBubbleTableViewCellBubbleColorGray; 99 | } 100 | 101 | return cell; 102 | } 103 | 104 | #pragma mark - UITableViewDelegate methods 105 | 106 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 107 | { 108 | Message *message = [self.messages objectAtIndex:indexPath.row]; 109 | 110 | CGSize size; 111 | 112 | if(message.avatar) 113 | { 114 | size = [message.message boundingRectWithSize:CGSizeMake(self.tableView.frame.size.width - [self minInsetForCell:nil atIndexPath:indexPath] - STBubbleImageSize - 8.0f - STBubbleWidthOffset, CGFLOAT_MAX) 115 | options:NSStringDrawingUsesLineFragmentOrigin 116 | attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} 117 | context:nil].size; 118 | } 119 | else 120 | { 121 | size = [message.message boundingRectWithSize:CGSizeMake(self.tableView.frame.size.width - [self minInsetForCell:nil atIndexPath:indexPath] - STBubbleWidthOffset, CGFLOAT_MAX) 122 | options:NSStringDrawingUsesLineFragmentOrigin 123 | attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} 124 | context:nil].size; 125 | } 126 | 127 | // This makes sure the cell is big enough to hold the avatar 128 | if(size.height + 15.0f < STBubbleImageSize + 4.0f && message.avatar) 129 | { 130 | return STBubbleImageSize + 4.0f; 131 | } 132 | 133 | return size.height + 15.0f; 134 | } 135 | 136 | #pragma mark - STBubbleTableViewCellDataSource methods 137 | 138 | - (CGFloat)minInsetForCell:(STBubbleTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath 139 | { 140 | if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) 141 | { 142 | return 100.0f; 143 | } 144 | 145 | return 50.0f; 146 | } 147 | 148 | #pragma mark - STBubbleTableViewCellDelegate methods 149 | 150 | - (void)tappedImageOfCell:(STBubbleTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath 151 | { 152 | Message *message = [self.messages objectAtIndex:indexPath.row]; 153 | NSLog(@"%@", message.message); 154 | } 155 | 156 | #pragma mark - 157 | 158 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 159 | { 160 | return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown; 161 | } 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/SkyTrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/SkyTrix.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/jonnotie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/jonnotie.png -------------------------------------------------------------------------------- /STBubbleTableViewCellDemo/STBubbleTableViewCellDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // STBubbleTableViewCellDemo 4 | // 5 | // Created by Cedric Vandendriessche on 24/08/13. 6 | // Copyright 2013 FreshCreations. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyTrix/STBubbleTableViewCell/556ae3200976b9f062bc79de52bcbd893764740c/screenshot.png --------------------------------------------------------------------------------