小编Rom*_*lov的帖子

PLBuildVersion类在两个框架中实现

iOS 10/Xcode 8 GM构建得到以下,从未在Xcode 7上使用过.任何想法?

objc [25161]:类PLBuildVersion在/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices(0x12049a910)中实现和/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices(0x1202c4210).将使用两者之一.哪一个未定义.

(注意:似乎只在模拟器中发生,不会出现在真实设备上).

xcode ios10 xcode8

224
推荐指数
5
解决办法
7万
查看次数

ios10自定义推送通知声音没有播放

我目前正在使用Xcode 8.0 beta 6运行iOS 10 beta 8,并且当我收到具有正确有效负载的推送通知时,自定义声音无法播放.

我已经验证了有效负载,并且每个Apple文档的格式正确:

{
    "aps" : {
        "alert" : "You got your emails.",
        "badge" : 9,
        "sound" : "bingbong.aiff"
    },
    "acme1" : "bar",
    "acme2" : 42
}
Run Code Online (Sandbox Code Playgroud)

当我将相同的有效负载发送到iOS9上的相同版本时,自定义声音可以正常播放.

有谁知道我需要在iOS 10中进行任何其他更改吗?

apple-push-notifications ios10

25
推荐指数
1
解决办法
7188
查看次数

获取一批iOS图片

我想获取iOS设备上固定批量的图片.我正在使用新的Photos Framework,我已经找到了这个解决方法:

PHFetchOptions *allPhotosOptions = [PHFetchOptions new];

allPhotosOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]];

// Fetches all photos -> i would like to fetch only some of them
PHFetchResult *allPhotosResult = [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeImage options:allPhotosOptions];

NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(currentIndex, batch_size)];

// Iterates over a subset of the previously fetched photos
[allPhotosResult enumerateObjectsAtIndexes:indexSet options:0 usingBlock:^(PHAsset *asset, NSUInteger idx, BOOL *stop)
{
    // Do stuff    
}
Run Code Online (Sandbox Code Playgroud)

它工作正常,但我首先获取所有照片,fetchAssetsWithMediaType然后选择我的应用程序加载的结果的子集,这似乎很重...

我想知道是否有一种方法可以批量直接获取照片,而不是全部获取它们然后迭代.此外,如果我能保留上次获取的批次的索引,知道我将在哪里获取下一批次,那将是完美的.

谢谢你的帮助!

performance objective-c photos fetching-strategy ios

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

iOS 10打破自定义CIFilter

我编写了一个抠像滤镜,使MPEG电影的背景透明,这样您就可以将电影文件用于更长的动画,而无需冗长的PNG序列(某些类型的iOS动画通常这样做)。

我正在使用AVPlayerAVVideoComposition和自定义CIFilter来在背景图片上渲染视频。用户可以通过与应用程序进行交互来动态更改背景图片。

直到iOS 10出现,现在它已经坏了,这种方法才能正常工作。

现在发生的事情是视频正在播放,但是没有色度键发生,并且Xcode反复吐出以下错误:

need a swizzler so that YCC420v can be written.
Run Code Online (Sandbox Code Playgroud)

这是CIFilter应产生的图像:

自定义CIFilter工作的结果(iOS 10之前的版本)

相反,这是它产生的结果(自iOS 10起):

CIFilter损坏的结果(iOS 10之后)

这是我的代码中创建EAGLContext和应用自定义的部分CIFilter

    let myEAGLContext = EAGLContext.init(API: EAGLRenderingAPI.OpenGLES2)
    //let cicontext = CIContext.init(EAGLContext: myEAGLContext, options: [kCIContextWorkingColorSpace: NSNull()])
    let cicontext = CIContext.init(EAGLContext: myEAGLContext)

    let filter = ChromaKeyFilter()
    filter.activeColor = CIColor.init(red: 0, green:1.0, blue: 0.0)
    filter.threshold = self.threshold

    //most of below comes from the "WWDC15 What's New In Core Image" slides
    let …
Run Code Online (Sandbox Code Playgroud)

glsl avfoundation cifilter swift ios10

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