Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

Swift 2.3 #159

Merged
merged 54 commits into from
Oct 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0d6a5e2
API updates for Swift 2.3
rcedwards Jul 14, 2016
ec2671f
Better handling of new random temporary directories for unit testing
rcedwards Jul 14, 2016
9104fec
Add a second sample project to show NSPersistentContainer usage
rcedwards Jul 14, 2016
41dbc38
Deprecate the main CoreDataStack in favor of NSPersistentContainer
rcedwards Jul 14, 2016
c78c230
Deprecate persistent store setting helper func when NSPersistentStore…
rcedwards Jul 14, 2016
964516d
Bump travis version to xcode 8
rcedwards Jul 14, 2016
e3d0827
Remove branch whitelist for testing new swift 2.3 and 3.0 conversions
rcedwards Jul 14, 2016
67a2954
Use an explicit destination for mac scheme
rcedwards Jul 15, 2016
805cebf
Use an explicit destination for mac scheme
rcedwards Jul 15, 2016
9a3495e
Remove carthage validation and cocoa pods validation
rcedwards Jul 15, 2016
40d8f49
Handle optionality of URLByAppendingPathComponent
rcedwards Jul 15, 2016
2d83331
Break platform schemes out in fastfile
rcedwards Jul 15, 2016
8e9f659
Bump ruby version and dependencies
rcedwards Jul 15, 2016
beb06c8
Use explicit destinations on scan
rcedwards Jul 15, 2016
dea9653
Modify fastlane test lane to use xctest
rcedwards Sep 13, 2016
66dd1c9
Bump dependecies in Gemfile
rcedwards Sep 13, 2016
5b84f45
Fix typo in fastfile using the project name instead of tvOS scheme
rcedwards Sep 14, 2016
a5a490b
Use latest iPhone device for iOS scheme
rcedwards Sep 14, 2016
1eb6949
Update miscellaneous xcode 8 project suggestions
rcedwards Sep 22, 2016
85928fd
Add deprecation to CoreDataModelable
rcedwards Sep 22, 2016
ac56758
Mirror deprecation model from Swift 3.0 branch
rcedwards Sep 22, 2016
6ae4aaf
Add back branch whitelist and resources scripts
rcedwards Sep 27, 2016
256c511
Add a .swift-version file
rcedwards Sep 28, 2016
832f84a
Disable pod validation until we publish new release
rcedwards Sep 28, 2016
d11c1c3
Add swift version to pod spec
rcedwards Sep 28, 2016
08ea12d
Bump gem dependencies
rcedwards Sep 28, 2016
04f411a
Include verbose output on pod spec validation
rcedwards Sep 28, 2016
a7d00c5
Automatic fastlane readme change
rcedwards Sep 28, 2016
be8576f
Add post deprecated test target to CoreDataStack scheme
rcedwards Sep 28, 2016
0de35ba
Add explicit toolchain argument to carthage validation
rcedwards Sep 29, 2016
3b5fe72
Set an explicit Swift Version for each xcode target
rcedwards Sep 29, 2016
b80c559
Output cartfile in validation script
rcedwards Sep 29, 2016
648b265
Correct or bypass all lint violations
rcedwards Sep 29, 2016
366e40d
Disable valid_docs rule in swift lint yml
rcedwards Sep 29, 2016
04cddd4
Fix printing of Cartfile to console
rcedwards Sep 29, 2016
85718fd
Disable casecade binding waring in swift lint yml
rcedwards Sep 29, 2016
547ba6f
Use the pull request branch for cartahge validation
rcedwards Sep 30, 2016
9f7779a
Use the github clone url rather than local checked out source
rcedwards Sep 30, 2016
8b74eb4
Only generate docs for non-pull request builds
rcedwards Sep 30, 2016
5d2c1d8
Add open simulator pre-build step
rcedwards Sep 30, 2016
8ea0b1a
Bump bundler dependencies
rcedwards Sep 30, 2016
b50ab1b
Update jazzy doc generation configuration
rcedwards Sep 30, 2016
cbe858f
Bump version in pod spec
rcedwards Sep 30, 2016
9006cdd
Comment out CircleCI configuration
rcedwards Sep 30, 2016
307b661
Drop .xctool-args config file
rcedwards Sep 30, 2016
6bb077e
Add first pass of documenting the deprecation of CoreDataStack and Co…
rcedwards Sep 30, 2016
2a49b34
Bump Swift and Xcode version requirements
rcedwards Oct 3, 2016
c4b78f3
Apply minor edits to the readme
rcedwards Oct 7, 2016
91012a2
Remove unnecessary xcconfig setting form pod spec file
rcedwards Oct 7, 2016
b81647b
Reenable cocoapod spec validation
rcedwards Oct 7, 2016
ca065a9
Add @available designations for tvOS
rcedwards Oct 7, 2016
9715c0f
Add NSManagedObject+FetchHelpers to macOS and tvOS targets
rcedwards Oct 7, 2016
53e6440
Adjust tvOS deployment target to 9.0
rcedwards Oct 11, 2016
a1632f5
Use master version of cocoa pods
rcedwards Oct 11, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions .jazzy.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# jazzy --config .jazzy.yml
author: "Big Nerd Ranch"
author_url: "http://bignerdranch.github.io"
copyright: "© 2014-2016 [Big Nerd Ranch](//www.bignerdranch.com) under [MIT license](https://raw.githubusercontent.com/bignerdranch/CoreDataStack/master/LICENSE)."
custom_categories:
- name: Stack
children:
- CoreDataStack
- Error
- name: Type Safe Monitors
children:
- EntityMonitor
- EntityMonitorDelegate
- FetchedResultsController
- FetchedResultsControllerDelegate
- name: NSManagedObject Shorthands
children:
- CoreDataModelable
- name: Extensions
children:
- NSPersistentStoreCoordinator
- NSFetchRequestResult
- NSManagedObjectContext
- NSPersistentStoreCoordinator
- NSBundle
- name: Supporting Structs and Enums
children:
- FetchedResultsObjectChange
- FetchedResultsSectionChange
- FetchedResultsSectionInfo
- FireFrequency
- name: Deprecated
children:
- CoreDataStack
- CoreDataModelable
github_url: "https://github.com/bignerdranch/CoreDataStack"
head: |
<meta property="og:site_name" content="Core Data Stack Programming Guide">
Expand All @@ -35,8 +33,6 @@ head: |
hide_documentation_coverage: false
skip_undocumented: false
module: CoreDataStack
podspec: BNRCoreDataStack.podspec
module_version: "2.0.0-rc.1"
module_version: "1.3.0"
root_url: "http://bignerdranch.github.io/CoreDataStack/"
swift_version: 2.2
theme: fullwidth
theme: fullwidth
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
2.2.5
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
disabled_rules:
- valid_docs
- conditional_binding_cascade

