From cbe71e3a8b1dc0b8829b318065c8e6a56adbe701 Mon Sep 17 00:00:00 2001 From: Alexey Belkevich Date: Fri, 1 Aug 2014 13:27:14 +0300 Subject: [PATCH] Added example app in Swift --- .../contents.xcworkspacedata | 7 - .../AddressBook.xcodeproj/project.pbxproj | 58 +-- .../AddressBook/AddressBook-Info.plist | 0 .../AddressBook/AddressBook-Prefix.pch | 0 .../Objective-C}/AddressBook/AppDelegate.h | 0 .../Objective-C}/AddressBook/AppDelegate.m | 0 .../AddressBook/ContactTableViewCell.h | 0 .../AddressBook/ContactTableViewCell.m | 0 .../AddressBook/ContactTableViewCell.xib | 0 .../AppIcon.appiconset/Contents.json | 0 .../LaunchImage.launchimage/Contents.json | 0 .../no_photo.imageset/Contents.json | 0 .../no_photo.imageset/no_photo.png | Bin .../no_photo.imageset/no_photo@2x.png | Bin .../AddressBook/ListViewController.h | 0 .../AddressBook/ListViewController.m | 0 .../AddressBook/Storyboard.storyboard | 0 .../AddressBook/en.lproj/InfoPlist.strings | 0 .../Objective-C}/AddressBook/main.m | 0 {AddressBook => Example/Objective-C}/Podfile | 0 .../Objective-C}/Podfile.lock | 0 .../AddressBook.xcodeproj/project.pbxproj | 421 ++++++++++++++++++ Example/Swift/AddressBook/AppDelegate.swift | 46 ++ .../AddressBook/Base.lproj/Main.storyboard | 73 +++ Example/Swift/AddressBook/Bridging.h | 12 + .../AppIcon.appiconset/Contents.json | 23 + .../LaunchImage.launchimage/Contents.json | 23 + Example/Swift/AddressBook/Info.plist | 38 ++ Example/Swift/AddressBook/TableViewCell.swift | 43 ++ .../Swift/AddressBook/ViewController.swift | 41 ++ Example/Swift/Podfile | 2 + Example/Swift/Podfile.lock | 24 + {Classes => Pod/Core}/APAddress.h | 0 {Classes => Pod/Core}/APAddress.m | 0 {Classes => Pod/Core}/APAddressBook.h | 0 {Classes => Pod/Core}/APAddressBook.m | 0 {Classes => Pod/Core}/APContact.h | 1 + {Classes => Pod/Core}/APContact.m | 0 {Classes => Pod/Core}/APPhoneWithLabel.h | 0 {Classes => Pod/Core}/APPhoneWithLabel.m | 0 {Classes => Pod/Core}/APTypes.h | 0 Pod/Swift/APAddressBook-Bridging.h | 15 + 42 files changed, 791 insertions(+), 36 deletions(-) delete mode 100644 AddressBook/AddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename {AddressBook => Example/Objective-C}/AddressBook.xcodeproj/project.pbxproj (90%) rename {AddressBook => Example/Objective-C}/AddressBook/AddressBook-Info.plist (100%) rename {AddressBook => Example/Objective-C}/AddressBook/AddressBook-Prefix.pch (100%) rename {AddressBook => Example/Objective-C}/AddressBook/AppDelegate.h (100%) rename {AddressBook => Example/Objective-C}/AddressBook/AppDelegate.m (100%) rename {AddressBook => Example/Objective-C}/AddressBook/ContactTableViewCell.h (100%) rename {AddressBook => Example/Objective-C}/AddressBook/ContactTableViewCell.m (100%) rename {AddressBook => Example/Objective-C}/AddressBook/ContactTableViewCell.xib (100%) rename {AddressBook => Example/Objective-C}/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename {AddressBook => Example/Objective-C}/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json (100%) rename {AddressBook => Example/Objective-C}/AddressBook/Images.xcassets/no_photo.imageset/Contents.json (100%) rename {AddressBook => Example/Objective-C}/AddressBook/Images.xcassets/no_photo.imageset/no_photo.png (100%) rename {AddressBook => Example/Objective-C}/AddressBook/Images.xcassets/no_photo.imageset/no_photo@2x.png (100%) rename {AddressBook => Example/Objective-C}/AddressBook/ListViewController.h (100%) rename {AddressBook => Example/Objective-C}/AddressBook/ListViewController.m (100%) rename {AddressBook => Example/Objective-C}/AddressBook/Storyboard.storyboard (100%) rename {AddressBook => Example/Objective-C}/AddressBook/en.lproj/InfoPlist.strings (100%) rename {AddressBook => Example/Objective-C}/AddressBook/main.m (100%) rename {AddressBook => Example/Objective-C}/Podfile (100%) rename {AddressBook => Example/Objective-C}/Podfile.lock (100%) create mode 100644 Example/Swift/AddressBook.xcodeproj/project.pbxproj create mode 100644 Example/Swift/AddressBook/AppDelegate.swift create mode 100644 Example/Swift/AddressBook/Base.lproj/Main.storyboard create mode 100644 Example/Swift/AddressBook/Bridging.h create mode 100644 Example/Swift/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/Swift/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 Example/Swift/AddressBook/Info.plist create mode 100644 Example/Swift/AddressBook/TableViewCell.swift create mode 100644 Example/Swift/AddressBook/ViewController.swift create mode 100644 Example/Swift/Podfile create mode 100644 Example/Swift/Podfile.lock rename {Classes => Pod/Core}/APAddress.h (100%) rename {Classes => Pod/Core}/APAddress.m (100%) rename {Classes => Pod/Core}/APAddressBook.h (100%) rename {Classes => Pod/Core}/APAddressBook.m (100%) rename {Classes => Pod/Core}/APContact.h (97%) rename {Classes => Pod/Core}/APContact.m (100%) rename {Classes => Pod/Core}/APPhoneWithLabel.h (100%) rename {Classes => Pod/Core}/APPhoneWithLabel.m (100%) rename {Classes => Pod/Core}/APTypes.h (100%) create mode 100644 Pod/Swift/APAddressBook-Bridging.h diff --git a/AddressBook/AddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AddressBook/AddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 5ad51aa..0000000 --- a/AddressBook/AddressBook.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/AddressBook/AddressBook.xcodeproj/project.pbxproj b/Example/Objective-C/AddressBook.xcodeproj/project.pbxproj similarity index 90% rename from AddressBook/AddressBook.xcodeproj/project.pbxproj rename to Example/Objective-C/AddressBook.xcodeproj/project.pbxproj index 1ac8de9..d6490f0 100644 --- a/AddressBook/AddressBook.xcodeproj/project.pbxproj +++ b/Example/Objective-C/AddressBook.xcodeproj/project.pbxproj @@ -19,10 +19,10 @@ FA662854187FEC7F00667C81 /* ListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA662853187FEC7F00667C81 /* ListViewController.m */; }; FA662862187FFCA700667C81 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA662861187FFCA700667C81 /* AddressBook.framework */; }; FA66286618800DC500667C81 /* ContactTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FA66286518800DC500667C81 /* ContactTableViewCell.m */; }; - FAA78DE0197D27C700E830C7 /* APAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = FAA78DD8197D27C700E830C7 /* APAddress.m */; }; - FAA78DE1197D27C700E830C7 /* APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = FAA78DDA197D27C700E830C7 /* APAddressBook.m */; }; - FAA78DE2197D27C700E830C7 /* APContact.m in Sources */ = {isa = PBXBuildFile; fileRef = FAA78DDC197D27C700E830C7 /* APContact.m */; }; - FAA78DE3197D27C700E830C7 /* APPhoneWithLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = FAA78DDE197D27C700E830C7 /* APPhoneWithLabel.m */; }; + FACA8332198AB2A30059676C /* APAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA832A198AB2A30059676C /* APAddress.m */; }; + FACA8333198AB2A30059676C /* APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA832C198AB2A30059676C /* APAddressBook.m */; }; + FACA8334198AB2A30059676C /* APContact.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA832E198AB2A30059676C /* APContact.m */; }; + FACA8335198AB2A30059676C /* APPhoneWithLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = FACA8330198AB2A30059676C /* APPhoneWithLabel.m */; }; FAD1CCE91881A18900D03475 /* ContactTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = FAD1CCE81881A18900D03475 /* ContactTableViewCell.xib */; }; /* End PBXBuildFile section */ @@ -46,15 +46,15 @@ FA662861187FFCA700667C81 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; FA66286418800DC500667C81 /* ContactTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactTableViewCell.h; sourceTree = ""; }; FA66286518800DC500667C81 /* ContactTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactTableViewCell.m; sourceTree = ""; }; - FAA78DD7197D27C700E830C7 /* APAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddress.h; sourceTree = ""; }; - FAA78DD8197D27C700E830C7 /* APAddress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddress.m; sourceTree = ""; }; - FAA78DD9197D27C700E830C7 /* APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBook.h; sourceTree = ""; }; - FAA78DDA197D27C700E830C7 /* APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBook.m; sourceTree = ""; }; - FAA78DDB197D27C700E830C7 /* APContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContact.h; sourceTree = ""; }; - FAA78DDC197D27C700E830C7 /* APContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContact.m; sourceTree = ""; }; - FAA78DDD197D27C700E830C7 /* APPhoneWithLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APPhoneWithLabel.h; sourceTree = ""; }; - FAA78DDE197D27C700E830C7 /* APPhoneWithLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APPhoneWithLabel.m; sourceTree = ""; }; - FAA78DDF197D27C700E830C7 /* APTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APTypes.h; sourceTree = ""; }; + FACA8329198AB2A30059676C /* APAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddress.h; sourceTree = ""; }; + FACA832A198AB2A30059676C /* APAddress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddress.m; sourceTree = ""; }; + FACA832B198AB2A30059676C /* APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBook.h; sourceTree = ""; }; + FACA832C198AB2A30059676C /* APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBook.m; sourceTree = ""; }; + FACA832D198AB2A30059676C /* APContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContact.h; sourceTree = ""; }; + FACA832E198AB2A30059676C /* APContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContact.m; sourceTree = ""; }; + FACA832F198AB2A30059676C /* APPhoneWithLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APPhoneWithLabel.h; sourceTree = ""; }; + FACA8330198AB2A30059676C /* APPhoneWithLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APPhoneWithLabel.m; sourceTree = ""; }; + FACA8331198AB2A30059676C /* APTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APTypes.h; sourceTree = ""; }; FAD1CCE81881A18900D03475 /* ContactTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactTableViewCell.xib; sourceTree = ""; }; /* End PBXFileReference section */ @@ -77,7 +77,7 @@ FA66280F187FE9EF00667C81 = { isa = PBXGroup; children = ( - FAA78DD6197D27C700E830C7 /* Classes */, + FACA8328198AB2A30059676C /* Classes */, FA662821187FE9EF00667C81 /* AddressBook */, FA66281A187FE9EF00667C81 /* Frameworks */, FA662819187FE9EF00667C81 /* Products */, @@ -181,21 +181,21 @@ name = Cells; sourceTree = ""; }; - FAA78DD6197D27C700E830C7 /* Classes */ = { + FACA8328198AB2A30059676C /* Classes */ = { isa = PBXGroup; children = ( - FAA78DD7197D27C700E830C7 /* APAddress.h */, - FAA78DD8197D27C700E830C7 /* APAddress.m */, - FAA78DD9197D27C700E830C7 /* APAddressBook.h */, - FAA78DDA197D27C700E830C7 /* APAddressBook.m */, - FAA78DDB197D27C700E830C7 /* APContact.h */, - FAA78DDC197D27C700E830C7 /* APContact.m */, - FAA78DDD197D27C700E830C7 /* APPhoneWithLabel.h */, - FAA78DDE197D27C700E830C7 /* APPhoneWithLabel.m */, - FAA78DDF197D27C700E830C7 /* APTypes.h */, + FACA8329198AB2A30059676C /* APAddress.h */, + FACA832A198AB2A30059676C /* APAddress.m */, + FACA832B198AB2A30059676C /* APAddressBook.h */, + FACA832C198AB2A30059676C /* APAddressBook.m */, + FACA832D198AB2A30059676C /* APContact.h */, + FACA832E198AB2A30059676C /* APContact.m */, + FACA832F198AB2A30059676C /* APPhoneWithLabel.h */, + FACA8330198AB2A30059676C /* APPhoneWithLabel.m */, + FACA8331198AB2A30059676C /* APTypes.h */, ); name = Classes; - path = ../Classes; + path = ../../Pod/Core; sourceTree = ""; }; /* End PBXGroup section */ @@ -299,13 +299,13 @@ buildActionMask = 2147483647; files = ( FA66282C187FE9EF00667C81 /* AppDelegate.m in Sources */, - FAA78DE0197D27C700E830C7 /* APAddress.m in Sources */, + FACA8332198AB2A30059676C /* APAddress.m in Sources */, FA66286618800DC500667C81 /* ContactTableViewCell.m in Sources */, FA662828187FE9EF00667C81 /* main.m in Sources */, - FAA78DE3197D27C700E830C7 /* APPhoneWithLabel.m in Sources */, - FAA78DE1197D27C700E830C7 /* APAddressBook.m in Sources */, + FACA8335198AB2A30059676C /* APPhoneWithLabel.m in Sources */, + FACA8333198AB2A30059676C /* APAddressBook.m in Sources */, FA662854187FEC7F00667C81 /* ListViewController.m in Sources */, - FAA78DE2197D27C700E830C7 /* APContact.m in Sources */, + FACA8334198AB2A30059676C /* APContact.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/AddressBook/AddressBook/AddressBook-Info.plist b/Example/Objective-C/AddressBook/AddressBook-Info.plist similarity index 100% rename from AddressBook/AddressBook/AddressBook-Info.plist rename to Example/Objective-C/AddressBook/AddressBook-Info.plist diff --git a/AddressBook/AddressBook/AddressBook-Prefix.pch b/Example/Objective-C/AddressBook/AddressBook-Prefix.pch similarity index 100% rename from AddressBook/AddressBook/AddressBook-Prefix.pch rename to Example/Objective-C/AddressBook/AddressBook-Prefix.pch diff --git a/AddressBook/AddressBook/AppDelegate.h b/Example/Objective-C/AddressBook/AppDelegate.h similarity index 100% rename from AddressBook/AddressBook/AppDelegate.h rename to Example/Objective-C/AddressBook/AppDelegate.h diff --git a/AddressBook/AddressBook/AppDelegate.m b/Example/Objective-C/AddressBook/AppDelegate.m similarity index 100% rename from AddressBook/AddressBook/AppDelegate.m rename to Example/Objective-C/AddressBook/AppDelegate.m diff --git a/AddressBook/AddressBook/ContactTableViewCell.h b/Example/Objective-C/AddressBook/ContactTableViewCell.h similarity index 100% rename from AddressBook/AddressBook/ContactTableViewCell.h rename to Example/Objective-C/AddressBook/ContactTableViewCell.h diff --git a/AddressBook/AddressBook/ContactTableViewCell.m b/Example/Objective-C/AddressBook/ContactTableViewCell.m similarity index 100% rename from AddressBook/AddressBook/ContactTableViewCell.m rename to Example/Objective-C/AddressBook/ContactTableViewCell.m diff --git a/AddressBook/AddressBook/ContactTableViewCell.xib b/Example/Objective-C/AddressBook/ContactTableViewCell.xib similarity index 100% rename from AddressBook/AddressBook/ContactTableViewCell.xib rename to Example/Objective-C/AddressBook/ContactTableViewCell.xib diff --git a/AddressBook/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/Objective-C/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from AddressBook/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json rename to Example/Objective-C/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/AddressBook/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json b/Example/Objective-C/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json similarity index 100% rename from AddressBook/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json rename to Example/Objective-C/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json diff --git a/AddressBook/AddressBook/Images.xcassets/no_photo.imageset/Contents.json b/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/Contents.json similarity index 100% rename from AddressBook/AddressBook/Images.xcassets/no_photo.imageset/Contents.json rename to Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/Contents.json diff --git a/AddressBook/AddressBook/Images.xcassets/no_photo.imageset/no_photo.png b/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/no_photo.png similarity index 100% rename from AddressBook/AddressBook/Images.xcassets/no_photo.imageset/no_photo.png rename to Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/no_photo.png diff --git a/AddressBook/AddressBook/Images.xcassets/no_photo.imageset/no_photo@2x.png b/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/no_photo@2x.png similarity index 100% rename from AddressBook/AddressBook/Images.xcassets/no_photo.imageset/no_photo@2x.png rename to Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/no_photo@2x.png diff --git a/AddressBook/AddressBook/ListViewController.h b/Example/Objective-C/AddressBook/ListViewController.h similarity index 100% rename from AddressBook/AddressBook/ListViewController.h rename to Example/Objective-C/AddressBook/ListViewController.h diff --git a/AddressBook/AddressBook/ListViewController.m b/Example/Objective-C/AddressBook/ListViewController.m similarity index 100% rename from AddressBook/AddressBook/ListViewController.m rename to Example/Objective-C/AddressBook/ListViewController.m diff --git a/AddressBook/AddressBook/Storyboard.storyboard b/Example/Objective-C/AddressBook/Storyboard.storyboard similarity index 100% rename from AddressBook/AddressBook/Storyboard.storyboard rename to Example/Objective-C/AddressBook/Storyboard.storyboard diff --git a/AddressBook/AddressBook/en.lproj/InfoPlist.strings b/Example/Objective-C/AddressBook/en.lproj/InfoPlist.strings similarity index 100% rename from AddressBook/AddressBook/en.lproj/InfoPlist.strings rename to Example/Objective-C/AddressBook/en.lproj/InfoPlist.strings diff --git a/AddressBook/AddressBook/main.m b/Example/Objective-C/AddressBook/main.m similarity index 100% rename from AddressBook/AddressBook/main.m rename to Example/Objective-C/AddressBook/main.m diff --git a/AddressBook/Podfile b/Example/Objective-C/Podfile similarity index 100% rename from AddressBook/Podfile rename to Example/Objective-C/Podfile diff --git a/AddressBook/Podfile.lock b/Example/Objective-C/Podfile.lock similarity index 100% rename from AddressBook/Podfile.lock rename to Example/Objective-C/Podfile.lock diff --git a/Example/Swift/AddressBook.xcodeproj/project.pbxproj b/Example/Swift/AddressBook.xcodeproj/project.pbxproj new file mode 100644 index 0000000..42ad6d6 --- /dev/null +++ b/Example/Swift/AddressBook.xcodeproj/project.pbxproj @@ -0,0 +1,421 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + AC7C9DDD497D46C0BC5090E1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E250D68A454F4989DC2929 /* libPods.a */; }; + FA3B983D198AB38F005953CE /* APAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3B9835198AB38F005953CE /* APAddress.m */; }; + FA3B983E198AB38F005953CE /* APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3B9837198AB38F005953CE /* APAddressBook.m */; }; + FA3B983F198AB38F005953CE /* APContact.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3B9839198AB38F005953CE /* APContact.m */; }; + FA3B9840198AB38F005953CE /* APPhoneWithLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3B983B198AB38F005953CE /* APPhoneWithLabel.m */; }; + FA3B984C198ABBB5005953CE /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3B984B198ABBB5005953CE /* TableViewCell.swift */; }; + FACA8345198AB2FD0059676C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACA8344198AB2FD0059676C /* AppDelegate.swift */; }; + FACA8347198AB2FD0059676C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACA8346198AB2FD0059676C /* ViewController.swift */; }; + FACA834A198AB2FD0059676C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FACA8348198AB2FD0059676C /* Main.storyboard */; }; + FACA834C198AB2FD0059676C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FACA834B198AB2FD0059676C /* Images.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 489C24629C594886996DFA6E /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; + E7E250D68A454F4989DC2929 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + FA3B9834198AB38F005953CE /* APAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddress.h; sourceTree = ""; }; + FA3B9835198AB38F005953CE /* APAddress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddress.m; sourceTree = ""; }; + FA3B9836198AB38F005953CE /* APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBook.h; sourceTree = ""; }; + FA3B9837198AB38F005953CE /* APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBook.m; sourceTree = ""; }; + FA3B9838198AB38F005953CE /* APContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContact.h; sourceTree = ""; }; + FA3B9839198AB38F005953CE /* APContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContact.m; sourceTree = ""; }; + FA3B983A198AB38F005953CE /* APPhoneWithLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APPhoneWithLabel.h; sourceTree = ""; }; + FA3B983B198AB38F005953CE /* APPhoneWithLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APPhoneWithLabel.m; sourceTree = ""; }; + FA3B983C198AB38F005953CE /* APTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APTypes.h; sourceTree = ""; }; + FA3B9844198AB418005953CE /* APAddressBook-Bridging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "APAddressBook-Bridging.h"; path = "Swift/APAddressBook-Bridging.h"; sourceTree = ""; }; + FA3B984A198AB8C2005953CE /* Bridging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridging.h; sourceTree = ""; }; + FA3B984B198ABBB5005953CE /* TableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = ""; }; + FACA833F198AB2FD0059676C /* AddressBook.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AddressBook.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FACA8343198AB2FD0059676C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FACA8344198AB2FD0059676C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FACA8346198AB2FD0059676C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FACA8349198AB2FD0059676C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FACA834B198AB2FD0059676C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FACA833C198AB2FD0059676C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AC7C9DDD497D46C0BC5090E1 /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 65E3953D9FB24ACD81049105 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E7E250D68A454F4989DC2929 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + FA3B9832198AB38F005953CE /* Classes */ = { + isa = PBXGroup; + children = ( + FA3B9833198AB38F005953CE /* Core */, + FA3B9845198AB42B005953CE /* Swift */, + ); + name = Classes; + path = ../../Pod; + sourceTree = ""; + }; + FA3B9833198AB38F005953CE /* Core */ = { + isa = PBXGroup; + children = ( + FA3B9834198AB38F005953CE /* APAddress.h */, + FA3B9835198AB38F005953CE /* APAddress.m */, + FA3B9836198AB38F005953CE /* APAddressBook.h */, + FA3B9837198AB38F005953CE /* APAddressBook.m */, + FA3B9838198AB38F005953CE /* APContact.h */, + FA3B9839198AB38F005953CE /* APContact.m */, + FA3B983A198AB38F005953CE /* APPhoneWithLabel.h */, + FA3B983B198AB38F005953CE /* APPhoneWithLabel.m */, + FA3B983C198AB38F005953CE /* APTypes.h */, + ); + path = Core; + sourceTree = ""; + }; + FA3B9845198AB42B005953CE /* Swift */ = { + isa = PBXGroup; + children = ( + FA3B9844198AB418005953CE /* APAddressBook-Bridging.h */, + ); + name = Swift; + sourceTree = ""; + }; + FA3B9847198AB4CC005953CE /* AppDelegate */ = { + isa = PBXGroup; + children = ( + FACA8344198AB2FD0059676C /* AppDelegate.swift */, + ); + name = AppDelegate; + sourceTree = ""; + }; + FA3B9848198AB4D4005953CE /* Controllers */ = { + isa = PBXGroup; + children = ( + FACA8346198AB2FD0059676C /* ViewController.swift */, + FACA8348198AB2FD0059676C /* Main.storyboard */, + ); + name = Controllers; + sourceTree = ""; + }; + FA3B984D198ABBBA005953CE /* Views */ = { + isa = PBXGroup; + children = ( + FA3B984B198ABBB5005953CE /* TableViewCell.swift */, + ); + name = Views; + sourceTree = ""; + }; + FACA8336198AB2FD0059676C = { + isa = PBXGroup; + children = ( + FA3B9832198AB38F005953CE /* Classes */, + FACA8341198AB2FD0059676C /* AddressBook */, + FACA8340198AB2FD0059676C /* Products */, + 65E3953D9FB24ACD81049105 /* Frameworks */, + 489C24629C594886996DFA6E /* Pods.xcconfig */, + ); + sourceTree = ""; + }; + FACA8340198AB2FD0059676C /* Products */ = { + isa = PBXGroup; + children = ( + FACA833F198AB2FD0059676C /* AddressBook.app */, + ); + name = Products; + sourceTree = ""; + }; + FACA8341198AB2FD0059676C /* AddressBook */ = { + isa = PBXGroup; + children = ( + FA3B9848198AB4D4005953CE /* Controllers */, + FA3B984D198ABBBA005953CE /* Views */, + FA3B9847198AB4CC005953CE /* AppDelegate */, + FACA834B198AB2FD0059676C /* Images.xcassets */, + FACA8342198AB2FD0059676C /* Supporting Files */, + ); + path = AddressBook; + sourceTree = ""; + }; + FACA8342198AB2FD0059676C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + FA3B984A198AB8C2005953CE /* Bridging.h */, + FACA8343198AB2FD0059676C /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FACA833E198AB2FD0059676C /* AddressBook */ = { + isa = PBXNativeTarget; + buildConfigurationList = FACA835B198AB2FD0059676C /* Build configuration list for PBXNativeTarget "AddressBook" */; + buildPhases = ( + 33F0520C9FDA49DCA3BB9D9C /* Check Pods Manifest.lock */, + FACA833B198AB2FD0059676C /* Sources */, + FACA833C198AB2FD0059676C /* Frameworks */, + FACA833D198AB2FD0059676C /* Resources */, + B2898E40613B4BB0A854A658 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AddressBook; + productName = AddressBook; + productReference = FACA833F198AB2FD0059676C /* AddressBook.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FACA8337198AB2FD0059676C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0600; + ORGANIZATIONNAME = alterplay; + TargetAttributes = { + FACA833E198AB2FD0059676C = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = FACA833A198AB2FD0059676C /* Build configuration list for PBXProject "AddressBook" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FACA8336198AB2FD0059676C; + productRefGroup = FACA8340198AB2FD0059676C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FACA833E198AB2FD0059676C /* AddressBook */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FACA833D198AB2FD0059676C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FACA834A198AB2FD0059676C /* Main.storyboard in Resources */, + FACA834C198AB2FD0059676C /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 33F0520C9FDA49DCA3BB9D9C /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + B2898E40613B4BB0A854A658 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FACA833B198AB2FD0059676C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FA3B983E198AB38F005953CE /* APAddressBook.m in Sources */, + FACA8347198AB2FD0059676C /* ViewController.swift in Sources */, + FA3B983D198AB38F005953CE /* APAddress.m in Sources */, + FA3B983F198AB38F005953CE /* APContact.m in Sources */, + FA3B9840198AB38F005953CE /* APPhoneWithLabel.m in Sources */, + FA3B984C198ABBB5005953CE /* TableViewCell.swift in Sources */, + FACA8345198AB2FD0059676C /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FACA8348198AB2FD0059676C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FACA8349198AB2FD0059676C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FACA8359198AB2FD0059676C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FACA835A198AB2FD0059676C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FACA835C198AB2FD0059676C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 489C24629C594886996DFA6E /* Pods.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = AddressBook/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = AddressBook/Bridging.h; + }; + name = Debug; + }; + FACA835D198AB2FD0059676C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 489C24629C594886996DFA6E /* Pods.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = AddressBook/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = AddressBook/Bridging.h; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FACA833A198AB2FD0059676C /* Build configuration list for PBXProject "AddressBook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FACA8359198AB2FD0059676C /* Debug */, + FACA835A198AB2FD0059676C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FACA835B198AB2FD0059676C /* Build configuration list for PBXNativeTarget "AddressBook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FACA835C198AB2FD0059676C /* Debug */, + FACA835D198AB2FD0059676C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FACA8337198AB2FD0059676C /* Project object */; +} diff --git a/Example/Swift/AddressBook/AppDelegate.swift b/Example/Swift/AddressBook/AppDelegate.swift new file mode 100644 index 0000000..9df9c93 --- /dev/null +++ b/Example/Swift/AddressBook/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// AddressBook +// +// Created by Alexey Belkevich on 7/31/14. +// Copyright (c) 2014 alterplay. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(application: UIApplication!) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication!) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication!) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication!) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication!) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Example/Swift/AddressBook/Base.lproj/Main.storyboard b/Example/Swift/AddressBook/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c8a99ba --- /dev/null +++ b/Example/Swift/AddressBook/Base.lproj/Main.storyboard @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Swift/AddressBook/Bridging.h b/Example/Swift/AddressBook/Bridging.h new file mode 100644 index 0000000..723ace4 --- /dev/null +++ b/Example/Swift/AddressBook/Bridging.h @@ -0,0 +1,12 @@ +// +// Bridging.h +// AddressBook +// +// Created by Alexey Belkevich on 7/31/14. +// Copyright (c) 2014 alterplay. All rights reserved. +// + +#import +#import +#import "APAddressBook-Bridging.h" +#import "DTTableViewManager.h" \ No newline at end of file diff --git a/Example/Swift/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/Swift/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a396706 --- /dev/null +++ b/Example/Swift/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Swift/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json b/Example/Swift/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ b/Example/Swift/AddressBook/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Swift/AddressBook/Info.plist b/Example/Swift/AddressBook/Info.plist new file mode 100644 index 0000000..6f1978d --- /dev/null +++ b/Example/Swift/AddressBook/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.alterplay.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/Swift/AddressBook/TableViewCell.swift b/Example/Swift/AddressBook/TableViewCell.swift new file mode 100644 index 0000000..c50f2a8 --- /dev/null +++ b/Example/Swift/AddressBook/TableViewCell.swift @@ -0,0 +1,43 @@ +// +// TableViewCell.swift +// AddressBook +// +// Created by Alexey Belkevich on 7/31/14. +// Copyright (c) 2014 alterplay. All rights reserved. +// + +import Foundation + +class TableViewCell: DTTableViewCell { + + init(style: UITableViewCellStyle, reuseIdentifier: String!) { + super.init(style: UITableViewCellStyle.Subtitle, reuseIdentifier: reuseIdentifier) + } + + override func updateWithModel(model: AnyObject!) { + let contact = model as APContact + self.imageView.image = contact.thumbnail + self.textLabel.text = self.contactName(contact) + self.detailTextLabel.text = self.contactPhones(contact) + } + + func contactName(contact :APContact) -> String { + if contact.firstName != nil && contact.lastName != nil { + return "\(contact.firstName) \(contact.lastName)" + } + else if contact.firstName != nil || contact.lastName != nil { + return contact.firstName ? "\(contact.firstName)" : "\(contact.lastName)" + } + else { + return "Unnamed contact" + } + } + + func contactPhones(contact :APContact) -> String { + if let phones = contact.phones { + let array = phones as NSArray + return array.componentsJoinedByString(" ") + } + return "No phone" + } +} \ No newline at end of file diff --git a/Example/Swift/AddressBook/ViewController.swift b/Example/Swift/AddressBook/ViewController.swift new file mode 100644 index 0000000..beec55a --- /dev/null +++ b/Example/Swift/AddressBook/ViewController.swift @@ -0,0 +1,41 @@ +// +// ViewController.swift +// AddressBook +// +// Created by Alexey Belkevich on 7/31/14. +// Copyright (c) 2014 alterplay. All rights reserved. +// + +import UIKit + +class ViewController: DTTableViewController { + + @IBOutlet weak var activity: UIActivityIndicatorView! + + let addressBook = APAddressBook() + + override func viewDidLoad() { + super.viewDidLoad() + self.registerCellClass(TableViewCell.self, forModelClass: APContact.self) + self.addressBook.fieldsMask = APContactField.Default | APContactField.Thumbnail + self.addressBook.sortDescriptors = [NSSortDescriptor(key: "firstName", ascending: true), + NSSortDescriptor(key: "lastName", ascending: true)] + self.addressBook.filterBlock = {(contact: APContact!) -> Bool in + return contact.phones.count > 0 + } + self.addressBook.loadContacts( + { (contacts: [AnyObject]!, error: NSError!) in + self.activity.stopAnimating() + if contacts { + self.memoryStorage().addItems(contacts) + } + else if error { + let alert = UIAlertView(title: "Error", message: error.localizedDescription, + delegate: nil, cancelButtonTitle: "OK") + alert.show() + } + }) + } + +} + diff --git a/Example/Swift/Podfile b/Example/Swift/Podfile new file mode 100644 index 0000000..ba9aabc --- /dev/null +++ b/Example/Swift/Podfile @@ -0,0 +1,2 @@ +platform :ios, '7.0' + pod 'DTTableViewManager' diff --git a/Example/Swift/Podfile.lock b/Example/Swift/Podfile.lock new file mode 100644 index 0000000..e1d8a7a --- /dev/null +++ b/Example/Swift/Podfile.lock @@ -0,0 +1,24 @@ +PODS: + - DTModelStorage (0.8.0): + - DTModelStorage/All + - DTModelStorage/All (0.8.0): + - DTModelStorage/CoreDataStorage + - DTModelStorage/MemoryStorage + - DTModelStorage/ModelTransfer + - DTModelStorage/Core (0.8.0) + - DTModelStorage/CoreDataStorage (0.8.0): + - DTModelStorage/Core + - DTModelStorage/MemoryStorage (0.8.0): + - DTModelStorage/Core + - DTModelStorage/ModelTransfer (0.8.0) + - DTTableViewManager (2.5.1): + - DTModelStorage (= 0.8.0) + +DEPENDENCIES: + - DTTableViewManager + +SPEC CHECKSUMS: + DTModelStorage: 84b63252b63132c14238283d5de67aebe464694c + DTTableViewManager: e9963bc8d709614ebd4bef8c59f87a891e3ccb62 + +COCOAPODS: 0.33.1 diff --git a/Classes/APAddress.h b/Pod/Core/APAddress.h similarity index 100% rename from Classes/APAddress.h rename to Pod/Core/APAddress.h diff --git a/Classes/APAddress.m b/Pod/Core/APAddress.m similarity index 100% rename from Classes/APAddress.m rename to Pod/Core/APAddress.m diff --git a/Classes/APAddressBook.h b/Pod/Core/APAddressBook.h similarity index 100% rename from Classes/APAddressBook.h rename to Pod/Core/APAddressBook.h diff --git a/Classes/APAddressBook.m b/Pod/Core/APAddressBook.m similarity index 100% rename from Classes/APAddressBook.m rename to Pod/Core/APAddressBook.m diff --git a/Classes/APContact.h b/Pod/Core/APContact.h similarity index 97% rename from Classes/APContact.h rename to Pod/Core/APContact.h index ec3d4de..dc456a6 100644 --- a/Classes/APContact.h +++ b/Pod/Core/APContact.h @@ -7,6 +7,7 @@ // #import +#import #import #import "APTypes.h" diff --git a/Classes/APContact.m b/Pod/Core/APContact.m similarity index 100% rename from Classes/APContact.m rename to Pod/Core/APContact.m diff --git a/Classes/APPhoneWithLabel.h b/Pod/Core/APPhoneWithLabel.h similarity index 100% rename from Classes/APPhoneWithLabel.h rename to Pod/Core/APPhoneWithLabel.h diff --git a/Classes/APPhoneWithLabel.m b/Pod/Core/APPhoneWithLabel.m similarity index 100% rename from Classes/APPhoneWithLabel.m rename to Pod/Core/APPhoneWithLabel.m diff --git a/Classes/APTypes.h b/Pod/Core/APTypes.h similarity index 100% rename from Classes/APTypes.h rename to Pod/Core/APTypes.h diff --git a/Pod/Swift/APAddressBook-Bridging.h b/Pod/Swift/APAddressBook-Bridging.h new file mode 100644 index 0000000..30eed59 --- /dev/null +++ b/Pod/Swift/APAddressBook-Bridging.h @@ -0,0 +1,15 @@ +// +// APAddressBook-Bridging.h +// APAddressBook +// +// Created by Alexey Belkevich on 7/31/14. +// Copyright (c) 2014 alterplay. All rights reserved. +// + +#import +#import + +#import "APAddressBook.h" +#import "APContact.h" +#import "APAddress.h" +#import "APPhoneWithLabel.h" \ No newline at end of file