Skip to content

Commit

Permalink
Release V1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
欧柏泉 committed May 6, 2018
1 parent 6480263 commit 723def9
Show file tree
Hide file tree
Showing 21 changed files with 327 additions and 71 deletions.
30 changes: 28 additions & 2 deletions MyLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
18D684591C4F423400A48BB4 /* MyLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D684551C4F423400A48BB4 /* MyLayoutTests.m */; };
200A26D91FA8A90300B06E7B /* AllTest9ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 200A26D81FA8A90300B06E7B /* AllTest9ViewController.m */; };
200A26DC1FA96B2400B06E7B /* AllTest9CollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 200A26DB1FA96B2400B06E7B /* AllTest9CollectionViewCell.m */; };
204DC321209D5A8700F6CB57 /* TLTest4ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 204DC320209D5A8600F6CB57 /* TLTest4ViewController.m */; };
205642861F4CFF9B00E8BDDE /* MyBorderline.h in Headers */ = {isa = PBXBuildFile; fileRef = 205642841F4CFF9B00E8BDDE /* MyBorderline.h */; };
205642871F4CFF9B00E8BDDE /* MyBorderline.m in Sources */ = {isa = PBXBuildFile; fileRef = 205642851F4CFF9B00E8BDDE /* MyBorderline.m */; };
205642881F4CFFB600E8BDDE /* MyBorderline.m in Sources */ = {isa = PBXBuildFile; fileRef = 205642851F4CFF9B00E8BDDE /* MyBorderline.m */; };
Expand Down Expand Up @@ -366,6 +367,9 @@
200A26D81FA8A90300B06E7B /* AllTest9ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AllTest9ViewController.m; sourceTree = "<group>"; };
200A26DA1FA96B2400B06E7B /* AllTest9CollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AllTest9CollectionViewCell.h; sourceTree = "<group>"; };
200A26DB1FA96B2400B06E7B /* AllTest9CollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AllTest9CollectionViewCell.m; sourceTree = "<group>"; };
2043D5DB20995DF800276C68 /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreBluetooth.framework; path = System/Library/Frameworks/CoreBluetooth.framework; sourceTree = SDKROOT; };
204DC31F209D5A7C00F6CB57 /* TLTest4ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLTest4ViewController.h; sourceTree = "<group>"; };
204DC320209D5A8600F6CB57 /* TLTest4ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TLTest4ViewController.m; sourceTree = "<group>"; };
205642841F4CFF9B00E8BDDE /* MyBorderline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyBorderline.h; sourceTree = "<group>"; };
205642851F4CFF9B00E8BDDE /* MyBorderline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyBorderline.m; sourceTree = "<group>"; };
205642891F4D013D00E8BDDE /* MyGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyGrid.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -436,6 +440,7 @@
18D684531C4F423400A48BB4 /* MyLayoutTests */,
18B152321DEDDE5500AD7A1C /* MyLayoutUITests */,
1840828E1B2C46E8003F378B /* Products */,
2043D5DA20995DF800276C68 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -605,6 +610,8 @@
18D3C9631EDF080800D3DE43 /* TLTest2ViewController.m */,
18D3C9641EDF080800D3DE43 /* TLTest3ViewController.h */,
18D3C9651EDF080800D3DE43 /* TLTest3ViewController.m */,
204DC31F209D5A7C00F6CB57 /* TLTest4ViewController.h */,
204DC320209D5A8600F6CB57 /* TLTest4ViewController.m */,
);
name = TableLayoutDemo;
sourceTree = "<group>";
Expand Down Expand Up @@ -787,6 +794,14 @@
path = MyLayoutTests;
sourceTree = "<group>";
};
2043D5DA20995DF800276C68 /* Frameworks */ = {
isa = PBXGroup;
children = (
2043D5DB20995DF800276C68 /* CoreBluetooth.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
205CFA8B1F49BCAF00355489 /* GridLayoutDemo */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -919,6 +934,7 @@
TargetAttributes = {
181A10B41EDF12CF00996203 = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = BGQ8WB468K;
ProvisioningStyle = Automatic;
};
1840828C1B2C46E8003F378B = {
Expand Down Expand Up @@ -1118,6 +1134,7 @@
182225CF1E77E5930081AA4B /* MyFloatLayout.m in Sources */,
18D3C92B1EDF07A700D3DE43 /* RLTest4ViewController.m in Sources */,
18D3C92C1EDF07A700D3DE43 /* RLTest5ViewController.m in Sources */,
204DC321209D5A8700F6CB57 /* TLTest4ViewController.m in Sources */,
182DB6431EF7876200E2D65D /* MyGridLayout.m in Sources */,
18D3C9871EDF084000D3DE43 /* AllTest3ViewController.m in Sources */,
18D3C9161EDF074900D3DE43 /* LLTest6ViewController.m in Sources */,
Expand Down Expand Up @@ -1231,9 +1248,11 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = BGQ8WB468K;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -1261,6 +1280,7 @@
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = BGQ8WB468K;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -1384,14 +1404,17 @@
CLANG_ENABLE_CODE_COVERAGE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = BGQ8WB468K;
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
INFOPLIST_FILE = "$(SRCROOT)/MyLayoutDemo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.youngsoft.mylayout;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.youngsoft.MyLayoutDemo;
PRODUCT_NAME = MyLayoutDemo;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -1403,14 +1426,17 @@
CLANG_ENABLE_CODE_COVERAGE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = BGQ8WB468K;
GCC_PREPROCESSOR_DEFINITIONS = "";
INFOPLIST_FILE = "$(SRCROOT)/MyLayoutDemo/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.youngsoft.mylayout;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.youngsoft.MyLayoutDemo;
PRODUCT_NAME = MyLayoutDemo;
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
36 changes: 18 additions & 18 deletions MyLayout/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
1 change: 0 additions & 1 deletion MyLayout/Lib/MyBaseLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@
指定视图的可见性,默认是visible。这个属性是对视图hidden属性的扩展,布局系统对视图的hidden属性设置后,视图将不再参与布局。但在实际中有些场景我们希望视图隐藏后
仍然会占用空间仍然会参与布局。因此我们可以用这个属性来设置当视图隐藏后是否继续参与布局。
如果您使用了这个属性来对视图进行隐藏和取消隐藏操作则请不要再去操作hidden属性,否则可能出现二者效果不一致的情况。因此建议视图的隐藏和显示用这个属性进行设置。
在老版本中布局中的子视图隐藏时要么都参与布局,要么都不参与布局,这是通过布局属性hideSubviewReLayout来设置,新版本中这个属性将会设置为无效了!
属性可以设置的值如下:
Expand Down
36 changes: 20 additions & 16 deletions MyLayout/Lib/MyBaseLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -951,19 +951,6 @@ -(BOOL)reverseLayout
return self.myCurrentSizeClass.reverseLayout;
}



-(void)setHideSubviewReLayout:(BOOL)hideSubviewReLayout
{
//这个属性已经无效了,请单独设置子视图的myVisibility属性来控制视图的显示与否。
NSAssert(0, @"oops!, hideSubviewReLayout is invalid please use subview's myVisibility to instead!!!");
}

-(BOOL)hideSubviewReLayout
{
return NO;
}

-(void)removeAllSubviews
{
[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
Expand Down Expand Up @@ -1934,14 +1921,28 @@ -(void)layoutSubviews
}
}

[_borderlineLayerDelegate setNeedsLayoutIn:CGRectMake(0, 0, newSelfSize.width, newSelfSize.height) withLayer:self.layer];


//这里只用width判断的原因是如果newSelfSize被计算成功则size中的所有值都不是CGFLOAT_MAX,所以这里选width只是其中一个代表。
if (newSelfSize.width != CGFLOAT_MAX)
{
UIView *supv = self.superview;


//更新边界线。
if (_borderlineLayerDelegate != nil)
{
CGRect borderlineRect = CGRectMake(0, 0, newSelfSize.width, newSelfSize.height);
if ([supv isKindOfClass:[MyBaseLayout class]])
{
//这里给父布局视图一个机会来可以改变当前布局的borderlineRect的值,也就是显示的边界线有可能会超出当前布局视图本身的区域。
//比如一些表格或者其他的情况。默认情况下这个函数什么也不做。
[((MyBaseLayout*)supv) myHookSublayout:self borderlineRect:&borderlineRect];
}

[_borderlineLayerDelegate setNeedsLayoutIn:borderlineRect withLayer:self.layer];

}

//如果自己的父视图是非UIScrollView以及非布局视图。以及自己是wrapContentWidth或者wrapContentHeight时,并且如果设置了在父视图居中或者居下或者居右时要在父视图中更新自己的位置。
if (supv != nil && ![supv isKindOfClass:[MyBaseLayout class]])
{
Expand Down Expand Up @@ -3182,7 +3183,6 @@ -(void)myAdjustSubviewWrapContentSet:(UIView*)sbv isEstimate:(BOOL)isEstimate sb
if (sbvmyFrame.multiple)
{
sbvmyFrame.sizeClass = [sbv myBestSizeClass:sizeClass]; //因为estimateLayoutRect执行后会还原,所以这里要重新设置
sbvsc = sbvmyFrame.sizeClass;
}
}
}
Expand Down Expand Up @@ -3331,6 +3331,10 @@ -(void)myCalcSubViewRect:(UIView*)sbv

}

-(void)myHookSublayout:(MyBaseLayout *)sublayout borderlineRect:(CGRect *)pRect
{
//do nothing...
}


@end
Expand Down
1 change: 0 additions & 1 deletion MyLayout/Lib/MyFloatLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ -(CGSize)calcLayoutRect:(CGSize)size isEstimate:(BOOL)isEstimate pHasSubLayout:(
if (sbvmyFrame.multiple)
{
sbvmyFrame.sizeClass = [sbv myBestSizeClass:sizeClass]; //因为sizeThatFits执行后会还原,所以这里要重新设置
sbvsc = sbvmyFrame.sizeClass;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion MyLayout/Lib/MyFlowLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ -(CGSize)calcLayoutRect:(CGSize)size isEstimate:(BOOL)isEstimate pHasSubLayout:(
if (sbvmyFrame.multiple)
{
sbvmyFrame.sizeClass = [sbv myBestSizeClass:sizeClass]; //因为sizeThatFits执行后会还原,所以这里要重新设置
sbvsc = sbvmyFrame.sizeClass;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MyLayout/Lib/MyLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/


//Current version is 1.5.1, please open: https://github.com/youngsoft/MyLinearLayout/blob/master/CHANGELOG.md to show the changes.
//Current version is 1.5.2, please open: https://github.com/youngsoft/MyLinearLayout/blob/master/CHANGELOG.md to show the changes.


#ifndef MyLayout_MyLayout_h
Expand Down
2 changes: 2 additions & 0 deletions MyLayout/Lib/MyLayoutInner.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@

-(MySizeClass)myGetGlobalSizeClass;

//给父布局视图机会来更改子布局视图的边界线的显示的rect
-(void)myHookSublayout:(MyBaseLayout*)sublayout borderlineRect:(CGRect*)pRect;

@end

Expand Down
1 change: 0 additions & 1 deletion MyLayout/Lib/MyLinearLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ -(CGSize)calcLayoutRect:(CGSize)size isEstimate:(BOOL)isEstimate pHasSubLayout:(
if (sbvmyFrame.multiple)
{
sbvmyFrame.sizeClass = [sbv myBestSizeClass:sizeClass]; //因为sizeThatFits执行后会还原,所以这里要重新设置
sbvsc = sbvmyFrame.sizeClass;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions MyLayout/Lib/MyPathLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ typedef enum : NSUInteger {
@interface MyPathSpace : NSObject

/**浮动距离,根据布局视图的尺寸和子视图的数量动态决定*/
+(id)flexed;
+(MyPathSpace *)flexed;

/**固定距离,len为长度,每个子视图之间的距离都是len*/
+(id)fixed:(CGFloat)len;
+(MyPathSpace *)fixed:(CGFloat)len;

/**数量距离,根据布局视图的尺寸和指定的数量count动态决定。*/
+(id)count:(NSInteger)count;
+(MyPathSpace *)count:(NSInteger)count;


/**距离类型。*/
Expand Down
Loading

0 comments on commit 723def9

Please sign in to comment.