diff --git a/Example/STBaseProject.xcodeproj/project.pbxproj b/Example/STBaseProject.xcodeproj/project.pbxproj index e26027c..0d15cef 100644 --- a/Example/STBaseProject.xcodeproj/project.pbxproj +++ b/Example/STBaseProject.xcodeproj/project.pbxproj @@ -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 */ @@ -47,6 +49,8 @@ BCBDD6C1F1A3F9746985EE4C /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; D130156922DC92BC00D5216C /* STBaseProject-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "STBaseProject-Bridging-Header.h"; sourceTree = ""; }; 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 = ""; }; + E454C6BF25C293E800B98363 /* STTestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STTestViewController.swift; sourceTree = ""; }; + E454C6C025C293E800B98363 /* STTestViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = STTestViewController.xib; sourceTree = ""; }; E46045BD23CD9A7F00D4AA81 /* STTestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STTestView.swift; sourceTree = ""; }; E4FEB62725A6FD680055D834 /* STNextViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STNextViewController.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -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 */, ); @@ -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; }; @@ -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; }; diff --git a/Example/STBaseProject/STTestViewController.swift b/Example/STBaseProject/STTestViewController.swift new file mode 100644 index 0000000..0d06f34 --- /dev/null +++ b/Example/STBaseProject/STTestViewController.swift @@ -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. + } + */ + +} diff --git a/Example/STBaseProject/STTestViewController.xib b/Example/STBaseProject/STTestViewController.xib new file mode 100644 index 0000000..81aec2b --- /dev/null +++ b/Example/STBaseProject/STTestViewController.xib @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/STBaseProject/ViewController.swift b/Example/STBaseProject/ViewController.swift index c2f79bc..2a68331 100644 --- a/Example/STBaseProject/ViewController.swift +++ b/Example/STBaseProject/ViewController.swift @@ -33,7 +33,7 @@ class ViewController: STBaseViewController { override func touchesBegan(_ touches: Set, 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) } diff --git a/STBaseProject/Classes/STBaseModule/STCommon/STIBInspectable.swift b/STBaseProject/Classes/STBaseModule/STCommon/STIBInspectable.swift index cb90ac1..1fd22fb 100644 --- a/STBaseProject/Classes/STBaseModule/STCommon/STIBInspectable.swift +++ b/STBaseProject/Classes/STBaseModule/STCommon/STIBInspectable.swift @@ -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 {