Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Example/STBaseProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
E454C6C125C293E800B98363 /* STTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E454C6BF25C293E800B98363 /* STTestViewController.swift */; };
E454C6C225C293E800B98363 /* STTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E454C6C025C293E800B98363 /* STTestViewController.xib */; };
E46045BE23CD9A7F00D4AA81 /* STTestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E46045BD23CD9A7F00D4AA81 /* STTestView.swift */; };
E4FEB62825A6FD680055D834 /* STNextViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4FEB62725A6FD680055D834 /* STNextViewController.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -47,6 +49,8 @@
BCBDD6C1F1A3F9746985EE4C /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
D130156922DC92BC00D5216C /* STBaseProject-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "STBaseProject-Bridging-Header.h"; sourceTree = "<group>"; };
D39D8AFC82CB37AB8D99B8AB /* Pods-STBaseProject_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-STBaseProject_Example.debug.xcconfig"; path = "Target Support Files/Pods-STBaseProject_Example/Pods-STBaseProject_Example.debug.xcconfig"; sourceTree = "<group>"; };
E454C6BF25C293E800B98363 /* STTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STTestViewController.swift; sourceTree = "<group>"; };
E454C6C025C293E800B98363 /* STTestViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = STTestViewController.xib; sourceTree = "<group>"; };
E46045BD23CD9A7F00D4AA81 /* STTestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STTestView.swift; sourceTree = "<group>"; };
E4FEB62725A6FD680055D834 /* STNextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STNextViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -106,6 +110,8 @@
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
607FACD71AFB9204008FA782 /* ViewController.swift */,
E4FEB62725A6FD680055D834 /* STNextViewController.swift */,
E454C6BF25C293E800B98363 /* STTestViewController.swift */,
E454C6C025C293E800B98363 /* STTestViewController.xib */,
E46045BD23CD9A7F00D4AA81 /* STTestView.swift */,
607FACD31AFB9204008FA782 /* Supporting Files */,
);
Expand Down Expand Up @@ -252,6 +258,7 @@
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */,
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */,
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */,
E454C6C225C293E800B98363 /* STTestViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -320,6 +327,7 @@
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
E4FEB62825A6FD680055D834 /* STNextViewController.swift in Sources */,
E46045BE23CD9A7F00D4AA81 /* STTestView.swift in Sources */,
E454C6C125C293E800B98363 /* STTestViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
36 changes: 36 additions & 0 deletions Example/STBaseProject/STTestViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// STTestViewController.swift
// STBaseProject_Example
//
// Created by song on 2021/1/28.
// Copyright © 2021 STBaseProject. All rights reserved.
//

import UIKit
import STBaseProject

class STTestViewController: STBaseViewController {

@IBOutlet weak var heightConstraint: NSLayoutConstraint!
@IBOutlet weak var tpConstraint: NSLayoutConstraint!
@IBOutlet weak var nameLabel: UILabel!


override func viewDidLoad() {
super.viewDidLoad()
print("nameLabel top constraint \(self.tpConstraint.constant) -- height constraint \(self.heightConstraint.constant)")
// Do any additional setup after loading the view.
}


/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/

}
65 changes: 65 additions & 0 deletions Example/STBaseProject/STTestViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="STTestViewController" customModule="STBaseProject_Example" customModuleProvider="target">
<connections>
<outlet property="heightConstraint" destination="TIg-bn-Mrh" id="fvX-nl-uZ8"/>
<outlet property="nameLabel" destination="LJk-Xf-Jyn" id="5hl-zZ-rIW"/>
<outlet property="tpConstraint" destination="i7g-Eb-XAw" id="Zgz-Wv-eUo"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="中华人民共和国" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LJk-Xf-Jyn">
<rect key="frame" x="0.0" y="100" width="320" height="21"/>
<color key="backgroundColor" systemColor="linkColor"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="TIg-bn-Mrh">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdapterFont" value="YES"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="LJk-Xf-Jyn" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="NhI-aa-FQH"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="LJk-Xf-Jyn" secondAttribute="trailing" id="R2C-Lj-iJq"/>
<constraint firstItem="LJk-Xf-Jyn" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="100" id="i7g-Eb-XAw">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
</constraints>
<point key="canvasLocation" x="138.75" y="153.16901408450704"/>
</view>
</objects>
<resources>
<systemColor name="linkColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
2 changes: 1 addition & 1 deletion Example/STBaseProject/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ViewController: STBaseViewController {

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
let nextVC = STNextViewController()
let nextVC = STTestViewController.init(nibName: "STTestViewController", bundle: nil)
self.navigationController?.pushViewController(nextVC, animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension UILabel {
@IBInspectable open var isAdapterFont: Bool {
set {
let fontName = self.font.fontName
let adapterSize = self.font.pointSize
let adapterSize = self.font.pointSize * STConstants.st_multiplier()
self.font = UIFont.st_systemFont(ofSize: adapterSize, fontName: fontName)
}
get {
Expand Down