Skip to content

Commit

Permalink
Release V1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
欧柏泉 committed May 10, 2018
1 parent 2f6b5ac commit 74ebd2a
Show file tree
Hide file tree
Showing 12 changed files with 374 additions and 41 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
**TangramKit**中的所有历史版本变化将会在这个文件中列出。

---

## [V1.1.6](https://github.com/youngsoft/TangramKit/releases/tag/1.1.6)(2018/05/10)

#### Added
1.添加了流式布局`TGFlowLayout`对瀑布流的支持,主要是数量约束流式布局来实现,通过设置`tg_autoArrange`为YES或者设置`tg_arrangedGravity`属性为`TGGravity.horz.between或者TGGravity.vert.between`来实现两种不同策略的瀑布流模式,瀑布流模式其实就是一种紧凑的流式布局排列方式。具体的DEMO在新增加的[FLLTest7ViewController](https://github.com/youngsoft/TangramKit/blob/master/TangramKitDemo/FlowLayoutDemo/FLLTest7ViewController.swift)中可以查看。

#### Fixed
1. 修复了流式布局`TGFlowLayout`中的tg_gravity属性设置后停靠有可能不正确的问题。
2. 优化和修复了对UIScrollView+布局视图时,设置UIScrollView的高度或者宽度由布局视图的尺寸进行自适应的问题。新版本中UIScrollView的尺寸可以依赖于布局视图的尺寸,同时布局视图的最大最小尺寸可以设置为UIScrollView的尺寸。具体例子参考:[FLLTest7ViewController](https://github.com/youngsoft/TangramKit/blob/master/TangramKitDemo/FlowLayoutDemo/FLLTest7ViewController.swift)
3. 添加了对布局视图的`tg_cacheEstimatedRect`属性的使用限制说明,这个属性只能用于那些需要高度自适应的UITableViewCell的根布局视图中使用,其他地方如果使用则有可能会出现计算不正确的问题。


## [V1.1.5](https://github.com/youngsoft/TangramKit/releases/tag/1.1.5)(2018/05/06)

1. 优化了编译时慢的一些代码。
Expand Down
2 changes: 1 addition & 1 deletion TangramKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "TangramKit"
s.version = "1.1.5"
s.version = "1.1.6"
s.summary = "TangramKit is A powerful iOS UI framework. It integrated the Android layout,AutoLayout,SizeClass, HTML/CSS float and flexbox functions."

s.description = <<-DESC
Expand Down
4 changes: 4 additions & 0 deletions TangramKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
204DC323209E0BC000F6CB57 /* TLTest4ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 204DC322209E0BC000F6CB57 /* TLTest4ViewController.swift */; };
20B6C6E71FA40AEC001D51C7 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20B6C6E61FA40AEC001D51C7 /* DetailViewController.swift */; };
20DCF335208CD022007A879B /* FOLTest7ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20DCF334208CD022007A879B /* FOLTest7ViewController.swift */; };
20FC8FE220A4241D0029DE31 /* FLLTest7ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20FC8FE120A4241D0029DE31 /* FLLTest7ViewController.swift */; };
681BD8DF1E0B91A500403A1F /* TangramKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 681BD8DD1E0B91A500403A1F /* TangramKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
681BD90F1E0B92E100403A1F /* TangramKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681BD9011E0B92E100403A1F /* TangramKit.swift */; };
681BD9111E0B92E100403A1F /* TGBaseLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681BD9021E0B92E100403A1F /* TGBaseLayout.swift */; };
Expand Down Expand Up @@ -106,6 +107,7 @@
204DC322209E0BC000F6CB57 /* TLTest4ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLTest4ViewController.swift; sourceTree = "<group>"; };
20B6C6E61FA40AEC001D51C7 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = "<group>"; };
20DCF334208CD022007A879B /* FOLTest7ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FOLTest7ViewController.swift; sourceTree = "<group>"; };
20FC8FE120A4241D0029DE31 /* FLLTest7ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FLLTest7ViewController.swift; sourceTree = "<group>"; };
681BD8DB1E0B91A500403A1F /* TangramKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TangramKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
681BD8DD1E0B91A500403A1F /* TangramKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TangramKit.h; sourceTree = "<group>"; };
681BD8DE1E0B91A500403A1F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -289,6 +291,7 @@
68F035F81E0B7D2700CEBAEF /* FLLTest4ViewController.swift */,
184243071E327F0800E2CCE1 /* FLLTest5ViewController.swift */,
18058AAE1E63B4EA00EAECDC /* FLLTest6ViewController.swift */,
20FC8FE120A4241D0029DE31 /* FLLTest7ViewController.swift */,
);
path = FlowLayoutDemo;
sourceTree = "<group>";
Expand Down Expand Up @@ -553,6 +556,7 @@
68F036441E0B7D2700CEBAEF /* FOLTest4ViewController.swift in Sources */,
68F0366C1E0B7D2700CEBAEF /* LLTest6ViewController.swift in Sources */,
18BCBD461E1336D900AC7766 /* AllTest8ViewController.swift in Sources */,
20FC8FE220A4241D0029DE31 /* FLLTest7ViewController.swift in Sources */,
68F036541E0B7D2700CEBAEF /* AllTest6ViewController.swift in Sources */,
68F036801E0B7D2700CEBAEF /* TLTest3ViewController.swift in Sources */,
68F036811E0B7D2700CEBAEF /* ViewController.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion TangramKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.5</string>
<string>1.1.6</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
32 changes: 30 additions & 2 deletions TangramKit/TGBaseLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,8 @@ open class TGBaseLayout: UIView,TGLayoutViewSizeClass {
return size.height;
}
这个属性有可能会造成动态高度计算不正确,请只在UITableviewCell的高度为自适应时使用,其他地方不建议设置这个属性!!
*/
public var tg_cacheEstimatedRect:Bool = false
{
Expand Down Expand Up @@ -2618,6 +2619,16 @@ extension TGBaseLayout
}
}