included:

Expand Down
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
language: objective-c
osx_image: xcode7.3
osx_image: xcode8
cache: bundler
rvm: 2.2.1

before_script:
- brew update
- brew outdated carthage || brew upgrade carthage
- gem install jazzy --no-rdoc --no-ri --no-document --quiet

- export IOS_SIMULATOR_UDID=`instruments -s devices | grep "iPhone 6s (10.0" | awk -F '[ ]' '{print $4}' | awk -F '[\[]' '{print $2}' | sed 's/.$//'`
- echo $IOS_SIMULATOR_UDID
- open -a "simulator" --args -CurrentDeviceUDID $IOS_SIMULATOR_UDID

branches:
only:
- master

after_success:
- ./Resources/scripts/publish_docs.sh

branches:
only:
- master
env:
global:
secure: MkSIUBcC2r81tYPf4an39/hd5eB98Q96HwpCQpu/11O3SDg9q/nIRDUzN8+N/jFXlaboqAEVTHFHIXIk2x8LFJojib8WOJdqXpERXOPbS483cJenmi/1vCcij7wW9O7+24Xo5/H/bprO3P3wbpYPb8mQWnpmdqyQs0IuXOVqsmfS6gftN9mgNlV8bwEPa5V9MbdJviA6kFryfruAVlFUcKd39bv1wRaPGPRZIWM+QzMNK3J+dPsyWBb+f7XBZa3bQ2/hYEdfWW5NU6GN93OZJjP7gwXssZbDZjPDVpM9lvx5suYVKeMyFL4QFTYo9TsNk/V94KnxYcqnhDZ/BFHyjysto3K5bixYTaWUJPBqUJi9F0+Vd9ldt627xaNHHiGevptHyUvWWwgH1S8cF55FGE/Ptwc3MRmrr3IFOqbFDHV/hpMr5Sroz2dCHJohzJZRnWUppMgSY4SXu+1bB3F1P40y22yUKirsjmwWfJEEBcWNpOnMQCgKvFKG89shGqGfXYcRXkouhOqnGVpSUV+92Fli7O9GzjvLxAVm127kPypTZYYUwAaowm0BF4+lLMLZxmpUP42fTzENhbYLofVrpOuR7tisEJshrmjF9XYZVvu9R39EyMscXN+fnMlGWGLFAkimd4lUZVAAcZT++GL3BCEFKD9gGEAGbdtW9M42Nyk=

