Skip to content

Commit bf8233b

Browse files
committed
WIP Swift conversio
Signed-off-by: Joseph Mattiello <[email protected]>
1 parent 9497152 commit bf8233b

15 files changed

+3991
-116
lines changed

PINCache.xcodeproj/project.pbxproj

+100-74
Large diffs are not rendered by default.

PINCache.xcodeproj/xcshareddata/xcschemes/PINCache-macOS.xcscheme

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "CC0105CD1E271A4900890935"
34+
BuildableName = "PINCache.framework"
35+
BlueprintName = "PINCache-macOS"
36+
ReferencedContainer = "container:PINCache.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -39,17 +48,6 @@
3948
</BuildableReference>
4049
</TestableReference>
4150
</Testables>
42-
<MacroExpansion>
43-
<BuildableReference
44-
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "CC0105CD1E271A4900890935"
46-
BuildableName = "PINCache.framework"
47-
BlueprintName = "PINCache-macOS"
48-
ReferencedContainer = "container:PINCache.xcodeproj">
49-
</BuildableReference>
50-
</MacroExpansion>
51-
<AdditionalOptions>
52-
</AdditionalOptions>
5351
</TestAction>
5452
<LaunchAction
5553
buildConfiguration = "Debug"
@@ -70,8 +68,6 @@
7068
ReferencedContainer = "container:PINCache.xcodeproj">
7169
</BuildableReference>
7270
</MacroExpansion>
73-
<AdditionalOptions>
74-
</AdditionalOptions>
7571
</LaunchAction>
7672
<ProfileAction
7773
buildConfiguration = "Release"

PINCache.xcodeproj/xcshareddata/xcschemes/PINCache-tvOS.xcscheme

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "CC0105C01E271A4000890935"
34+
BuildableName = "PINCache.framework"
35+
BlueprintName = "PINCache-tvOS"
36+
ReferencedContainer = "container:PINCache.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -39,17 +48,6 @@
3948
</BuildableReference>
4049
</TestableReference>
4150
</Testables>
42-
<MacroExpansion>
43-
<BuildableReference
44-
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "CC0105C01E271A4000890935"
46-
BuildableName = "PINCache.framework"
47-
BlueprintName = "PINCache-tvOS"
48-
ReferencedContainer = "container:PINCache.xcodeproj">
49-
</BuildableReference>
50-
</MacroExpansion>
51-
<AdditionalOptions>
52-
</AdditionalOptions>
5351
</TestAction>
5452
<LaunchAction
5553
buildConfiguration = "Debug"
@@ -70,8 +68,6 @@
7068
ReferencedContainer = "container:PINCache.xcodeproj">
7169
</BuildableReference>
7270
</MacroExpansion>
73-
<AdditionalOptions>
74-
</AdditionalOptions>
7571
</LaunchAction>
7672
<ProfileAction
7773
buildConfiguration = "Release"

PINCache.xcodeproj/xcshareddata/xcschemes/PINCache.xcscheme

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1100"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "CC0105B01E271A1600890935"
34+
BuildableName = "PINCache.framework"
35+
BlueprintName = "PINCache"
36+
ReferencedContainer = "container:PINCache.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -39,17 +48,6 @@
3948
</BuildableReference>
4049
</TestableReference>
4150
</Testables>
42-
<MacroExpansion>
43-
<BuildableReference
44-
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "CC0105B01E271A1600890935"
46-
BuildableName = "PINCache.framework"
47-
BlueprintName = "PINCache"
48-
ReferencedContainer = "container:PINCache.xcodeproj">
49-
</BuildableReference>
50-
</MacroExpansion>
51-
<AdditionalOptions>
52-
</AdditionalOptions>
5351
</TestAction>
5452
<LaunchAction
5553
buildConfiguration = "Debug"
@@ -70,8 +68,6 @@
7068
ReferencedContainer = "container:PINCache.xcodeproj">
7169
</BuildableReference>
7270
</MacroExpansion>
73-
<AdditionalOptions>
74-
</AdditionalOptions>
7571
</LaunchAction>
7672
<ProfileAction
7773
buildConfiguration = "Release"

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
# PINCache
22

3+
## TODO:
4+
5+
- replace convenice inits with default value inits
6+
- typed generic caches with defaults of String or NSString
7+
- More subscript uses?
8+
- allow objc subclassing?
9+
- check all enum and error types for objc
10+
- replace operatoin queues with dispatch?
11+
- swift 5.1 use property wrappers to replace synchronouslyLockFileAccessWhileExecuting
12+
313
[![CocoaPods](https://img.shields.io/cocoapods/v/PINCache.svg)](http://cocoadocs.org/docsets/PINCache/)
414
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
515
[![Build status](https://badge.buildkite.com/03e247305c96c3371f2ff2766e9c8c1efdd5fdb3a7eceaff43.svg?branch=master&style=flat)](https://buildkite.com/pinterest/pincache)
616

17+
## PINCache.swift
18+
19+
TODO: Why...
20+
721
## Fast, non-deadlocking parallel object cache for iOS and OS X.
822

923
[PINCache](Source/PINCache.h) is a fork of [TMCache](https://github.com/tumblr/TMCache) re-architected to fix issues with deadlocking caused by heavy use. It is a key/value store designed for persisting temporary objects that are expensive to reproduce, such as downloaded data or the results of slow processing. It is comprised of two self-similar stores, one in memory ([PINMemoryCache](Source/PINMemoryCache.h)) and one on disk ([PINDiskCache](Source/PINDiskCache.h)), all backed by GCD and safe to access from multiple threads simultaneously. On iOS, `PINMemoryCache` will clear itself when the app receives a memory warning or goes into the background. Objects stored in `PINDiskCache` remain until you trim the cache yourself, either manually or by setting a byte or age limit.

Source/PINCache.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#import <PINCache/PINDiskCache.h>
1010
#import <PINCache/PINMemoryCache.h>
1111

12+
@class PINMemoryCache;
13+
1214
NS_ASSUME_NONNULL_BEGIN
1315

1416
@class PINCache;

0 commit comments

Comments
 (0)