//这里要判断自己的宽度设置了最小和最大宽度依赖于父视图的情况。如果有这种情况,则父视图在变化时也需要调整自身。
if let t = lsc.width.maxVal?.sizeVal, t.view === newSuperview
{
isAdjust = true
}
if let t = lsc.width.minVal?.sizeVal, t.view === newSuperview
{
isAdjust = true
}

rectSelf.size.width = self.tgValidMeasure(lsc.width,sbv:self,calcSize:rectSelf.width,sbvSize:rectSelf.size,selfLayoutSize:rectSuper.size);

if TGBaseLayout.tg_isRTL
Expand Down Expand Up @@ -2710,6 +2721,16 @@ extension TGBaseLayout
}
}

//这里要判断自己的高度设置了最小和最大高度依赖于父视图的情况。如果有这种情况,则父视图在变化时也需要调整自身。
if let t = lsc.height.maxVal?.sizeVal, t.view === newSuperview
{
isAdjust = true
}
if let t = lsc.height.minVal?.sizeVal, t.view === newSuperview
{
isAdjust = true
}

rectSelf.size.height = self.tgValidMeasure(lsc.height,sbv:self,calcSize:rectSelf.height,sbvSize:rectSelf.size,selfLayoutSize:rectSuper.size);

if lsc.isVertMarginHasValue
Expand Down Expand Up @@ -3411,6 +3432,10 @@ extension TGBaseLayout
{
lv.removeObserver(self, forKeyPath: "center")
}
else if let sv = subview as? UIScrollView
{
sv.removeObserver(self, forKeyPath: "center")
}
else if let lb = subview as? UILabel
{
lb.removeObserver(self, forKeyPath: "text")
Expand Down Expand Up @@ -3438,7 +3463,10 @@ extension TGBaseLayout
if let lv = subview as? TGBaseLayout
{
lv.addObserver(self, forKeyPath:"center", options:.new, context: &TGBaseLayout._stgObserverCtxA)
lv.tg_cacheEstimatedRect = self.tg_cacheEstimatedRect
}
else if let sv = subview as? UIScrollView
{
sv.addObserver(self, forKeyPath:"center", options:.new, context: &TGBaseLayout._stgObserverCtxA)
}
else if let lb = subview as? UILabel
{
Expand Down
Loading

0 comments on commit 74ebd2a

Please sign in to comment.