This file contains hidden or 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 React from 'react'; | |
| import {View, TouchableOpacity} from 'react-native'; | |
| export default class TestRender extends React.Component { | |
| render() { | |
| return ( | |
| <View style={{ backgroundColor: 'white', paddingTop: 64,}} testID="white"> | |
| <View style={{ backgroundColor: "yellow",width: 50, height: 50}} testID="white-yellow"/> | |
| <View | |
| style={{backgroundColor: 'green',width: 100, height: 100,justifyContent:"center",alignItems:"center"}} testID="white-green" |
This file contains hidden or 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 | |
| extension UIApplication { | |
| class func topViewController(_ base: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController? { | |
| if let navigationController = base as? UINavigationController, navigationController.viewControllers.count > 0 { | |
| return topViewController(navigationController.visibleViewController) | |
| } | |
This file contains hidden or 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
| if([url.scheme isEqualToString:@"file"]) { | |
| NSString *fileName = [NSString stringWithFormat:@"%@@3x", url.host]; | |
| NSString *file = [[NSBundle mainBundle] pathForResource:fileName ofType:@"png"]; | |
| if(file != nil) { | |
| url = [NSURL fileURLWithPath:file]; | |
| } | |
| else { | |
| NSInteger prefixLength = @"file://".length + url.host.length + @"/".length; |
This file contains hidden or 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
| // Created by michaelxing on 2017/9/30. | |
| // Copyright © 2017年 michaelxing. All rights reserved. | |
| import UIKit | |
| extension UIImage { | |
| subscript(x: Int, y: Int) -> UIColor? { | |
| get { | |
| if x < 0 || x > Int(size.width) || y < 0 || y > Int(size.height) { |
This file contains hidden or 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
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> | |
| // Compile-time selector checks. |