|
@@ -37,18 +37,19 @@ class KMComparativeView: KMBaseXibView {
|
|
|
[
|
|
|
"type": 0,
|
|
|
"title": "Registered",
|
|
|
- "subtitle": "Free",
|
|
|
+ "subtitle": "Free Plan",
|
|
|
+ "describe": "Simply log in and get benefits.",
|
|
|
"content": [
|
|
|
- ["title": "Basic functions like annotation and viewing",
|
|
|
- "state": true],
|
|
|
- ["title": "Convert PDF to Office (Only first ten pages)",
|
|
|
- "state": true],
|
|
|
- ["title": "Save without watermark",
|
|
|
- "state": false],
|
|
|
["title": "AI translate, rewrite, correction",
|
|
|
- "state": false]
|
|
|
+ "state": 0],
|
|
|
+ ["title": "Save without watermark",
|
|
|
+ "state": 0],
|
|
|
+ ["title": "Convert with 10 pages per file",
|
|
|
+ "state": 2],
|
|
|
+ ["title": "Basic functions like annotation and viewing",
|
|
|
+ "state": 2]
|
|
|
],
|
|
|
- "buttonTitle": "Sign up for Free"
|
|
|
+ "buttonTitle": "Free Trial"
|
|
|
],
|
|
|
[
|
|
|
"type": 1,
|
|
@@ -57,16 +58,16 @@ class KMComparativeView: KMBaseXibView {
|
|
|
"describe": "Save 50%@ for the first year, auto-renew at %@. Billed yearly.",
|
|
|
"productId": PRODUCT_1,
|
|
|
"content": [
|
|
|
- ["title": "Enjoy all premium features",
|
|
|
- "state": true],
|
|
|
- ["title": "Convert PDF to Office without limitation",
|
|
|
- "state": true],
|
|
|
- ["title": "Save without watermark",
|
|
|
- "state": true],
|
|
|
["title": "AI translate, rewrite, correction",
|
|
|
- "state": true]
|
|
|
+ "state": 1],
|
|
|
+ ["title": "Save without watermark",
|
|
|
+ "state": 1],
|
|
|
+ ["title": "Convert PDF to Office without limitation",
|
|
|
+ "state": 1],
|
|
|
+ ["title": "Unlock all premium features",
|
|
|
+ "state": 1]
|
|
|
],
|
|
|
- "buttonTitle": "Subscribe Now"
|
|
|
+ "buttonTitle": "Buy Now"
|
|
|
]
|
|
|
]
|
|
|
|
|
@@ -124,34 +125,8 @@ class KMComparativeView: KMBaseXibView {
|
|
|
}
|
|
|
|
|
|
override func updateLanguage() {
|
|
|
-// + " " + NSLocalizedString("Subscription", comment: ""
|
|
|
self.restoreButton.title = NSLocalizedString("Restore Purchases", comment: "")
|
|
|
self.titleLabel.stringValue = NSLocalizedString("Upgrade to Use All Features", comment: "")
|
|
|
-
|
|
|
-// let string = NSLocalizedString("""
|
|
|
-//Payment will be charged to your Apple ID account at the confirmation of purchase.
|
|
|
-//Subscription automatically renews unless it is canceled at least 24 hours before
|
|
|
-//the end of the current period. Your account will be charged for renewal within 24
|
|
|
-//hours prior to the end of the current period. You can manage and cancel your
|
|
|
-//subscriptions by going to your account settings on the App Store after purchase.
|
|
|
-//""", comment: "")
|
|
|
-// let attributedString = NSMutableAttributedString.init(string: string)
|
|
|
-// let paragraphStyle = NSMutableParagraphStyle()
|
|
|
-// paragraphStyle.alignment = .left;
|
|
|
-// paragraphStyle.lineHeightMultiple = 1.37
|
|
|
-// attributedString.addAttributes([NSAttributedString.Key.font : NSFont.SFProTextRegular(11.0),
|
|
|
-// NSAttributedString.Key.foregroundColor : NSColor(hex: "#94989C"),
|
|
|
-// NSAttributedString.Key.paragraphStyle : paragraphStyle],
|
|
|
-// range: NSRange(location: 0, length: string.count))
|
|
|
-//
|
|
|
-//// let range = string.range(of: NSLocalizedString("Subscription", comment: ""))
|
|
|
-//// attributedString.setAttributes([NSAttributedString.Key.font : NSFont.SFProTextRegular(12.0),
|
|
|
-//// NSAttributedString.Key.foregroundColor : NSColor(hex: "#1770F4"),
|
|
|
-//// NSAttributedString.Key.underlineColor : NSColor.clear,
|
|
|
-//// NSAttributedString.Key.link : "register://"],
|
|
|
-//// range: string.nsRange(from: range!)!)
|
|
|
-//
|
|
|
-// self.textView.textStorage?.setAttributedString(attributedString)
|
|
|
}
|
|
|
|
|
|
override func reloadData() {
|
|
@@ -163,17 +138,6 @@ class KMComparativeView: KMBaseXibView {
|
|
|
}
|
|
|
|
|
|
@IBAction func infoButtonAction(_ sender: Any) {
|
|
|
-// let contentViewController = NSViewController()
|
|
|
-// contentViewController.view = NSView(frame: NSRect(x: 0, y: 0, width: 200, height: 100))
|
|
|
-// contentViewController.view.wantsLayer = true
|
|
|
-// contentViewController.view.layer?.backgroundColor = NSColor(hex:"#36383B").cgColor
|
|
|
-// contentViewController.title =
|
|
|
-//
|
|
|
-// let popover = NSPopover()
|
|
|
-// popover.contentViewController = contentViewController
|
|
|
-// popover.behavior = .transient
|
|
|
-// popover.setValue(true, forKey: "shouldHideAnchor")
|
|
|
-// popover.show(relativeTo: infoButton.bounds, of: infoButton, preferredEdge: .maxX)
|
|
|
self.showPopover(sender)
|
|
|
}
|
|
|
|
|
@@ -186,20 +150,18 @@ class KMComparativeView: KMBaseXibView {
|
|
|
}
|
|
|
|
|
|
func setupPopover() {
|
|
|
- let string: NSString = NSLocalizedString("""
|
|
|
- Payment will be charged to your Apple ID account at the confirmation of purchase.
|
|
|
- Subscription automatically renews unless it is canceled at least 24 hours before
|
|
|
- the end of the current period. Your account will be charged for renewal within 24
|
|
|
- hours prior to the end of the current period. You can manage and cancel your
|
|
|
- subscriptions by going to your account settings on the App Store after purchase.
|
|
|
- """, comment: "") as NSString
|
|
|
+ let string: NSString = NSLocalizedString(
|
|
|
+"""
|
|
|
+Payment will be charged to your Apple ID account at the confirmation of purchase.\nSubscription automatically renews unless it is canceled at least 24 hours before the end of the current period. Your account will be charged for renewal within 24 hours prior to the end of the current period. You can manage and cancel your subscriptions by going to your account settings on the App Store after purchase.
|
|
|
+"""
|
|
|
+ , comment: "") as NSString
|
|
|
|
|
|
let paragraphStyle = NSMutableParagraphStyle()
|
|
|
paragraphStyle.lineHeightMultiple = 1.4
|
|
|
paragraphStyle.alignment = .left
|
|
|
let attributes = [NSAttributedString.Key.font : NSFont.SFProTextRegular(12), NSAttributedString.Key.paragraphStyle : paragraphStyle]
|
|
|
- let size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 400), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
|
|
|
-
|
|
|
+ var size: NSSize = string.boundingRect(with: NSSize(width: 420, height: 600), options: NSString.DrawingOptions(rawValue: 3), attributes: attributes).size
|
|
|
+ size = CGSize(width: size.width, height: size.height + 30)
|
|
|
|
|
|
popover.behavior = .transient
|
|
|
popover.setValue(true, forKey: "shouldHideAnchor")
|
|
@@ -214,6 +176,7 @@ class KMComparativeView: KMBaseXibView {
|
|
|
textField.drawsBackground = false
|
|
|
textField.isEditable = false
|
|
|
textField.isSelectable = false
|
|
|
+ textField.lineBreakMode = .byCharWrapping
|
|
|
textField.textColor = NSColor(hex: "#FFFFFF")
|
|
|
|
|
|
popover.contentViewController?.view.addSubview(textField)
|