Skip to content

Commit

Permalink
add the storyboard unbutton can not resize explain and remove unneces…
Browse files Browse the repository at this point in the history
…sary bracket
  • Loading branch information
DuckDeck committed Nov 16, 2015
1 parent 08fd734 commit bc1d49c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
16 changes: 8 additions & 8 deletions ViewChaos/ViewNeat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class ViewNeat: UIView,ColorPickerDelegate {
return
}
lbl.font = UIFont.systemFontOfSize(newSize)
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize))"
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize)"
}
if viewControl! is UIButton{
let btn = viewControl! as! UIButton
Expand All @@ -307,7 +307,7 @@ class ViewNeat: UIView,ColorPickerDelegate {
return
}
btn.titleLabel?.font = UIFont.systemFontOfSize(newSize)
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize))"
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize)"
}
}
if viewControl! is UITextField{
Expand All @@ -319,7 +319,7 @@ class ViewNeat: UIView,ColorPickerDelegate {
return
}
txt.font = UIFont.systemFontOfSize(newSize)
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize))"
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize)"
}
}
if viewControl! is UITextView{
Expand All @@ -331,7 +331,7 @@ class ViewNeat: UIView,ColorPickerDelegate {
return
}
txt.font = UIFont.systemFontOfSize(newSize)
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize))"
lblViewInfo.text = "\(viewControl!.dynamicType) FontSize: \(newSize)"
}
}
case .border:
Expand All @@ -342,15 +342,15 @@ class ViewNeat: UIView,ColorPickerDelegate {
return
}
viewControl!.layer.borderWidth = newWidth
lblViewInfo.text = "\(viewControl!.dynamicType) BorderWidth: \(newWidth))"
lblViewInfo.text = "\(viewControl!.dynamicType) BorderWidth: \(newWidth)"
case.borderColor: break
case.cornerRadius:
let newCornerRadius = viewControl!.layer.cornerRadius - CGFloat(scaleY) * 0.5
if newCornerRadius < 0{
return
}
viewControl!.layer.cornerRadius = newCornerRadius
lblViewInfo.text = "\(viewControl!.dynamicType) CornerRadius: \(newCornerRadius))"
lblViewInfo.text = "\(viewControl!.dynamicType) CornerRadius: \(newCornerRadius)"
}
default: break
}
Expand Down Expand Up @@ -393,7 +393,7 @@ class ViewNeat: UIView,ColorPickerDelegate {
case 2:neatType = .font
segItemMenu.hidden = true
if let fontSize = getFont(){
lblViewInfo.text = "\(viewControl!.dynamicType) font:\(fontSize))"
lblViewInfo.text = "\(viewControl!.dynamicType) font:\(fontSize)"
}
case 3:neatType = .border
segItemMenu.hidden = false
Expand All @@ -407,7 +407,7 @@ class ViewNeat: UIView,ColorPickerDelegate {
segItemMenu.setTitle("Border", forSegmentAtIndex: 1)
segItemMenu.selectedSegmentIndex = 1
neatBorderType = .borderWidth
lblViewInfo.text = "\(viewControl!.dynamicType) BorderWidth: \(viewControl!.layer.borderWidth))"
lblViewInfo.text = "\(viewControl!.dynamicType) BorderWidth: \(viewControl!.layer.borderWidth)"
case 4:neatType = .color
segItemMenu.hidden = false
if segItemMenu.numberOfSegments == 3{
Expand Down
6 changes: 3 additions & 3 deletions ViewChaosDemo/ViewChaosDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
A211FECF1BF02A83004A0A29 /* ViewChaos.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewChaos.swift; path = /Users/Tyrant/Desktop/ViewChaos/ViewChaos/ViewChaos.swift; sourceTree = "<absolute>"; };
A211FED01BF02A83004A0A29 /* ViewChaosInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewChaosInfo.swift; path = /Users/Tyrant/Desktop/ViewChaos/ViewChaos/ViewChaosInfo.swift; sourceTree = "<absolute>"; };
A211FED31BF03D0C004A0A29 /* ViewNeat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewNeat.swift; path = /Users/Tyrant/Desktop/ViewChaos/ViewChaos/ViewNeat.swift; sourceTree = "<absolute>"; };
A211FECF1BF02A83004A0A29 /* ViewChaos.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewChaos.swift; path = /Users/Tyrant/Documents/ViewChaos/ViewChaos/ViewChaos.swift; sourceTree = "<absolute>"; };
A211FED01BF02A83004A0A29 /* ViewChaosInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewChaosInfo.swift; path = /Users/Tyrant/Documents/ViewChaos/ViewChaos/ViewChaosInfo.swift; sourceTree = "<absolute>"; };
A211FED31BF03D0C004A0A29 /* ViewNeat.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewNeat.swift; path = /Users/Tyrant/Documents/ViewChaos/ViewChaos/ViewNeat.swift; sourceTree = "<absolute>"; };
A2E6F0161BEAFF7D0042FC43 /* ViewChaosDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewChaosDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
A2E6F0191BEAFF7D0042FC43 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
A2E6F01B1BEAFF7D0042FC43 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down
18 changes: 16 additions & 2 deletions ViewChaosDemo/ViewChaosDemo/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -64,6 +64,20 @@
<constraint firstItem="l7p-1p-ye0" firstAttribute="leading" secondItem="jkD-dA-i91" secondAttribute="leading" constant="10" id="sLv-uL-j0x"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5iI-E2-Ffn">
<rect key="frame" x="20" y="255" width="73" height="30"/>
<animations/>
<color key="backgroundColor" red="0.0026269643567502499" green="0.30854946374893188" blue="0.9926033616065979" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="tintColor" red="1" green="0.21864606110000001" blue="0.11796609800000001" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Button"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Storyboard 里的 UIButton不能改变大小" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vn6-p2-JbQ">
<rect key="frame" x="112" y="255" width="361" height="30"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down

0 comments on commit bc1d49c

Please sign in to comment.