script:
- ./Resources/scripts/validate_carthage.sh
- ./Resources/scripts/validate_cocoapods.sh
- bundle exec fastlane test
- ./Resources/scripts/validate_carthage.sh
- ./Resources/scripts/validate_cocoapods.sh
- bundle exec fastlane test
6 changes: 0 additions & 6 deletions .xctool-args

This file was deleted.

5 changes: 2 additions & 3 deletions BNRCoreDataStack.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "BNRCoreDataStack"
s.version = "1.2.6"
s.version = "1.3.0"
s.summary = "The Big Nerd Ranch Core Data stack."

s.description = <<-DESC
Expand All @@ -29,8 +29,6 @@ DESC

s.homepage = "https://github.com/bignerdranch/CoreDataStack"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }


s.authors = ["Robert Edwards", "John Gallagher", "Brian Hardy", "Zachary Waldowski"]

Expand All @@ -53,5 +51,6 @@ DESC
s.source_files = "Sources"

s.frameworks = "CoreData"
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '2.3' }

end
65 changes: 65 additions & 0 deletions Container Example/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// AppDelegate.swift
// Container Example
//
// Created by Robert Edwards on 7/14/16.
// Copyright © 2016 Big Nerd Ranch. All rights reserved.
//

import UIKit
import CoreData

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
let persistentContainer = NSPersistentContainer(name: "Container_Example")
private let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
private lazy var loadingVC: UIViewController = {
return self.mainStoryboard.instantiateViewControllerWithIdentifier("LoadingVC")
}()
private lazy var myCoreDataVC: MyCoreDataConnectedViewController = {
return self.mainStoryboard.instantiateViewControllerWithIdentifier("CoreDataVC")
as! MyCoreDataConnectedViewController // swiftlint:disable:this force_cast
}()

