初始化提交

This commit is contained in:
2026-02-03 16:52:44 +08:00
commit d2f9806384
512 changed files with 65167 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *orentationLabel;
@end
@implementation ViewController
- (IBAction)deadlockApp:(id)sender
{
dispatch_sync(dispatch_get_main_queue(), ^{
// This will never execute
});
}
- (IBAction)didTapButton:(UIButton *)button
{
button.selected = !button.selected;
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
[self updateOrentationLabel];
}
#if !TARGET_OS_TV
- (void)updateOrentationLabel
{
NSString *orientation = nil;
switch (UIDevice.currentDevice.orientation) {
case UIInterfaceOrientationPortrait:
orientation = @"Portrait";
break;
case UIInterfaceOrientationPortraitUpsideDown:
orientation = @"PortraitUpsideDown";
break;
case UIInterfaceOrientationLandscapeLeft:
orientation = @"LandscapeLeft";
break;
case UIInterfaceOrientationLandscapeRight:
orientation = @"LandscapeRight";
break;
case UIDeviceOrientationFaceUp:
orientation = @"FaceUp";
break;
case UIDeviceOrientationFaceDown:
orientation = @"FaceDown";
break;
case UIInterfaceOrientationUnknown:
orientation = @"Unknown";
break;
}
self.orentationLabel.text = orientation;
}
#endif
@end