I am testing my Zewo 0.3 Project with Zewo 0.5
OSX El Capitan. Using bash, each snapshot installed
Using 0.3 with DEVELOPMENT-SNAPSHOT-2016-02-08-a
Using 0.5 with DEVELOPMENT-SNAPSHOT-2016-04-12-a
Both make it build and run
public static class GeneralTypeExtensions | |
{ | |
public static dynamic CreateDefaultInstance(this Type type) | |
{ | |
if (type == typeof(string)) | |
{ | |
return ""; | |
} | |
if (type == typeof(char[])) | |
{ |
[JsonDerivedType(typeof(UnverifiedEmail), nameof(UnverifiedEmail))] | |
[JsonDerivedType(typeof(VerifiedEmail), nameof(VerifiedEmail))] | |
public interface IUserEmail; | |
public record UnverifiedEmail(string Value) : IUserEmail; | |
public record VerifiedEmail(string Value) : IUserEmail; | |
public record User(string Name, IUserEmail Email); | |
public class UserEmailTest | |
{ | |
private readonly ITestOutputHelper _testOutputHelper; |
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc.view removeFromSuperview]; |
// Change below parameters to match your Environment | |
struct Constants: ConnectionOption { | |
var host: String = "127.0.0.1" | |
var port: Int = 3306 | |
var user: String = "root" | |
var password: String = "CHANGE_TO_YOUR_PASSWORD" | |
var database: String = "CHANGE_TO_YOUR_PASSWORD" | |
var encoding: MySQL.Connection.Encoding = .UTF8MB4 | |
var timeZone: MySQL.Connection.TimeZone = MySQL.Connection.TimeZone(GMTOffset: 60 * 60 * 9) // JST |
+(NSAttributedString*)attributedStringFromString:(NSString*)string font:(UIFont*)font color:(UIColor*)color{ | |
if (string==nil || ![string isKindOfClass:[NSString class]]) { | |
return [[NSAttributedString alloc] initWithString:@"" attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:color}]; | |
} | |
NSMutableAttributedString * attrib = [[NSMutableAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:font,NSForegroundColorAttributeName:color}]; | |
NSArray * array = [TwitterText entitiesInText:attrib.string]; | |
[array enumerateObjectsUsingBlock:^(TwitterTextEntity * obj, NSUInteger idx, BOOL *stop) { | |
if (obj.type==TwitterTextEntityURL) { | |
NSURL * url = [NSURL URLWithString:[string substringWithRange:obj.range]]; | |
if (url) { |
NSMutableAttributedString * mutable = [[NSMutableAttributedString alloc] init]; | |
[mutable appendAttributedString:[[NSMutableAttributedString alloc] initWithString:self.user.name attributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:12*TOVConstSizeRate]}]]; | |
[mutable appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@" " attributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:6*TOVConstSizeRate]}]]; | |
[mutable appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@"(@" attributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:11*TOVConstSizeRate]}]]; | |
[mutable appendAttributedString:[[NSMutableAttributedString alloc] initWithString:self.user.screenName attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:11*TOVConstSizeRate]}]]; | |
[mutable appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@")\t" attributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:11*TOVConstSizeRate]}]]; | |
[mutable appendAt |
-(BOOL)isFirstResponderRecursive{ | |
if (self.isFirstResponder) { | |
return YES; | |
} | |
for (UIView * sub in self.subviews) { | |
if ([sub isFirstResponderRecursive]) { | |
return YES; | |
} | |
} | |
return NO; |
// 読み上げオブジェクト | |
AVSpeechSynthesizer * synthesizer = [[AVSpeechSynthesizer alloc] init]; | |
// 読み上げる内容 | |
AVSpeechUtterance * utterance = [[AVSpeechUtterance alloc] initWithString:NSLocalizedString(@"Welcome to Tweet Overview ", nil)]; | |
// 読み上げる言語の設定 | |
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"ja-JP"]; | |
utterance.pitchMultiplier = 1.0; | |
// 読み上げる | |
[synthesizer speakUtterance:utterance]; |
@interface ALAssetsLibrary (JTCCommon) | |
-(ALAsset*) getSyncAssetFromURL:(NSURL*)url; | |
-(UIImage*) getSyncFullScreenImageFromURL:(NSURL*)url; | |
-(UIImage*) getSyncFullResolutionImageFromURL:(NSURL*)url; | |
-(UIImage*) getSyncThumbnailImageFromURL:(NSURL*)url; | |
-(UIImage*) getSyncAspectThumbnailImageFromURL:(NSURL*)url; | |
@end |