Преглед изворни кода

【VisionPro适配】适配VisionOS

xcbosa mbp16 пре 1 година
родитељ
комит
c7a25161a4
2 измењених фајлова са 6 додато и 0 уклоњено
  1. 2 0
      Masonry/ViewController+MASAdditions.h
  2. 4 0
      Masonry/ViewController+MASAdditions.m

+ 2 - 0
Masonry/ViewController+MASAdditions.h

@@ -14,6 +14,7 @@
 
 @interface MAS_VIEW_CONTROLLER (MASAdditions)
 
+#if !TARGET_OS_VISION
 /**
  *	following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute
  */
@@ -23,6 +24,7 @@
 @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom NS_DEPRECATED_IOS(8.0, 11.0);
 @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop NS_DEPRECATED_IOS(8.0, 11.0);
 @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom NS_DEPRECATED_IOS(8.0, 11.0);
+#endif
 
 @end
 

+ 4 - 0
Masonry/ViewController+MASAdditions.m

@@ -15,6 +15,9 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 
+#if TARGET_OS_VISION
+
+#else
 - (MASViewAttribute *)mas_topLayoutGuide {
     return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
 }
@@ -34,6 +37,7 @@
 - (MASViewAttribute *)mas_bottomLayoutGuideBottom {
     return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
 }
+#endif
 
 #pragma clang diagnostic pop