func applicationDidFinishLaunching(application: UIApplication) {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = loadingVC

persistentContainer.loadPersistentStoresWithCompletionHandler() { storeDescription, error in
if let error = error {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
self.seedInitialData()
self.myCoreDataVC.persistentContainer = self.persistentContainer
self.window?.rootViewController = self.myCoreDataVC
}

window?.makeKeyAndVisible()
}

private func seedInitialData() {
let moc = persistentContainer.newBackgroundContext()
moc.performBlockAndWait() {
do {
let bookCount = try Book.countInContext(moc)
if bookCount == 0 {
let books = StubbedBookData.books
for bookTitle in books {
let book = Book(context: moc)
book.title = bookTitle
}

do {
try moc.save()
} catch {
fatalError("Saving records should not fail. Error: \(error)")
}
}
} catch {
fatalError("Failed to fetch book count: \(error)")
}
}
}
}
28 changes: 28 additions & 0 deletions Container Example/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11163.2" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11133"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
93 changes: 93 additions & 0 deletions Container Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11163.2" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11133"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="9oz-P6-1IV">
<objects>
<viewController storyboardIdentifier="LoadingVC" id="7zb-CS-0Ys" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="6NC-TB-9ex"/>
<viewControllerLayoutGuide type="bottom" id="7M2-jZ-Gor"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="R5t-IL-p3R">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="K6i-ra-ywI">
<subviews>
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" animating="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="hx5-Hc-1f5"/>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loading" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gkH-uC-l1l">
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="18"/>
<color key="textColor" red="0.41568627953529358" green="0.5058823823928833" blue="0.21176470816135406" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.96078431606292725" green="0.95686274766921997" blue="0.94509804248809814" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="gkH-uC-l1l" firstAttribute="top" secondItem="hx5-Hc-1f5" secondAttribute="bottom" constant="14" id="Au4-Jr-579"/>
<constraint firstItem="K6i-ra-ywI" firstAttribute="centerY" secondItem="R5t-IL-p3R" secondAttribute="centerY" id="N83-9X-VJd"/>
<constraint firstItem="gkH-uC-l1l" firstAttribute="centerX" secondItem="hx5-Hc-1f5" secondAttribute="centerX" id="cym-7g-x2s"/>
<constraint firstItem="K6i-ra-ywI" firstAttribute="centerX" secondItem="R5t-IL-p3R" secondAttribute="centerX" id="wob-3T-3u8"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="SMf-Q2-Rmj" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="396" y="-6"/>
</scene>
<!--My Core Data Connected View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="CoreDataVC" id="BYZ-38-t0r" customClass="MyCoreDataConnectedViewController" customModule="Container_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bnr-logo-square.png" translatesAutoresizingMaskIntoConstraints="NO" id="qEj-kg-LeY"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stack Setup Complete" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xQT-7j-YEd">
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="18"/>
<color key="textColor" red="0.88235294818878174" green="0.34509804844856262" blue="0.16078431904315948" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tIx-6e-GVy">
<fontDescription key="fontDescription" name="Helvetica-Bold" family="Helvetica" pointSize="16"/>
<state key="normal" title="Display Fetched Results Controller">
<color key="titleColor" red="0.41568627949999998" green="0.50588238240000005" blue="0.21176470820000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="showFRC:" destination="BYZ-38-t0r" eventType="touchUpInside" id="drL-2c-5eY"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.96078431606292725" green="0.95686274766921997" blue="0.94509804248809814" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<gestureRecognizers/>
<constraints>
<constraint firstItem="tIx-6e-GVy" firstAttribute="top" secondItem="qEj-kg-LeY" secondAttribute="bottom" constant="16" id="HOR-rf-oCT"/>
<constraint firstItem="qEj-kg-LeY" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="MMx-Zq-xLN"/>
<constraint firstItem="qEj-kg-LeY" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="Mct-VO-YEC"/>
<constraint firstItem="xQT-7j-YEd" firstAttribute="centerX" secondItem="qEj-kg-LeY" secondAttribute="centerX" id="h2z-0a-RBa"/>
<constraint firstItem="qEj-kg-LeY" firstAttribute="top" secondItem="xQT-7j-YEd" secondAttribute="bottom" constant="8" id="kRO-bp-szQ"/>
<constraint firstItem="tIx-6e-GVy" firstAttribute="centerX" secondItem="qEj-kg-LeY" secondAttribute="centerX" id="xja-mt-gUp"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-414" y="-5"/>
</scene>
</scenes>
<resources>
<image name="bnr-logo-square.png" width="300" height="300"/>
</resources>
</document>
Loading