├── .gitignore ├── .travis.yml ├── AAActivityAction.podspec ├── AAActivityAction ├── AAActivity.h ├── AAActivity.m ├── AAActivityAction.h ├── AAActivityAction.m ├── AAPanelView.h └── AAPanelView.m ├── AAActivityActionDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── AAActivityActionDemo.xccheckout │ │ ├── AAActivityActionDemo.xcscmblueprint │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── hyde.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── hyde.xcuserdatad │ └── xcschemes │ ├── AAActivityActionDemo.xcscheme │ └── xcschememanagement.plist ├── AAActivityActionDemo ├── AAActivityActionDemo-Info.plist ├── AAActivityActionDemo-Prefix.pch ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── ViewController.xib ├── Default-568h@2x.png ├── Default.png ├── Default@2x.png ├── LaunchScreen.xib ├── Safari-Small@2x.png ├── Safari@2x~ipad.png ├── Safari@2x~iphone.png ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── LICENSE.txt ├── Makefile ├── README.md └── images ├── reeder3.png └── sample.png /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build/ 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | script: 4 | - make clean test 5 | -------------------------------------------------------------------------------- /AAActivityAction.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "AAActivityAction" 3 | s.version = "1.0.3" 4 | s.summary = "Reeder like action sheet." 5 | s.homepage = "https://github.com/r-plus/AAActivityAction/" 6 | s.license = 'MIT' 7 | s.author = { "r-plus" => "anasthasia.r@gmail.com" } 8 | s.source = { :git => "https://github.com/r-plus/AAActivityAction.git", :tag => s.version.to_s } 9 | s.platform = :ios, '5.0' 10 | s.source_files = 'AAActivityAction/*.{h,m}' 11 | s.requires_arc = true 12 | s.framework = 'QuartzCore' 13 | end 14 | -------------------------------------------------------------------------------- /AAActivityAction/AAActivity.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAActivity.h 3 | // 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Copyright (c) 2013 r-plus. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import 28 | 29 | @interface AAActivity : NSObject 30 | 31 | typedef void (^AAActionBlock)(AAActivity *activity, NSArray *avtivityItems); 32 | 33 | @property (readonly, nonatomic) NSString *title; 34 | @property (readonly, nonatomic) UIImage *image; 35 | @property (strong, nonatomic) id userInfo; 36 | @property (copy, nonatomic) AAActionBlock actionBlock; 37 | 38 | - (id)initWithTitle:(NSString *)title image:(UIImage *)image actionBlock:(AAActionBlock)actionBlock; 39 | - (BOOL)canPerformWithActivityItems:(NSArray *)activityItems; 40 | @end 41 | -------------------------------------------------------------------------------- /AAActivityAction/AAActivity.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAActivity.m 3 | // 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Copyright (c) 2013 r-plus. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "AAActivity.h" 27 | 28 | @implementation AAActivity 29 | 30 | - (id)initWithTitle:(NSString *)title image:(UIImage *)image actionBlock:(AAActionBlock)actionBlock 31 | { 32 | self = [super init]; 33 | if (self) { 34 | _title = [title copy]; 35 | _image = [image copy]; 36 | _actionBlock = [actionBlock copy]; 37 | } 38 | return self; 39 | } 40 | 41 | - (BOOL)canPerformWithActivityItems:(NSArray *)activityItems 42 | { 43 | return YES; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /AAActivityAction/AAActivityAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAActivityAction.h 3 | // 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Copyright (c) 2013 r-plus. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import "AAPanelView.h" 28 | 29 | typedef enum AAImageSize : NSUInteger { 30 | AAImageSizeSmall = 29, 31 | AAImageSizeNormal = 59, 32 | AAImageSizeiPad = 74 33 | } AAImageSize; 34 | 35 | @interface AAActivityAction : UIView 36 | @property (nonatomic, strong) NSString *title; 37 | @property (nonatomic, readonly) BOOL isShowing; 38 | @property (nonatomic, getter=isDirectActionEnabled) BOOL directActionEnabled; // If available only one activity, directly invoke its activity action. default is NO. 39 | 40 | - (id)initWithActivityItems:(NSArray *)activityItems applicationActivities:(NSArray *)applicationActivities imageSize:(AAImageSize)imageSize; 41 | // Attempt automatically use top of hierarchy view. 42 | - (void)show; 43 | - (void)showInView:(UIView *)view; 44 | - (void)dismissActionSheet; 45 | @end 46 | -------------------------------------------------------------------------------- /AAActivityAction/AAActivityAction.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAActivityAction.m 3 | // 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Copyright (c) 2013 r-plus. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "AAActivityAction.h" 27 | #import "AAActivity.h" 28 | #import 29 | #import 30 | 31 | @interface AAActivityAction() 32 | @property (nonatomic, readonly) CGFloat activityWidth; 33 | @property (nonatomic, readonly) CGFloat rowHeight; 34 | @property (nonatomic, readonly) NSUInteger numberOfActivitiesInRow; 35 | @end 36 | 37 | @implementation AAActivityAction 38 | { 39 | NSArray *_activityItems; 40 | NSArray *_activities; 41 | AAImageSize _imageSize; 42 | AAPanelView *_panelView; 43 | UIScrollView *_scrollView; 44 | UIPageControl *_pageControl; 45 | } 46 | 47 | static CGFloat const kTitleHeight = 45.0f; 48 | static CGFloat const kPanelViewBottomMargin = 5.0f; 49 | static CGFloat const kPanelViewSideMargin = 5.0f; 50 | static CGFloat const kPageDotHeight = 20.0f; 51 | 52 | #pragma mark InternalGetter 53 | 54 | - (CGFloat)activityWidth 55 | { 56 | // iPhone : 29:60 57 | // : 59:90 58 | // iPad : 74:105 59 | return _imageSize + 1.0f + 30.0f; 60 | } 61 | 62 | - (CGFloat)rowHeight 63 | { 64 | // iPhone : 70 65 | // : 100 66 | // iPad : 115 67 | return self.activityWidth + 10.0f; 68 | } 69 | 70 | - (NSUInteger)numberOfActivitiesInRow 71 | { 72 | // FIXME: more easy. 73 | if (_panelView) 74 | return (_panelView.frame.size.width - 2 * kPanelViewSideMargin) / self.activityWidth; 75 | BOOL isLandscape = NO; 76 | if (@available(iOS 13.0, *)) { 77 | for (UIScene *scene in [UIApplication sharedApplication].connectedScenes) { 78 | if ([scene isKindOfClass:[UIWindowScene class]] && scene.activationState == UISceneActivationStateForegroundActive) { 79 | isLandscape = UIInterfaceOrientationIsLandscape(((UIWindowScene *)scene).interfaceOrientation); 80 | break; 81 | } 82 | } 83 | } else { 84 | isLandscape = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation); 85 | } 86 | return ((isLandscape ? self.bounds.size.height - self.safeAreaInsets.bottom : self.bounds.size.width - self.safeAreaInsets.left - self.safeAreaInsets.right) - 2 * kPanelViewSideMargin) / self.activityWidth; 87 | } 88 | 89 | - (NSUInteger)numberOfRowFromCount:(NSUInteger)count 90 | { 91 | NSUInteger rowsCount = (NSUInteger)(count / self.numberOfActivitiesInRow); 92 | rowsCount += (count % self.numberOfActivitiesInRow > 0) ? 1 : 0; 93 | return rowsCount; 94 | } 95 | 96 | #pragma mark Initialization 97 | 98 | - (id)initWithActivityItems:(NSArray *)activityItems applicationActivities:(NSArray *)applicationActivities imageSize:(AAImageSize)imageSize 99 | { 100 | self = [super initWithFrame:[UIScreen mainScreen].bounds]; 101 | if (self) { 102 | _directActionEnabled = NO; 103 | 104 | // Forced resize to iPad size on iPad. 105 | _imageSize = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad ? AAImageSizeiPad : imageSize; 106 | 107 | // check supported activitiy 108 | NSMutableArray *array = [NSMutableArray array]; 109 | for (AAActivity *activity in applicationActivities) 110 | if ([activity canPerformWithActivityItems:activityItems]) 111 | [array addObject:activity]; 112 | _activities = array; 113 | 114 | _activityItems = activityItems; 115 | self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); 116 | [self setAutoresizesSubviews:YES]; 117 | 118 | UIControl *baseView = [[UIControl alloc] initWithFrame:self.frame]; 119 | baseView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3]; 120 | [baseView addTarget:self action:@selector(dismissActionSheet) forControlEvents:UIControlEventTouchUpInside]; 121 | 122 | baseView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); 123 | [self addSubview:baseView]; 124 | 125 | NSUInteger rowsCount = [self numberOfRowFromCount:[_activities count]]; 126 | CGFloat height = self.rowHeight * rowsCount + kTitleHeight; 127 | CGRect baseRect = CGRectMake(0, baseView.frame.size.height - height - kPanelViewBottomMargin, baseView.frame.size.width, height); 128 | _panelView = [[AAPanelView alloc] initWithFrame:baseRect]; 129 | _panelView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin); 130 | _panelView.transform = CGAffineTransformMakeScale(1.0, 0.1); 131 | 132 | CGRect scrollViewRect = CGRectInset(_panelView.bounds, 10, 5); 133 | scrollViewRect.size.height -= kTitleHeight - kPageDotHeight; 134 | _scrollView = [[UIScrollView alloc] initWithFrame:scrollViewRect]; 135 | _scrollView.delegate = self; 136 | _scrollView.pagingEnabled = YES; 137 | _scrollView.showsVerticalScrollIndicator = NO; 138 | _scrollView.showsHorizontalScrollIndicator = NO; 139 | _scrollView.backgroundColor = [UIColor clearColor]; 140 | _scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 141 | _scrollView.contentSize = _panelView.bounds.size; 142 | [_panelView addSubview:_scrollView]; 143 | 144 | CGRect pageRect = scrollViewRect; 145 | _pageControl = [[UIPageControl alloc] initWithFrame:pageRect]; 146 | _pageControl.numberOfPages = 1; 147 | [_pageControl addTarget:self action:@selector(pageControlValueChanged:) forControlEvents:UIControlEventValueChanged]; 148 | [_panelView addSubview:_pageControl]; 149 | 150 | [baseView addSubview:_panelView]; 151 | [UIView animateWithDuration:0.1 animations:^ { 152 | self->_panelView.transform = CGAffineTransformIdentity; 153 | }]; 154 | 155 | [self addActivities:_activities]; 156 | } 157 | return self; 158 | } 159 | 160 | - (void)addActivities:(NSArray *)activities 161 | { 162 | CGFloat x = 0; 163 | CGFloat y = 0; 164 | NSUInteger count = 0; 165 | CGFloat activityWidth = self.activityWidth; 166 | 167 | for (AAActivity *activity in activities) { 168 | count++; 169 | // icon layout by -[self layoutSubviews]; 170 | 171 | UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, activityWidth, activityWidth)]; 172 | //button.backgroundColor = [UIColor greenColor]; 173 | button.tag = count - 1; 174 | [button addTarget:self action:@selector(invokeActivity:) forControlEvents:UIControlEventTouchUpInside]; 175 | [button setImage:activity.image forState:UIControlStateNormal]; 176 | CGFloat sideWidth = activityWidth - activity.image.size.height; 177 | CGFloat leftInset = roundf(sideWidth / 2.0f); 178 | button.accessibilityLabel = activity.title; 179 | // UIButtonConfiguration have not `showsTouchWhenHighlighted` replacement. 180 | button.imageEdgeInsets = UIEdgeInsetsMake(0, leftInset, sideWidth, sideWidth - leftInset); 181 | button.showsTouchWhenHighlighted = _imageSize == AAImageSizeSmall ? YES : NO; 182 | 183 | UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, activity.image.size.height + 2.0f, activityWidth, 10.0f)]; 184 | label.textAlignment = NSTextAlignmentCenter; 185 | label.backgroundColor = [UIColor clearColor]; 186 | //label.backgroundColor = [UIColor redColor]; 187 | label.textColor = [UIColor whiteColor]; 188 | label.shadowColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.75]; 189 | label.shadowOffset = CGSizeMake(0, 1); 190 | label.text = activity.title; 191 | CGFloat fontSize = 11.0f; 192 | if (_imageSize == AAImageSizeNormal) 193 | fontSize = 12.0f; 194 | else if (_imageSize == AAImageSizeiPad) 195 | fontSize = 15.0f; 196 | label.font = [UIFont systemFontOfSize:fontSize]; 197 | label.numberOfLines = 0; 198 | [label sizeToFit]; 199 | CGRect frame = label.frame; 200 | frame.origin.x = roundf((button.frame.size.width - frame.size.width) / 2.0f); 201 | label.frame = frame; 202 | [button addSubview:label]; 203 | 204 | [_scrollView addSubview:button]; 205 | } 206 | } 207 | 208 | #pragma mark Action 209 | 210 | - (void)invokeActivity:(UIButton *)button 211 | { 212 | AAActivity *activity = [_activities objectAtIndex:button.tag]; 213 | if (activity.actionBlock) 214 | activity.actionBlock(activity, _activityItems); 215 | [self dismissActionSheet]; 216 | } 217 | 218 | #pragma mark Layout 219 | 220 | - (void)layoutSubviews 221 | { 222 | [super layoutSubviews]; 223 | [self updatePanelViewWidth]; 224 | [self layoutActivities]; 225 | [_panelView setNeedsDisplay]; 226 | } 227 | 228 | - (void)updatePanelViewWidth 229 | { 230 | // Firstly update panelView width for correctly calculate `numberOfRowFromCount`. 231 | CGRect f = _panelView.frame; 232 | f.size.width = _panelView.superview.frame.size.width - self.safeAreaInsets.left - self.safeAreaInsets.right; 233 | _panelView.frame = f; 234 | } 235 | 236 | - (void)layoutActivities 237 | { 238 | //// re-layouting panelView. 239 | NSUInteger rowsCount = [self numberOfRowFromCount:[_activities count]]; 240 | CGFloat height = self.rowHeight * rowsCount + kTitleHeight; 241 | while (height >= _panelView.superview.bounds.size.height - 40.0f - self.safeAreaInsets.bottom - self.safeAreaInsets.top) { 242 | rowsCount--; 243 | height = self.rowHeight * rowsCount + kTitleHeight; 244 | } 245 | CGRect panelFrame = CGRectMake( 246 | self.safeAreaInsets.left, 247 | _panelView.superview.frame.size.height - height - kPanelViewBottomMargin - self.safeAreaInsets.bottom, 248 | _panelView.frame.size.width, // width is already updated. 249 | height 250 | ); 251 | _panelView.frame = panelFrame; 252 | _pageControl.frame = CGRectMake(0, _panelView.frame.size.height - kPanelViewBottomMargin - kTitleHeight, _panelView.frame.size.width, kPageDotHeight); 253 | 254 | //// re-layouting activities. 255 | CGFloat x = 0; 256 | CGFloat y = 0; 257 | NSUInteger count = 0; 258 | NSUInteger page = 0; 259 | NSUInteger numberOfActivitiesInPage = rowsCount * [self numberOfActivitiesInRow]; 260 | CGFloat activityWidth = self.activityWidth; 261 | CGFloat spaceWidth = (_scrollView.frame.size.width - (activityWidth * self.numberOfActivitiesInRow) - (2 * kPanelViewSideMargin)) / (self.numberOfActivitiesInRow - 1); 262 | for (UIButton *button in _scrollView.subviews) { 263 | count++; 264 | // FIXME: more clean and easy readable code. 265 | x = page * _scrollView.frame.size.width + kPanelViewSideMargin + (activityWidth + spaceWidth) * (CGFloat)(count % self.numberOfActivitiesInRow == 0 ? self.numberOfActivitiesInRow - 1 : count % self.numberOfActivitiesInRow - 1); 266 | y = 15.0f + self.rowHeight * ([self numberOfRowFromCount:count - page * numberOfActivitiesInPage] - 1); 267 | 268 | button.frame = CGRectMake(x, y, activityWidth, activityWidth); 269 | 270 | if (count % numberOfActivitiesInPage == 0 && count != [[_scrollView subviews] count]) { 271 | page++; 272 | } 273 | } 274 | 275 | _scrollView.contentSize = CGSizeMake((page + 1) * _scrollView.frame.size.width, _scrollView.frame.size.height); 276 | _pageControl.numberOfPages = page + 1; 277 | if (_pageControl.numberOfPages <= 1) { 278 | _pageControl.hidden = YES; 279 | _scrollView.scrollEnabled = NO; 280 | } else { 281 | _pageControl.hidden = NO; 282 | _scrollView.scrollEnabled = YES; 283 | } 284 | [self pageControlValueChanged:_pageControl]; 285 | } 286 | 287 | #pragma mark Appearence 288 | 289 | - (void)show 290 | { 291 | // for keyboard overlay. 292 | // But not perfect fix for all case. 293 | UIWindow *keyboardWindow = nil; 294 | for (UIWindow *testWindow in [UIApplication sharedApplication].windows) { 295 | if ([[testWindow class] isEqual:NSClassFromString(@"UIRemoteKeyboardWindow")]) { 296 | // since iOS 9. 297 | keyboardWindow = testWindow; 298 | break; 299 | } else if (![[testWindow class] isEqual:[UIWindow class]]) { 300 | keyboardWindow = testWindow; 301 | } 302 | } 303 | 304 | UIView *topView = [[UIApplication sharedApplication].keyWindow.subviews objectAtIndex:0]; 305 | 306 | [self showInView:keyboardWindow ? : topView]; 307 | } 308 | 309 | - (void)showInView:(UIView *)view 310 | { 311 | if (self.isDirectActionEnabled && _activities.count == 1) { 312 | UIButton *button = [[UIButton alloc] init]; 313 | button.tag = 0; 314 | [self invokeActivity:button]; 315 | return; 316 | } 317 | _panelView.title = [self.title stringByReplacingOccurrencesOfString:@"\n" withString:@" "]; 318 | _panelView.delegate = self; 319 | self.frame = view.bounds; 320 | [view addSubview:self]; 321 | _isShowing = YES; 322 | } 323 | 324 | - (void)dismissActionSheet 325 | { 326 | if (self.isShowing) { 327 | [UIView animateWithDuration:0.1 animations:^ { 328 | self->_panelView.transform = CGAffineTransformMakeScale(1.0, 0.2); 329 | } completion:^ (BOOL finished){ 330 | [self removeFromSuperview]; 331 | }]; 332 | _isShowing = NO; 333 | } 334 | } 335 | 336 | // REActivityView.h 337 | // REActivityViewController 338 | // 339 | // Copyright (c) 2013 Roman Efimov (https://github.com/romaonthego) 340 | // 341 | // Permission is hereby granted, free of charge, to any person obtaining a copy 342 | // of this software and associated documentation files (the "Software"), to deal 343 | // in the Software without restriction, including without limitation the rights 344 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 345 | // copies of the Software, and to permit persons to whom the Software is 346 | // furnished to do so, subject to the following conditions: 347 | // 348 | // The above copyright notice and this permission notice shall be included in 349 | // all copies or substantial portions of the Software. 350 | // 351 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 352 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 353 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 354 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 355 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 356 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 357 | // THE SOFTWARE. 358 | 359 | #pragma mark UIScrollViewDelegate 360 | 361 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView 362 | { 363 | _pageControl.currentPage = scrollView.contentOffset.x / scrollView.frame.size.width; 364 | } 365 | 366 | #pragma mark - 367 | 368 | - (void)pageControlValueChanged:(UIPageControl *)pageControl 369 | { 370 | CGFloat pageWidth = _scrollView.contentSize.width /_pageControl.numberOfPages; 371 | CGFloat x = _pageControl.currentPage * pageWidth; 372 | [_scrollView scrollRectToVisible:CGRectMake(x, 0, pageWidth, _scrollView.frame.size.height) animated:YES]; 373 | } 374 | 375 | @end 376 | -------------------------------------------------------------------------------- /AAActivityAction/AAPanelView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAPanelView.h 3 | // 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Copyright (c) 2013 r-plus. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface AAPanelView : UIView 29 | @property (strong, nonatomic) NSString *title; 30 | @property (weak, nonatomic) id delegate; 31 | @end 32 | -------------------------------------------------------------------------------- /AAActivityAction/AAPanelView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAPanelView.m 3 | // 4 | // This code is distributed under the terms and conditions of the MIT license. 5 | // 6 | // Copyright (c) 2013 r-plus. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "AAPanelView.h" 27 | #import "AAActivityAction.h" 28 | 29 | @implementation AAPanelView 30 | 31 | - (id)initWithFrame:(CGRect)frame 32 | { 33 | self = [super initWithFrame:frame]; 34 | if (self) { 35 | self.backgroundColor = [UIColor clearColor]; 36 | } 37 | return self; 38 | } 39 | 40 | // Many code import from SAResizibleBubble.m 41 | // https://github.com/andrei200287/SAVideoRangeSlider/blob/master/SAVideoRangeSlider/SAResizibleBubble.m 42 | // 43 | // SAResizibleBubble.m 44 | // 45 | // Copyright (c) 2013 Andrei Solovjev - http://solovjev.com/ 46 | // 47 | // Permission is hereby granted, free of charge, to any person obtaining a copy 48 | // of this software and associated documentation files (the "Software"), to deal 49 | // in the Software without restriction, including without limitation the rights 50 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 51 | // copies of the Software, and to permit persons to whom the Software is 52 | // furnished to do so, subject to the following conditions: 53 | // 54 | // The above copyright notice and this permission notice shall be included in 55 | // all copies or substantial portions of the Software. 56 | // 57 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 58 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 59 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 60 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 61 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 62 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 63 | // THE SOFTWARE. 64 | 65 | - (void)drawRect:(CGRect)rect 66 | { 67 | //// General Declarations 68 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 69 | CGContextRef context = UIGraphicsGetCurrentContext(); 70 | 71 | //// Color Declarations 72 | UIColor *gradientTop = [UIColor colorWithWhite:0.25 alpha:0.8]; 73 | UIColor *gradientBottom = [UIColor colorWithWhite:0.0 alpha:0.9]; 74 | UIColor *highlightColor = [UIColor colorWithWhite:0.9 alpha:0.7]; 75 | UIColor *strokeColor = [UIColor blackColor]; 76 | 77 | //// Gradient Declarations 78 | NSArray *gradientColors = [NSArray arrayWithObjects: 79 | (id)gradientTop.CGColor, 80 | (id)gradientBottom.CGColor, nil]; 81 | CGFloat gradientLocations[] = {0, 1}; 82 | CGGradientRef lineGradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)gradientColors, gradientLocations); 83 | 84 | //// Shadow Declarations 85 | UIColor *outerShadow = [UIColor blackColor]; 86 | CGSize outerShadowOffset = CGSizeMake(0, 0); 87 | CGFloat outerShadowBlurRadius = 5; 88 | 89 | UIColor *highlightShadow = highlightColor; 90 | CGSize highlightShadowOffset = CGSizeMake(0.1, 1.1); 91 | CGFloat highlightShadowBlurRadius = 0; 92 | 93 | //// Frames 94 | CGRect panelFrame = CGRectInset(self.bounds, 10, 5); 95 | 96 | //// Draw gradient 97 | UIBezierPath *roundedRectPath = [UIBezierPath bezierPathWithRoundedRect:panelFrame cornerRadius:5]; 98 | CGContextSaveGState(context); 99 | CGContextSetShadowWithColor(context, outerShadowOffset, outerShadowBlurRadius, outerShadow.CGColor); 100 | CGContextBeginTransparencyLayer(context, NULL); 101 | [roundedRectPath addClip]; 102 | CGRect roundedRectBounds = CGPathGetPathBoundingBox(roundedRectPath.CGPath); 103 | CGContextDrawLinearGradient(context, lineGradient, 104 | CGPointMake(CGRectGetMidX(roundedRectBounds), CGRectGetMinY(roundedRectBounds)), 105 | CGPointMake(CGRectGetMidX(roundedRectBounds), CGRectGetMaxY(roundedRectBounds)), 106 | 0); 107 | CGContextEndTransparencyLayer(context); 108 | 109 | //// Highlight 110 | CGRect highlightRect = CGRectInset([roundedRectPath bounds], -highlightShadowBlurRadius, -highlightShadowBlurRadius); 111 | highlightRect = CGRectOffset(highlightRect, -highlightShadowOffset.width, -highlightShadowOffset.height); 112 | highlightRect = CGRectInset(CGRectUnion(highlightRect, [roundedRectPath bounds]), -1, -1); 113 | 114 | UIBezierPath* roundedRectNegativePath = [UIBezierPath bezierPathWithRect:highlightRect]; 115 | [roundedRectNegativePath appendPath:roundedRectPath]; 116 | roundedRectNegativePath.usesEvenOddFillRule = YES; 117 | 118 | CGContextSaveGState(context); 119 | { 120 | CGFloat xOffset = highlightShadowOffset.width + round(highlightRect.size.width); 121 | CGFloat yOffset = highlightShadowOffset.height; 122 | CGContextSetShadowWithColor(context, 123 | CGSizeMake(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset)), 124 | highlightShadowBlurRadius, 125 | highlightShadow.CGColor); 126 | [roundedRectPath addClip]; 127 | CGAffineTransform transform = CGAffineTransformMakeTranslation(-round(highlightRect.size.width), 0); 128 | [roundedRectNegativePath applyTransform:transform]; 129 | [[UIColor grayColor] setFill]; 130 | [roundedRectNegativePath fill]; 131 | } 132 | CGContextRestoreGState(context); 133 | CGContextRestoreGState(context); 134 | 135 | //// Stroke 136 | [strokeColor setStroke]; 137 | roundedRectPath.lineWidth = 1; 138 | [roundedRectPath stroke]; 139 | 140 | //// Upper line of title 141 | UIBezierPath *titleSeparateLinePath = [UIBezierPath bezierPath]; 142 | [titleSeparateLinePath moveToPoint:CGPointMake(CGRectGetMaxX(panelFrame), CGRectGetMaxY(panelFrame) - 25.0)]; 143 | [titleSeparateLinePath addLineToPoint:CGPointMake(CGRectGetMinX(panelFrame), CGRectGetMaxY(panelFrame) - 25.0)]; 144 | [titleSeparateLinePath closePath]; 145 | CGContextSetShadowWithColor(context, CGSizeMake(0, -1), 0, [UIColor blackColor].CGColor); 146 | [[UIColor colorWithWhite:0.7 alpha:0.3] setStroke]; 147 | titleSeparateLinePath.lineWidth = 0.4; 148 | [titleSeparateLinePath stroke]; 149 | 150 | //// Draw title 151 | UIFont *font = [UIFont systemFontOfSize:12.0]; 152 | CGSize strSize = [self.title sizeWithAttributes:@{NSFontAttributeName:font}]; 153 | CGRect titleRect = CGRectMake(panelFrame.origin.x + 10.0, panelFrame.size.height - 15.0, panelFrame.size.width - 20.0, strSize.height); 154 | UIColor *fontColor = [UIColor colorWithWhite:0.7 alpha:1.0]; 155 | NSMutableParagraphStyle *textStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; 156 | textStyle.lineBreakMode = NSLineBreakByTruncatingMiddle; 157 | textStyle.alignment = NSTextAlignmentCenter; 158 | [self.title drawInRect:titleRect withAttributes:@{NSFontAttributeName:font, NSForegroundColorAttributeName:fontColor, NSParagraphStyleAttributeName:textStyle}]; 159 | 160 | // Add title tap to dissmiss 161 | UIButton *titleTapToDissmissControl = [[UIButton alloc] initWithFrame:titleRect]; 162 | titleTapToDissmissControl.backgroundColor = [UIColor clearColor]; 163 | titleTapToDissmissControl.showsTouchWhenHighlighted = YES; 164 | [titleTapToDissmissControl addTarget:self.delegate action:@selector(dismissActionSheet) forControlEvents:UIControlEventTouchUpInside]; 165 | [self addSubview:titleTapToDissmissControl]; 166 | 167 | //// Cleanup 168 | CGGradientRelease(lineGradient); 169 | CGColorSpaceRelease(colorSpace); 170 | } 171 | 172 | @end 173 | -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0A018EC51707FA2800A4181E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A018EC41707FA2800A4181E /* UIKit.framework */; }; 11 | 0A018EC71707FA2800A4181E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A018EC61707FA2800A4181E /* Foundation.framework */; }; 12 | 0A018EC91707FA2800A4181E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A018EC81707FA2800A4181E /* CoreGraphics.framework */; }; 13 | 0A018ECF1707FA2800A4181E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0A018ECD1707FA2800A4181E /* InfoPlist.strings */; }; 14 | 0A018ED11707FA2800A4181E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A018ED01707FA2800A4181E /* main.m */; }; 15 | 0A018ED51707FA2800A4181E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A018ED41707FA2800A4181E /* AppDelegate.m */; }; 16 | 0A018ED71707FA2800A4181E /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A018ED61707FA2800A4181E /* Default.png */; }; 17 | 0A018ED91707FA2800A4181E /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A018ED81707FA2800A4181E /* Default@2x.png */; }; 18 | 0A018EDB1707FA2800A4181E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A018EDA1707FA2800A4181E /* Default-568h@2x.png */; }; 19 | 0A018EDE1707FA2800A4181E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A018EDD1707FA2800A4181E /* ViewController.m */; }; 20 | 0A018EE11707FA2800A4181E /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0A018EDF1707FA2800A4181E /* ViewController.xib */; }; 21 | 0A018EF11707FB2200A4181E /* AAActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A018EEC1707FB2200A4181E /* AAActivity.m */; }; 22 | 0A018EF21707FB2200A4181E /* AAActivityAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A018EEE1707FB2200A4181E /* AAActivityAction.m */; }; 23 | 0A018EF31707FB2200A4181E /* AAPanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A018EF01707FB2200A4181E /* AAPanelView.m */; }; 24 | 0A018EF51707FB3B00A4181E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A018EF41707FB3B00A4181E /* QuartzCore.framework */; }; 25 | 0A27D7B419E1073200569480 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0A27D7B319E1073200569480 /* LaunchScreen.xib */; }; 26 | 0A4B9DF0170DEBA7004F3A6F /* Safari-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A4B9DED170DEBA7004F3A6F /* Safari-Small@2x.png */; }; 27 | 0A4B9DF1170DEBA7004F3A6F /* Safari@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A4B9DEE170DEBA7004F3A6F /* Safari@2x~iphone.png */; }; 28 | 0A4B9DF2170DEBA7004F3A6F /* Safari@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A4B9DEF170DEBA7004F3A6F /* Safari@2x~ipad.png */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 0A018EC11707FA2800A4181E /* AAActivityActionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AAActivityActionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 0A018EC41707FA2800A4181E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 34 | 0A018EC61707FA2800A4181E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 35 | 0A018EC81707FA2800A4181E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 36 | 0A018ECC1707FA2800A4181E /* AAActivityActionDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "AAActivityActionDemo-Info.plist"; sourceTree = ""; }; 37 | 0A018ECE1707FA2800A4181E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 38 | 0A018ED01707FA2800A4181E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 39 | 0A018ED21707FA2800A4181E /* AAActivityActionDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AAActivityActionDemo-Prefix.pch"; sourceTree = ""; }; 40 | 0A018ED31707FA2800A4181E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 41 | 0A018ED41707FA2800A4181E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 42 | 0A018ED61707FA2800A4181E /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 43 | 0A018ED81707FA2800A4181E /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 44 | 0A018EDA1707FA2800A4181E /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 45 | 0A018EDC1707FA2800A4181E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 46 | 0A018EDD1707FA2800A4181E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 47 | 0A018EEB1707FB2200A4181E /* AAActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAActivity.h; sourceTree = ""; }; 48 | 0A018EEC1707FB2200A4181E /* AAActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAActivity.m; sourceTree = ""; }; 49 | 0A018EED1707FB2200A4181E /* AAActivityAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAActivityAction.h; sourceTree = ""; }; 50 | 0A018EEE1707FB2200A4181E /* AAActivityAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAActivityAction.m; sourceTree = ""; }; 51 | 0A018EEF1707FB2200A4181E /* AAPanelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPanelView.h; sourceTree = ""; }; 52 | 0A018EF01707FB2200A4181E /* AAPanelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPanelView.m; sourceTree = ""; }; 53 | 0A018EF41707FB3B00A4181E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 54 | 0A27D7B319E1073200569480 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = ""; }; 55 | 0A4B9DED170DEBA7004F3A6F /* Safari-Small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Safari-Small@2x.png"; sourceTree = ""; }; 56 | 0A4B9DEE170DEBA7004F3A6F /* Safari@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Safari@2x~iphone.png"; sourceTree = ""; }; 57 | 0A4B9DEF170DEBA7004F3A6F /* Safari@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Safari@2x~ipad.png"; sourceTree = ""; }; 58 | 0A90A31222919FE100248C24 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ViewController.xib; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 0A018EBE1707FA2800A4181E /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 0A018EF51707FB3B00A4181E /* QuartzCore.framework in Frameworks */, 67 | 0A018EC51707FA2800A4181E /* UIKit.framework in Frameworks */, 68 | 0A018EC71707FA2800A4181E /* Foundation.framework in Frameworks */, 69 | 0A018EC91707FA2800A4181E /* CoreGraphics.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 0A018EB81707FA2800A4181E = { 77 | isa = PBXGroup; 78 | children = ( 79 | 0A018EEA1707FB2200A4181E /* AAActivityAction */, 80 | 0A018ECA1707FA2800A4181E /* AAActivityActionDemo */, 81 | 0A018EC31707FA2800A4181E /* Frameworks */, 82 | 0A018EC21707FA2800A4181E /* Products */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 0A018EC21707FA2800A4181E /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 0A018EC11707FA2800A4181E /* AAActivityActionDemo.app */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | 0A018EC31707FA2800A4181E /* Frameworks */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 0A018EF41707FB3B00A4181E /* QuartzCore.framework */, 98 | 0A018EC41707FA2800A4181E /* UIKit.framework */, 99 | 0A018EC61707FA2800A4181E /* Foundation.framework */, 100 | 0A018EC81707FA2800A4181E /* CoreGraphics.framework */, 101 | ); 102 | name = Frameworks; 103 | sourceTree = ""; 104 | }; 105 | 0A018ECA1707FA2800A4181E /* AAActivityActionDemo */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 0A4B9DED170DEBA7004F3A6F /* Safari-Small@2x.png */, 109 | 0A4B9DEE170DEBA7004F3A6F /* Safari@2x~iphone.png */, 110 | 0A4B9DEF170DEBA7004F3A6F /* Safari@2x~ipad.png */, 111 | 0A018ED31707FA2800A4181E /* AppDelegate.h */, 112 | 0A018ED41707FA2800A4181E /* AppDelegate.m */, 113 | 0A018EDC1707FA2800A4181E /* ViewController.h */, 114 | 0A018EDD1707FA2800A4181E /* ViewController.m */, 115 | 0A018EDF1707FA2800A4181E /* ViewController.xib */, 116 | 0A27D7B319E1073200569480 /* LaunchScreen.xib */, 117 | 0A018ECB1707FA2800A4181E /* Supporting Files */, 118 | ); 119 | path = AAActivityActionDemo; 120 | sourceTree = ""; 121 | }; 122 | 0A018ECB1707FA2800A4181E /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 0A018ECC1707FA2800A4181E /* AAActivityActionDemo-Info.plist */, 126 | 0A018ECD1707FA2800A4181E /* InfoPlist.strings */, 127 | 0A018ED01707FA2800A4181E /* main.m */, 128 | 0A018ED21707FA2800A4181E /* AAActivityActionDemo-Prefix.pch */, 129 | 0A018ED61707FA2800A4181E /* Default.png */, 130 | 0A018ED81707FA2800A4181E /* Default@2x.png */, 131 | 0A018EDA1707FA2800A4181E /* Default-568h@2x.png */, 132 | ); 133 | name = "Supporting Files"; 134 | sourceTree = ""; 135 | }; 136 | 0A018EEA1707FB2200A4181E /* AAActivityAction */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 0A018EEB1707FB2200A4181E /* AAActivity.h */, 140 | 0A018EEC1707FB2200A4181E /* AAActivity.m */, 141 | 0A018EED1707FB2200A4181E /* AAActivityAction.h */, 142 | 0A018EEE1707FB2200A4181E /* AAActivityAction.m */, 143 | 0A018EEF1707FB2200A4181E /* AAPanelView.h */, 144 | 0A018EF01707FB2200A4181E /* AAPanelView.m */, 145 | ); 146 | path = AAActivityAction; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | 0A018EC01707FA2800A4181E /* AAActivityActionDemo */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = 0A018EE71707FA2800A4181E /* Build configuration list for PBXNativeTarget "AAActivityActionDemo" */; 155 | buildPhases = ( 156 | 0A018EBD1707FA2800A4181E /* Sources */, 157 | 0A018EBE1707FA2800A4181E /* Frameworks */, 158 | 0A018EBF1707FA2800A4181E /* Resources */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | ); 164 | name = AAActivityActionDemo; 165 | productName = AAActivityActionDemo; 166 | productReference = 0A018EC11707FA2800A4181E /* AAActivityActionDemo.app */; 167 | productType = "com.apple.product-type.application"; 168 | }; 169 | /* End PBXNativeTarget section */ 170 | 171 | /* Begin PBXProject section */ 172 | 0A018EB91707FA2800A4181E /* Project object */ = { 173 | isa = PBXProject; 174 | attributes = { 175 | LastUpgradeCheck = 1020; 176 | ORGANIZATIONNAME = "r-plus"; 177 | }; 178 | buildConfigurationList = 0A018EBC1707FA2800A4181E /* Build configuration list for PBXProject "AAActivityActionDemo" */; 179 | compatibilityVersion = "Xcode 3.2"; 180 | developmentRegion = en; 181 | hasScannedForEncodings = 0; 182 | knownRegions = ( 183 | en, 184 | Base, 185 | ); 186 | mainGroup = 0A018EB81707FA2800A4181E; 187 | productRefGroup = 0A018EC21707FA2800A4181E /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | 0A018EC01707FA2800A4181E /* AAActivityActionDemo */, 192 | ); 193 | }; 194 | /* End PBXProject section */ 195 | 196 | /* Begin PBXResourcesBuildPhase section */ 197 | 0A018EBF1707FA2800A4181E /* Resources */ = { 198 | isa = PBXResourcesBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | 0A018ECF1707FA2800A4181E /* InfoPlist.strings in Resources */, 202 | 0A018ED71707FA2800A4181E /* Default.png in Resources */, 203 | 0A018ED91707FA2800A4181E /* Default@2x.png in Resources */, 204 | 0A018EDB1707FA2800A4181E /* Default-568h@2x.png in Resources */, 205 | 0A018EE11707FA2800A4181E /* ViewController.xib in Resources */, 206 | 0A4B9DF0170DEBA7004F3A6F /* Safari-Small@2x.png in Resources */, 207 | 0A4B9DF1170DEBA7004F3A6F /* Safari@2x~iphone.png in Resources */, 208 | 0A27D7B419E1073200569480 /* LaunchScreen.xib in Resources */, 209 | 0A4B9DF2170DEBA7004F3A6F /* Safari@2x~ipad.png in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | /* End PBXResourcesBuildPhase section */ 214 | 215 | /* Begin PBXSourcesBuildPhase section */ 216 | 0A018EBD1707FA2800A4181E /* Sources */ = { 217 | isa = PBXSourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 0A018ED11707FA2800A4181E /* main.m in Sources */, 221 | 0A018ED51707FA2800A4181E /* AppDelegate.m in Sources */, 222 | 0A018EDE1707FA2800A4181E /* ViewController.m in Sources */, 223 | 0A018EF11707FB2200A4181E /* AAActivity.m in Sources */, 224 | 0A018EF21707FB2200A4181E /* AAActivityAction.m in Sources */, 225 | 0A018EF31707FB2200A4181E /* AAPanelView.m in Sources */, 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | /* End PBXSourcesBuildPhase section */ 230 | 231 | /* Begin PBXVariantGroup section */ 232 | 0A018ECD1707FA2800A4181E /* InfoPlist.strings */ = { 233 | isa = PBXVariantGroup; 234 | children = ( 235 | 0A018ECE1707FA2800A4181E /* en */, 236 | ); 237 | name = InfoPlist.strings; 238 | sourceTree = ""; 239 | }; 240 | 0A018EDF1707FA2800A4181E /* ViewController.xib */ = { 241 | isa = PBXVariantGroup; 242 | children = ( 243 | 0A90A31222919FE100248C24 /* Base */, 244 | ); 245 | name = ViewController.xib; 246 | sourceTree = ""; 247 | }; 248 | /* End PBXVariantGroup section */ 249 | 250 | /* Begin XCBuildConfiguration section */ 251 | 0A018EE51707FA2800A4181E /* Debug */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | ALWAYS_SEARCH_USER_PATHS = NO; 255 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 256 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 257 | CLANG_CXX_LIBRARY = "libc++"; 258 | CLANG_ENABLE_OBJC_ARC = YES; 259 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 260 | CLANG_WARN_BOOL_CONVERSION = YES; 261 | CLANG_WARN_COMMA = YES; 262 | CLANG_WARN_CONSTANT_CONVERSION = YES; 263 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 264 | CLANG_WARN_EMPTY_BODY = YES; 265 | CLANG_WARN_ENUM_CONVERSION = YES; 266 | CLANG_WARN_INFINITE_RECURSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 269 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 270 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 271 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 272 | CLANG_WARN_STRICT_PROTOTYPES = YES; 273 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 274 | CLANG_WARN_UNREACHABLE_CODE = YES; 275 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 276 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 277 | COPY_PHASE_STRIP = NO; 278 | ENABLE_STRICT_OBJC_MSGSEND = YES; 279 | ENABLE_TESTABILITY = YES; 280 | GCC_C_LANGUAGE_STANDARD = gnu99; 281 | GCC_DYNAMIC_NO_PIC = NO; 282 | GCC_NO_COMMON_BLOCKS = YES; 283 | GCC_OPTIMIZATION_LEVEL = 0; 284 | GCC_PREPROCESSOR_DEFINITIONS = ( 285 | "DEBUG=1", 286 | "$(inherited)", 287 | ); 288 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 289 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 290 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 291 | GCC_WARN_UNDECLARED_SELECTOR = YES; 292 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 293 | GCC_WARN_UNUSED_FUNCTION = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 296 | ONLY_ACTIVE_ARCH = YES; 297 | SDKROOT = iphoneos; 298 | TARGETED_DEVICE_FAMILY = "1,2"; 299 | }; 300 | name = Debug; 301 | }; 302 | 0A018EE61707FA2800A4181E /* Release */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_OBJC_ARC = YES; 310 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 311 | CLANG_WARN_BOOL_CONVERSION = YES; 312 | CLANG_WARN_COMMA = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INFINITE_RECURSION = YES; 318 | CLANG_WARN_INT_CONVERSION = YES; 319 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 320 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 321 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 323 | CLANG_WARN_STRICT_PROTOTYPES = YES; 324 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = YES; 329 | ENABLE_STRICT_OBJC_MSGSEND = YES; 330 | GCC_C_LANGUAGE_STANDARD = gnu99; 331 | GCC_NO_COMMON_BLOCKS = YES; 332 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 333 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 334 | GCC_WARN_UNDECLARED_SELECTOR = YES; 335 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 336 | GCC_WARN_UNUSED_FUNCTION = YES; 337 | GCC_WARN_UNUSED_VARIABLE = YES; 338 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 339 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 340 | SDKROOT = iphoneos; 341 | TARGETED_DEVICE_FAMILY = "1,2"; 342 | VALIDATE_PRODUCT = YES; 343 | }; 344 | name = Release; 345 | }; 346 | 0A018EE81707FA2800A4181E /* Debug */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 350 | GCC_PREFIX_HEADER = "AAActivityActionDemo/AAActivityActionDemo-Prefix.pch"; 351 | INFOPLIST_FILE = "AAActivityActionDemo/AAActivityActionDemo-Info.plist"; 352 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 353 | PRODUCT_BUNDLE_IDENTIFIER = "jp.r-plus.${PRODUCT_NAME:rfc1034identifier}"; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | WRAPPER_EXTENSION = app; 356 | }; 357 | name = Debug; 358 | }; 359 | 0A018EE91707FA2800A4181E /* Release */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 363 | GCC_PREFIX_HEADER = "AAActivityActionDemo/AAActivityActionDemo-Prefix.pch"; 364 | INFOPLIST_FILE = "AAActivityActionDemo/AAActivityActionDemo-Info.plist"; 365 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 366 | PRODUCT_BUNDLE_IDENTIFIER = "jp.r-plus.${PRODUCT_NAME:rfc1034identifier}"; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | WRAPPER_EXTENSION = app; 369 | }; 370 | name = Release; 371 | }; 372 | /* End XCBuildConfiguration section */ 373 | 374 | /* Begin XCConfigurationList section */ 375 | 0A018EBC1707FA2800A4181E /* Build configuration list for PBXProject "AAActivityActionDemo" */ = { 376 | isa = XCConfigurationList; 377 | buildConfigurations = ( 378 | 0A018EE51707FA2800A4181E /* Debug */, 379 | 0A018EE61707FA2800A4181E /* Release */, 380 | ); 381 | defaultConfigurationIsVisible = 0; 382 | defaultConfigurationName = Release; 383 | }; 384 | 0A018EE71707FA2800A4181E /* Build configuration list for PBXNativeTarget "AAActivityActionDemo" */ = { 385 | isa = XCConfigurationList; 386 | buildConfigurations = ( 387 | 0A018EE81707FA2800A4181E /* Debug */, 388 | 0A018EE91707FA2800A4181E /* Release */, 389 | ); 390 | defaultConfigurationIsVisible = 0; 391 | defaultConfigurationName = Release; 392 | }; 393 | /* End XCConfigurationList section */ 394 | }; 395 | rootObject = 0A018EB91707FA2800A4181E /* Project object */; 396 | } 397 | -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/project.xcworkspace/xcshareddata/AAActivityActionDemo.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 646BFCAD-39CF-401C-BBEA-D589A003079B 9 | IDESourceControlProjectName 10 | AAActivityActionDemo 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | ACD19A11-9F94-48F8-BC74-46401F4B74E3 14 | ssh://github.com/r-plus/AAActivityAction.git 15 | 16 | IDESourceControlProjectPath 17 | AAActivityActionDemo.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | ACD19A11-9F94-48F8-BC74-46401F4B74E3 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/r-plus/AAActivityAction.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | ACD19A11-9F94-48F8-BC74-46401F4B74E3 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | ACD19A11-9F94-48F8-BC74-46401F4B74E3 36 | IDESourceControlWCCName 37 | AAActivityAction 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/project.xcworkspace/xcshareddata/AAActivityActionDemo.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "D41F84C92795051529D34F566C8CACB6175C2460", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "D41F84C92795051529D34F566C8CACB6175C2460" : 0, 8 | "0053177785D1C94D7E39804658917C4DF905FCB1" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "646BFCAD-39CF-401C-BBEA-D589A003079B", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "D41F84C92795051529D34F566C8CACB6175C2460" : "AAActivityAction\/", 13 | "0053177785D1C94D7E39804658917C4DF905FCB1" : "" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "AAActivityActionDemo", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "AAActivityActionDemo.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "bitbucket.org:r_plus\/activityaction.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0053177785D1C94D7E39804658917C4DF905FCB1" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:r-plus\/AAActivityAction.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D41F84C92795051529D34F566C8CACB6175C2460" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/project.xcworkspace/xcuserdata/hyde.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo.xcodeproj/project.xcworkspace/xcuserdata/hyde.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/xcuserdata/hyde.xcuserdatad/xcschemes/AAActivityActionDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /AAActivityActionDemo.xcodeproj/xcuserdata/hyde.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AAActivityActionDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 0A018EC01707FA2800A4181E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /AAActivityActionDemo/AAActivityActionDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationPortraitUpsideDown 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /AAActivityActionDemo/AAActivityActionDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AAActivityActionDemo' target in the 'AAActivityActionDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /AAActivityActionDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AAActivityActionDemo 4 | // 5 | // Created by hyde on 2013/03/31. 6 | // Copyright (c) 2013年 r-plus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /AAActivityActionDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AAActivityActionDemo 4 | // 5 | // Created by hyde on 2013/03/31. 6 | // Copyright (c) 2013年 r-plus. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 20 | self.window.rootViewController = self.viewController; 21 | [self.window makeKeyAndVisible]; 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application 26 | { 27 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 28 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application 43 | { 44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /AAActivityActionDemo/Base.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /AAActivityActionDemo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo/Default-568h@2x.png -------------------------------------------------------------------------------- /AAActivityActionDemo/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo/Default.png -------------------------------------------------------------------------------- /AAActivityActionDemo/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo/Default@2x.png -------------------------------------------------------------------------------- /AAActivityActionDemo/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /AAActivityActionDemo/Safari-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo/Safari-Small@2x.png -------------------------------------------------------------------------------- /AAActivityActionDemo/Safari@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo/Safari@2x~ipad.png -------------------------------------------------------------------------------- /AAActivityActionDemo/Safari@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/AAActivityActionDemo/Safari@2x~iphone.png -------------------------------------------------------------------------------- /AAActivityActionDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AAActivityActionDemo 4 | // 5 | // Created by hyde on 2013/03/31. 6 | // Copyright (c) 2013年 r-plus. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | - (IBAction)buttonClicked:(id)sender; 13 | @property (unsafe_unretained, nonatomic) IBOutlet UISegmentedControl *iconSizeSetting; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AAActivityActionDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AAActivityActionDemo 4 | // 5 | // Created by hyde on 2013/03/31. 6 | // Copyright (c) 2013年 r-plus. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | #import "AAActivityAction.h" 12 | #import "AAActivity.h" 13 | 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad 21 | { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | } 25 | 26 | - (void)didReceiveMemoryWarning 27 | { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | - (IBAction)buttonClicked:(id)sender { 33 | AAImageSize imageSize = [self iconSizeSetting].selectedSegmentIndex == 0 ? AAImageSizeSmall : AAImageSizeNormal; 34 | UIImage *image = [UIImage imageNamed:(imageSize == AAImageSizeSmall ? @"Safari-Small.png" : @"Safari.png")]; 35 | NSMutableArray *array = [NSMutableArray array]; 36 | 37 | for (int i=0; i<15; i++) { 38 | AAActivity *activity = [[AAActivity alloc] 39 | initWithTitle:[@"Safari" stringByAppendingFormat:@"%d", i] 40 | image:image 41 | actionBlock:^(AAActivity *activity, NSArray *activityItems) { 42 | NSLog(@"doing activity = %@, activityItems = %@", activity, activityItems); 43 | [[UIApplication sharedApplication] 44 | openURL:[NSURL URLWithString:activityItems[0]] 45 | options:@{} 46 | completionHandler:nil]; 47 | }]; 48 | [array addObject:activity]; 49 | } 50 | 51 | AAActivityAction *aa = [[AAActivityAction alloc] initWithActivityItems:@[@"http://www.apple.com/"] 52 | applicationActivities:array 53 | imageSize:imageSize]; 54 | aa.title = @"sample title"; 55 | //aa.directActionEnabled = YES; 56 | [aa show]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /AAActivityActionDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /AAActivityActionDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AAActivityActionDemo 4 | // 5 | // Created by hyde on 2013/03/31. 6 | // Copyright (c) 2013年 r-plus. 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 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | // 2 | // AAActivityAction.h 3 | // 4 | // Copyright (c) 2013 r-plus. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT = AAActivityActionDemo.xcodeproj 2 | TEST_TARGET = AAActivityActionDemo 3 | 4 | clean: 5 | xcodebuild \ 6 | -project $(PROJECT) \ 7 | clean 8 | 9 | test: 10 | xcodebuild \ 11 | -project $(PROJECT) \ 12 | -target $(TEST_TARGET) \ 13 | -sdk iphonesimulator \ 14 | -configuration Debug \ 15 | TEST_AFTER_BUILD=YES \ 16 | TEST_HOST= 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## AAActivityAction [![build](https://travis-ci.org/r-plus/AAActivityAction.svg?branch=master)](https://travis-ci.org/r-plus/AAActivityAction) 2 | 3 | AAActivityAction is Reeder 3 like ActionSheet. Method architecture is inspired by `UIActivity` and `UIActivityViewController`. 4 | 5 | AAActivityAction | Reeder 3 6 | --- | --- 7 | | 8 | 9 | ### Installation 10 | 11 | #### CocoaPods 12 | Add `pod 'AAActivityAction'` to your Podfile. 13 | 14 | #### Manually 15 | 16 | 1. Link `QuartzCore` framework. 17 | 1. Drag the `AAActivityAction` folder to your project. 18 | 19 | ### Requirement 20 | 21 | * iOS 11 or higher. 22 | * `QuartzCore` framework. 23 | * ARC. 24 | 25 | ### Usage 26 | 27 | ```` 28 | AAActivity *activity = [[AAActivity alloc] initWithTitle:@"Safari" 29 | image:[UIImage imageNamed:@"Safari.png"] 30 | actionBlock:^(AAActivity *activity, NSArray *activityItems) { 31 | // do something... 32 | }]; 33 | AAActivityAction *activityAction = [[AAActivityAction alloc] initWithActivityItems:@[@"http://www.apple.com/"] 34 | applicationActivities:@[activity] 35 | imageSize:AAImageSizeSmall]; 36 | activityAction.title = @"sample title"; 37 | activityAction.directActionEnabled = YES; // If available only one activity, directly invoke its activity action. default is NO. 38 | [activityAction show]; 39 | // or showInView 40 | // [activityAction showInView:view]; 41 | ```` 42 | 43 | ### License 44 | MIT License. 45 | -------------------------------------------------------------------------------- /images/reeder3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/images/reeder3.png -------------------------------------------------------------------------------- /images/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/r-plus/AAActivityAction/573f4362869f92d6eee8a5859b2c7aa74b11c198/images/sample.png --------------------------------------------------------------------------------