小编RJ1*_*168的帖子

在带有消息的远程通知中显示超链接

我需要在远程通知中显示超链接以及标题和正文。我做过这样的事情:

@IBAction func openPDFButtonPressed(_ sender: Any) {
    self.scheduleNotification()         
}

func scheduleNotification() {
    let center = UNUserNotificationCenter.current()

    let content = UNMutableNotificationContent()
    content.title = "Download The Receipt"
    content.body = "Kindly Download your purchase bill"
    content.categoryIdentifier = "PDF"
    content.userInfo = ["customData": "http://www.pdf995.com/samples/pdf.pdf"]
    content.sound = UNNotificationSound.default

    var dateComponents = DateComponents()
    dateComponents.hour = 10
    dateComponents.minute = 30
    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)

    let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)
    center.add(request)
}  

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c ios rich-notifications swift

7
推荐指数
1
解决办法
232
查看次数

无法在没有建立连接的情况下确定接口类型 Xcode

我在我的项目中添加了一个自定义框架,但是当我运行该项目时,屏幕变黑并出现以下错误

日志: "unable to determine interface type without an established connection" &" unable to determine fallback status without a connection"

ios swift

7
推荐指数
1
解决办法
7392
查看次数

自定义 UIButton imageEdgeInsets/titleEdgeInsets 不起作用

和不适用于我的自定义imegEdgeInsets课程。我通过笔尖设置插图titleEdgeInsetsUIButton

在此输入图像描述

在此输入图像描述

自定义UIButton类代码

class FilledButton: kButton {
    private var bgColor = AppTonalPalette.color(.primary)
    private var bgColorPressed = AppTonalPalette.color(.primary).withAlphaComponent(0.88)
    private var foregroundColor = AppTonalPalette.color(.onPrimary)
    
    private var bgColorDisabled = UIColor.init("#1F1F1F", alpha: 0.12)
    private var foregroundColorDisabled = AppTonalPalette.color(.onSurface)
    
    override func layoutSubviews() {
        super.layoutSubviews()
        updateViews()
    }
    
    func updateViews() {
        tintColor = isEnabled ? foregroundColor : foregroundColorDisabled
        setTitleColor(isEnabled ? foregroundColor : foregroundColorDisabled, for: .normal)
        setTitleColor(isEnabled ? foregroundColor : foregroundColorDisabled, for: .highlighted)
        backgroundColor = isEnabled ? (isHighlighted ? bgColorPressed : bgColor) …
Run Code Online (Sandbox Code Playgroud)

uibutton ios swift

6
推荐指数
1
解决办法
2636
查看次数

如何在iPhone中使用AM/PM格式打印时间?

我想从日期选择器打印时间,但是使用AM/PM.我可以打印时间,但它从不打印AM/PM.我怎样才能做到这一点?

iphone objective-c nsdate nsdateformatter

5
推荐指数
2
解决办法
1万
查看次数

如何在XCode中将库与"-force_load"链接?

我的其他库不允许我设置-ObjC或all_load标志.所以我需要使用-force_load链接我的库.

我的项目下有"GoogleOpenSource.framework"和"GooglePlus.framework",所以如何正确地将这些映射到工作中.

我设置了这样的路径:

-force_load $(PROJECT_DIR)/Project_name/GooglePlus.framework/Versions/A/Headers/GooglePlus.h

-force_load $(PROJECT_DIR)/Project_name/GoogleOpenSource.framework/Versions/A/Headers/GoogleOpenSource.h
Run Code Online (Sandbox Code Playgroud)

在其他链接器标志下,但它不起作用.

谁能告诉我这里做错了什么?

xcode objective-c linker-flags

5
推荐指数
1
解决办法
5023
查看次数

如何在 Swift 3 中打开 WIFI 设置

我想从我的 iOS 应用程序打开 WIFI 设置部分,我的代码在 Swift 3 和 iOS 9.2 之前运行良好

if let settingsURL = URL(string: AppSettingsWifiUrl) {
    UIApplication.shared.openURL(settingsURL)
}
Run Code Online (Sandbox Code Playgroud)

但是更新后它不适用于 Xcode 8 + Swift 3 + iOS 10,有人可以帮忙吗?

openurl swift3 ios10

5
推荐指数
2
解决办法
9311
查看次数