Skip to content

Commit 570796d

Browse files
author
shangkun
committed
update new .dmg file
1 parent 4187180 commit 570796d

File tree

5 files changed

+49
-15
lines changed

5 files changed

+49
-15
lines changed

SKGenerateModelTool.dmg

15.7 KB
Binary file not shown.

SKGenerateModelTool.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
BC6E5D5224C0770800809D98 /* EncryptExampleModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6E5D5124C0770800809D98 /* EncryptExampleModel.m */; };
11+
BC874A1A250A238C00F3A346 /* SKTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC874A19250A238C00F3A346 /* SKTextView.swift */; };
1112
BC88CEA12467A8A600A4828B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC88CEA02467A8A600A4828B /* AppDelegate.swift */; };
1213
BC88CEA32467A8A600A4828B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC88CEA22467A8A600A4828B /* ViewController.swift */; };
1314
BC88CEA52467A8AA00A4828B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BC88CEA42467A8AA00A4828B /* Assets.xcassets */; };
@@ -21,6 +22,7 @@
2122
BC6E5BD824C071EE00809D98 /* SKEncryptHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKEncryptHeader.h; sourceTree = "<group>"; };
2223
BC6E5D5024C0770800809D98 /* EncryptExampleModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EncryptExampleModel.h; sourceTree = "<group>"; };
2324
BC6E5D5124C0770800809D98 /* EncryptExampleModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EncryptExampleModel.m; sourceTree = "<group>"; };
25+
BC874A19250A238C00F3A346 /* SKTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKTextView.swift; sourceTree = "<group>"; };
2426
BC88CE9D2467A8A600A4828B /* SKGenerateModelTool.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SKGenerateModelTool.app; sourceTree = BUILT_PRODUCTS_DIR; };
2527
BC88CEA02467A8A600A4828B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2628
BC88CEA22467A8A600A4828B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -69,6 +71,7 @@
6971
BCB184B224B808AF00C2A5D3 /* SKEncryptString */,
7072
BCB6929E24A2EC8F004AC91A /* EncryptionController.swift */,
7173
BC88D01D2467C2AA00A4828B /* SKCodeBuilder.swift */,
74+
BC874A19250A238C00F3A346 /* SKTextView.swift */,
7275
BC88CEA42467A8AA00A4828B /* Assets.xcassets */,
7376
BC88CEA62467A8AA00A4828B /* Main.storyboard */,
7477
BC88CEA92467A8AA00A4828B /* Info.plist */,
@@ -161,6 +164,7 @@
161164
buildActionMask = 2147483647;
162165
files = (
163166
BC6E5D5224C0770800809D98 /* EncryptExampleModel.m in Sources */,
167+
BC874A1A250A238C00F3A346 /* SKTextView.swift in Sources */,
164168
BCB6929F24A2EC8F004AC91A /* EncryptionController.swift in Sources */,
165169
BC88D01E2467C2AA00A4828B /* SKCodeBuilder.swift in Sources */,
166170
BC88CEA32467A8A600A4828B /* ViewController.swift in Sources */,

SKGenerateModelTool/Base.lproj/Main.storyboard

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097.2"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097.3"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
</dependencies>
88
<scenes>
@@ -821,22 +821,13 @@
821821
<rect key="frame" x="0.0" y="0.0" width="522" height="632"/>
822822
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
823823
<subviews>
824-
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="bar" incrementalSearchingEnabled="YES" spellingCorrection="YES" smartInsertDelete="YES" id="aic-72-SvK">
824+
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="bar" incrementalSearchingEnabled="YES" spellingCorrection="YES" smartInsertDelete="YES" id="aic-72-SvK" customClass="SKTextView" customModule="SKGenerateModelTool" customModuleProvider="target">
825825
<rect key="frame" x="0.0" y="0.0" width="522" height="632"/>
826826
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
827-
<color key="textColor" name="placeholderTextColor" catalog="System" colorSpace="catalog"/>
827+
<color key="textColor" red="0.016804177310000001" green="0.19835099580000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
828828
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
829829
<size key="minSize" width="522" height="632"/>
830830
<size key="maxSize" width="585" height="10000000"/>
831-
<attributedString key="textStorage">
832-
<fragment content="Input json here...">
833-
<attributes>
834-
<color key="NSColor" name="placeholderTextColor" catalog="System" colorSpace="catalog"/>
835-
<font key="NSFont" size="15" name="PingFangSC-Regular"/>
836-
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
837-
</attributes>
838-
</fragment>
839-
</attributedString>
840831
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
841832
</textView>
842833
</subviews>

SKGenerateModelTool/SKTextView.swift

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// SKTextView.swift
3+
// SKGenerateModelTool
4+
//
5+
// Created by shangkun on 2020/9/10.
6+
// Copyright © 2020 wushangkun. All rights reserved.
7+
//
8+
9+
import Cocoa
10+
11+
class SKTextView: NSTextView {
12+
13+
var placeHolderAttriStr: NSAttributedString?
14+
15+
required init?(coder: NSCoder) {
16+
super.init(coder: coder)
17+
let attributes = [NSAttributedString.Key.foregroundColor : NSColor.placeholderTextColor, NSAttributedString.Key.font : NSFont.systemFont(ofSize: 15)]
18+
placeHolderAttriStr = NSAttributedString(string: "Input json here...", attributes: attributes)
19+
}
20+
21+
override func draw(_ dirtyRect: NSRect) {
22+
super.draw(dirtyRect)
23+
// Drawing code here.
24+
if self.string.isEmpty {
25+
placeHolderAttriStr?.draw(at: NSPoint(x: 4, y: 0))
26+
}
27+
}
28+
29+
override func becomeFirstResponder() -> Bool {
30+
self.setNeedsDisplay(self.bounds)
31+
self.font = NSFont.systemFont(ofSize: 15)
32+
return super.becomeFirstResponder()
33+
}
34+
35+
override func resignFirstResponder() -> Bool {
36+
self.setNeedsDisplay(self.bounds)
37+
self.font = NSFont.systemFont(ofSize: 15)
38+
return super.resignFirstResponder()
39+
}
40+
41+
}

SKGenerateModelTool/ViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ class ViewController: NSViewController, NSControlTextEditingDelegate {
6565
loadUserLastInputContent()
6666
}
6767

68-
// MARK: - IBAction
69-
7068
/// GET / POST request URL
7169

7270
@IBAction func requestURLBtnClicked(_ sender: NSButton) {

0 commit comments

Comments
 (0)