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
if error != nil { | |
print(“服務加入失敗: \(error!.localizedDescription)”) | |
return | |
} |
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
peripheralManager?.startAdvertising([CBAdvertisementDataServiceUUIDsKey: [service.uuid]]) |
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
peripheral.updateValue("哈囉你好嗎~".data(using: .utf8)!, | |
for: characteristic as! CBMutableCharacteristic, | |
onSubscribedCentrals: 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
{ | |
"name": "HelloReactNativeDemo", | |
"displayName": "HelloReactNativeDemo" | |
} |
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
export default class HelloReactNativeDemo extends Component { | |
} | |
AppRegistry.registerComponent(‘HelloReactNativeDemo’, () => HelloReactNativeDemo); |
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
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation | |
moduleName:@"HelloReactNativeDemo" | |
initialProperties:nil | |
launchOptions:launchOptions]; |
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
<key>CFBundleDisplayName</key> | |
<string>HelloReactNativeDemo</string> |
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
{ | |
"name": "HelloReactNativeDemo", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node node_modules/react-native/local-cli/cli.js start", | |
"test": "jest" | |
}, | |
"dependencies": { | |
"react": "15.4.2", |
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
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { | |
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; | |
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; | |
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { | |
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { | |
return YES; | |
} | |
return NO; | |
}]; |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// 先省略上面幾行程式碼 | |
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
UIViewController *rootViewController = [UIViewController new]; | |
rootViewController.view = rootView; | |
self.window.rootViewController = rootViewController; | |
[self.window makeKeyAndVisible]; | |
return YES; |
OlderNewer