小编Bes*_*sat的帖子

密码自动填充快速键在ios 11中

在ios 11中引入了一项新功能:用于app的密码自动填充功能.此功能允许用户直接通过键盘快速键栏在他们的应用程序中使用他们保存的密码.

https://techcrunch.com/2017/06/08/ios-11s-new-password-autofill-for-apps-wont-work-with-or-replace-your-favorite-password-manager/

https://code.tutsplus.com/articles/faster-logins-with-password-autofill-in-ios-11--cms-29096

https://developer.apple.com/videos/play/wwdc2017/206/

但问题是当我使用keyboardWillShow或keyboardWillHide或keyboardDidShow或keyboardDidHide事件时,他们都没有考虑keyboardSize的快速栏高度.

- (void)keyboardWillShow:(NSNotification *)notification {
    NSDictionary* info = [notification userInfo];
    CGSize keyboardSize = [info[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
}
Run Code Online (Sandbox Code Playgroud)

keyboardSize将是之前的keyboardSize,所以如果我们有快速栏并且现在它已经消失了,那么keyboardSize比它应该更多,反之亦然.似乎在Quickbar show/hide之前会触发keyboardWillShow通知.

如果有人知道如何在快速栏显示/隐藏或任何其他建议后触发键盘通知,请分享.

谢谢..

objective-c ios ios11

10
推荐指数
2
解决办法
1390
查看次数

这在箭头函数中是未定义的

我想在我的箭头函数中访问它:

import myObject from '../myObjectPath';
export const myClass = Fluxxor.createStore({
    initialize() {
        this.list = [];
        this.id = null;
    },
    myOutsideFunction(variable1) {
        // here this in NOT undefined
        myObject.getMyList(this.id, (myList) => {
            // here this in undefined
            this.list = myList;
        } 
    });
)};
Run Code Online (Sandbox Code Playgroud)

但是内部的箭头功能在ma回调函数中这是未定义的!!

我正在使用babel来传输代码:

myOutsideFunction: function myOutsideFunction() {
    var _this = this;
    myObject.getMyList(function (myList) {
        _this.list = myList;
    });
},
Run Code Online (Sandbox Code Playgroud)

javascript this undefined arrow-functions

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

如何在erlang中读取mnesia数据库的所有记录?

我是erlang中的新手,我需要对从mnesia数据库获得的所有记录进行一些操作.

Result = mnesia:dirty_read(mydatabase, {key1, key2}),
        case Result of 
            [] ->
                ?DEBUG("No such record found", []);
            [#mydatabase{key3 = Key3}] ->
                %% some operations
        end
Run Code Online (Sandbox Code Playgroud)

如何为我的代码添加一个循环,为所有记录执行一些操作?

我甚至不确定上面的代码是否做到了?

erlang mnesia

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

从 Swift 错误调用 Objective-C 方法

当我尝试从 swift 调用 Objective-C 方法时出现错误。我的 Objective-c .h 类:

@class myType;
@interface myClass : NSObject
- (myType *)myMethod;
Run Code Online (Sandbox Code Playgroud)

然后我将创建一个 myClass 对象并尝试在 swift 中调用 myMethod (我已经声明了 myClass 类型的一个对象):

let a = anObject.myMethod();
Run Code Online (Sandbox Code Playgroud)

但我收到错误:“myClass”类型的值没有成员“myMethod”如果我将 myType 更改为其他内容,错误就会消失。所以应该是swift中无法识别myType的问题..

我很感激任何帮助

objective-c swift

4
推荐指数
1
解决办法
1699
查看次数

二郎.如何将值重新分配给字符串

我是Erlang的新手.我只想将值重新赋值给字符串变量:

get_alert_body(Packet) ->
    BodyElement = element(8,Packet),
    Body = "my text",
    Els = xmpp:get_els(Packet),
    lists:foreach(fun(El) ->
        ElementName = io_lib:format("~s",[xmpp:get_name(El)]),
        IsFile = string:equal(ElementName,"fileType"),
        if
            IsFile ->
                FileType = fxml:get_tag_cdata(El),
                IsPhoto = string:equal(FileType,"photo"),
                IsVideo = string:equal(FileType,"video"),
                if
                    IsPhoto ->
                        %% if it gets to this I would like to return "my photo"
                        Body = "my photo";
                    IsVideo ->
                        %% else if it gets to this I would like to return "my video"
                        Body = "my video";
                    true ->
                        %% otherwise I would like …
Run Code Online (Sandbox Code Playgroud)

string erlang

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