This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AttributedString.swift | |
// | |
// Created by fm.tonakai on 2019/04/08. | |
// | |
import UIKit | |
public struct AttributedString: ExpressibleByStringLiteral, ExpressibleByStringInterpolation, CustomStringConvertible { | |
public struct StringInterpolation: StringInterpolationProtocol { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// implementation of UITextView subclass | |
// editableプロパティをNO, selectableプロパティをYESにする | |
// リンクのところ以外のタッチを透過する | |
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { | |
CGPoint p = point; | |
p.y -= self.textContainerInset.top; | |
p.x -= self.textContainerInset.left; | |
NSInteger i = [self.layoutManager characterIndexForPoint:p inTextContainer:self.textContainer fractionOfDistanceBetweenInsertionPoints:NULL]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
#import "SwitchCell.h" | |
@interface ViewController () <UITableViewDataSource, UITableViewDelegateSwitchCell> | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
// delegate method定義 | |
@protocol UITableViewDelegateSwitchCell <UITableViewDelegate> | |
@optional | |
-(void)tableView:(UITableView *)tableView didChangeValue:(BOOL)value forRowWithIndexPath:(NSIndexPath *)indexPath; | |
@end | |
@interface SwitchCell : UITableViewCell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UITableViewCell (IndexPath) | |
-(UITableView *)tableView; | |
-(NSIndexPath *)indexPath; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef id (^ActivitySourceWrapperExecuteBlock)(UIActivityViewController* activityViewController,NSString* activityType); | |
@interface ActivitySourceWrapper : NSObject<UIActivityItemSource> | |
@property id placeholder; | |
-(id)initWithBlock:(ActivitySourceWrapperExecuteBlock)block; | |
-(id)initWithBlock:(ActivitySourceWrapperExecuteBlock)block withPlaceholder:(id)placeholder; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)share:(id)sender | |
{ | |
ActivityText *text = [[ActivityText alloc] initWithText:@"本文はこちらです。" hashTag:@"ハッシュタグ"]; | |
UIActivityViewController *avc = [[UIActivityViewController alloc] initWithActivityItems:@[text] applicationActivities:nil]; | |
[self presentViewController:avc animated:YES completion:nil]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)openActivityController | |
{ | |
NSString *text = @"本文はこちらです。 #ハッシュタグ"; | |
UIActivityViewController *avc = [[UIActivityViewController alloc] initWithActivityItems:@[text] applicationActivities:nil]; | |
[self presentViewController:avc animated:YES completion:nil]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface ActivityText : NSObject <UIActivityItemSource> | |
-(id)initWithText:(NSString *)text hashTag:(NSString *)hashTag; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIImage+Blur.h | |
// HTTPLoaderTest | |
// | |
// Created by masaki.fuke on 12/08/14. | |
// Copyright (c) 2012年 masaki.fuke. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
NewerOlder