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

Commit

Permalink
Fix archive issue.
Browse files Browse the repository at this point in the history
See Cocoapods Issue #3200. Using cocoapods for botht the app and the
extensions causes an issue that prevents Xcode from building a valid
archive. From now on cocoapods will be used only for the main app. Realm
is now integrated manually as a dynamic framework.
  • Loading branch information
andreamazz committed May 7, 2015
1 parent 9aca101 commit d913ee3
Show file tree
Hide file tree
Showing 34 changed files with 3,397 additions and 101 deletions.
146 changes: 53 additions & 93 deletions Gulps.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions Gulps/Support/RLMSupport.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2014 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

import Realm

extension RLMObject {
// Swift query convenience functions
public class func objectsWhere(predicateFormat: String, _ args: CVarArgType...) -> RLMResults {
return objectsWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args)))
}

public class func objectsInRealm(realm: RLMRealm, _ predicateFormat: String, _ args: CVarArgType...) -> RLMResults {
return objectsInRealm(realm, withPredicate:NSPredicate(format: predicateFormat, arguments: getVaList(args)))
}
}

extension RLMArray: SequenceType {
// Support Sequence-style enumeration
public func generate() -> GeneratorOf<RLMObject> {
var i: UInt = 0

return GeneratorOf<RLMObject> {
if (i >= self.count) {
return .None
} else {
return self[i++] as? RLMObject
}
}
}

// Swift query convenience functions
public func indexOfObjectWhere(predicateFormat: String, _ args: CVarArgType...) -> UInt {
return indexOfObjectWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args)))
}

public func objectsWhere(predicateFormat: String, _ args: CVarArgType...) -> RLMResults {
return objectsWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args)))
}
}

extension RLMResults: SequenceType {
// Support Sequence-style enumeration
public func generate() -> GeneratorOf<RLMObject> {
var i: UInt = 0

return GeneratorOf<RLMObject> {
if (i >= self.count) {
return .None
} else {
return self[i++] as? RLMObject
}
}
}

// Swift query convenience functions
public func indexOfObjectWhere(predicateFormat: String, _ args: CVarArgType...) -> UInt {
return indexOfObjectWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args)))
}

public func objectsWhere(predicateFormat: String, _ args: CVarArgType...) -> RLMResults {
return objectsWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args)))
}
}
2 changes: 1 addition & 1 deletion Gulps/ViewControllers/DrinkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class DrinkViewController: UIViewController, UIAlertViewDelegate {

@IBAction public func selectionButtonAction(sender: UIButton) {
contractAddButton()
if (userDefaults.boolForKey("UNDO_HINT")) {
if (!userDefaults.boolForKey("UNDO_HINT")) {
userDefaults.setBool(true, forKey: "UNDO_HINT")
userDefaults.synchronize()
AMPopTip.appearance().popoverColor = .mainColor()
Expand Down
14 changes: 7 additions & 7 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

def common_pods
pod 'Realm', '~> 0.92'
# pod 'Realm', '~> 0.92'
pod 'AMWaveTransition', '~> 0.5'
pod 'AHKActionSheet', '~> 0.5'
pod 'pop', '~> 1.0'
Expand All @@ -23,13 +23,13 @@ target 'GulpsTests' do
pod 'Nimble-Snapshots'
end

target 'GulpsToday' do
pod 'Realm', '~> 0.92'
end
# target 'GulpsToday' do
# pod 'Realm', '~> 0.92'
# end

target 'Gulps WatchKit Extension' do
pod 'Realm', '~> 0.92'
end
# target 'Gulps WatchKit Extension' do
# pod 'Realm', '~> 0.92'
# end

inhibit_all_warnings!
use_frameworks!
Expand Down
Loading

0 comments on commit d913ee3

Please sign in to comment.