我将private void ScrollItems()
{
ScrollToPositionTop(0,0); // It does not scroll to top
}
private void ScrollToPositionTop(double x, double y)
{
DoubleAnimation vertAnim = new DoubleAnimation();
vertAnim.From = mainViewer.VerticalOffset;
vertAnim.To = y;
vertAnim.DecelerationRatio = .2;
vertAnim.Duration = new Duration(TimeSpan.FromMilliseconds(0));
DoubleAnimation horzAnim = new DoubleAnimation();
horzAnim.From = mainViewer.HorizontalOffset;
horzAnim.To = x;
horzAnim.DecelerationRatio = .2;
horzAnim.Duration = new Duration(TimeSpan.FromMilliseconds(0));
sb.Children.Add(vertAnim);
sb.Children.Add(horzAnim);
Storyboard.SetTarget(vertAnim, mainViewer);
Storyboard.SetTargetProperty(vertAnim, new PropertyPath(AniScrollViewer.CurrentVerticalOffsetProperty));
Storyboard.SetTarget(horzAnim, mainViewer);
Storyboard.SetTargetProperty(horzAnim, new PropertyPath(AniScrollViewer.CurrentHorizontalOffsetProperty));
sb.Begin(this);
}
安装到我的项目中,Mixpanel
不再有效,并且在所有方法中都显示此错误:
使用未解析的标识符' AFHTTPRequestOperationManager'
但是Xcode已经链接到方法中的类,我尝试了AFNetworking
,pod install
,清理了项目,但它没有工作
在PodFile中:
pod update
在Bridging-Header中:
target 'My Project' do
pod 'AFNetworking'
pod 'Mixpanel'
end
target 'Mi ProjectTests' do
end
,最后一个错误显示是:
#import <AFNetworking.h>
#import <Mixpanel/Mixpanel.h>
答案 0 :(得分:3)
到AFNetworking 3.0版本:
let manager = AFHTTPSessionManager()
要解决上一个错误,请转到Build Settings
,Other Linker Flags
并删除除$(inherited)
以外的所有错误
答案 1 :(得分:2)
我将pod更新到最新版本的AFNetworking后,我遇到了同样的问题。再也没有AFHTTPRequestOperationManager,所以请尝试调用它:
let manager = AFHTTPSessionManager()
带有进度的上传任务,在 swift 3.0 中如下:
let request = URLRequest(url: URL(string: "http://example.com/your/url")!)
manager.uploadTask(with: request, from: userData, progress: { (progress: Progress) in
// progress catching
}) { (response: URLResponse, object: Any?, error: Error?) in
// work with response
}
答案 2 :(得分:-1)
如果您已正确安装了pod,只需导入AFNetworking:
import UIKit
import AFNetworking