Skip to content

Commit

Permalink
Add Swift Pod with resource bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Renzo Crisóstomo committed Aug 7, 2016
1 parent f9ad285 commit 3f01e50
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 9 deletions.
13 changes: 12 additions & 1 deletion Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
3F042ED81D4E3C3E00FFE41A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F042ED71D4E3C3E00FFE41A /* Assets.xcassets */; };
3F042EDB1D4E3C3E00FFE41A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3F042ED91D4E3C3E00FFE41A /* LaunchScreen.storyboard */; };
3F87BCC61D5783E200AC7790 /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3F87BCC51D5783E200AC7790 /* ExampleTests.m */; };
3F87BCCF1D57882F00AC7790 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F87BCCE1D57882F00AC7790 /* File.swift */; };
5736364F115FCA939A787C3B /* Pods_ExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75BDD65CDD45719C6EDA07A4 /* Pods_ExampleTests.framework */; };
665F98C96342C7DAD007F69A /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86F5F9006085FDDE8CD9977E /* Pods_Example.framework */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -42,6 +43,8 @@
3F87BCC31D5783E200AC7790 /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3F87BCC51D5783E200AC7790 /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = "<group>"; };
3F87BCC71D5783E200AC7790 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3F87BCCD1D57882F00AC7790 /* Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Example-Bridging-Header.h"; sourceTree = "<group>"; };
3F87BCCE1D57882F00AC7790 /* File.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
4B87D28C2B315CA1D2A0C5E4 /* Pods-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ExampleTests/Pods-ExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
75BDD65CDD45719C6EDA07A4 /* Pods_ExampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
86F5F9006085FDDE8CD9977E /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -113,6 +116,8 @@
3F042ED91D4E3C3E00FFE41A /* LaunchScreen.storyboard */,
3F042EDC1D4E3C3E00FFE41A /* Info.plist */,
3F042ECB1D4E3C3E00FFE41A /* Supporting Files */,
3F87BCCE1D57882F00AC7790 /* File.swift */,
3F87BCCD1D57882F00AC7790 /* Example-Bridging-Header.h */,
);
path = Example;
sourceTree = "<group>";
Expand Down Expand Up @@ -259,7 +264,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /usr/bin/ruby;
shellScript = "#!/usr/bin/ruby\nintermediates_directory = ENV['OBJROOT']\nconfiguration = ENV['CONFIGURATION']\nplatform = ENV['EFFECTIVE_PLATFORM_NAME']\narchs = ENV['ARCHS']\ntarget_name = ENV['TARGET_NAME']\n\narchs.split(\" \").each do |architecture|\n Dir.chdir(\"#{intermediates_directory}/Pods.build\") do\n filelist = \"\"\n [\"AFNetworking\"].each do |dependency|\n Dir.glob(\"#{configuration}#{platform}/#{dependency}.build/Objects-normal/#{architecture}/*.o\") do |object_file|\n next if [\"Pods-#{target_name}-dummy\", \"Pods_#{target_name}_vers\"].any? { |dummy_object| object_file.include? dummy_object }\n filelist += File.absolute_path(object_file) + \"\\n\"\n end\n end\n File.write(\"#{configuration}#{platform}-#{architecture}.objects.filelist\", filelist)\n end\nend\n";
shellScript = "#!/usr/bin/ruby\nintermediates_directory = ENV['OBJROOT']\nconfiguration = ENV['CONFIGURATION']\nplatform = ENV['EFFECTIVE_PLATFORM_NAME']\narchs = ENV['ARCHS']\ntarget_name = ENV['TARGET_NAME']\n\narchs.split(\" \").each do |architecture|\n Dir.chdir(\"#{intermediates_directory}/Pods.build\") do\n filelist = \"\"\n [\"AFNetworking\", \"ImagePicker\"].each do |dependency|\n Dir.glob(\"#{configuration}#{platform}/#{dependency}.build/Objects-normal/#{architecture}/*.o\") do |object_file|\n next if [\"Pods-#{target_name}-dummy\", \"Pods_#{target_name}_vers\"].any? { |dummy_object| object_file.include? dummy_object }\n filelist += File.absolute_path(object_file) + \"\\n\"\n end\n end\n File.write(\"#{configuration}#{platform}-#{architecture}.objects.filelist\", filelist)\n end\nend\n";
};
44D6F65205724357466B231E /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -344,6 +349,7 @@
buildActionMask = 2147483647;
files = (
3F042ED31D4E3C3E00FFE41A /* ViewController.m in Sources */,
3F87BCCF1D57882F00AC7790 /* File.swift in Sources */,
3F042ED01D4E3C3E00FFE41A /* AppDelegate.m in Sources */,
3F042ECD1D4E3C3E00FFE41A /* main.m in Sources */,
);
Expand Down Expand Up @@ -474,10 +480,13 @@
baseConfigurationReference = B67ACED7ABE3BA8A1F6DBEDC /* Pods-Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ruenzuo.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Example/Example-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
Expand All @@ -486,10 +495,12 @@
baseConfigurationReference = E51EBADC1364922AE47C9CF2 /* Pods-Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ruenzuo.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Example/Example-Bridging-Header.h";
};
name = Release;
};
Expand Down
6 changes: 3 additions & 3 deletions Example/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -15,7 +16,6 @@
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
Expand Down
20 changes: 17 additions & 3 deletions Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" 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="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dM1-CW-uzp">
<rect key="frame" x="277" y="285" width="46" height="30"/>
<state key="normal" title="Button"/>
<connections>
<action selector="showImagePicker" destination="BYZ-38-t0r" eventType="touchUpInside" id="fue-eq-Hqn"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="dM1-CW-uzp" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="2wD-z7-LT3"/>
<constraint firstItem="dM1-CW-uzp" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="78z-9A-HWc"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
Expand Down
4 changes: 4 additions & 0 deletions Example/Example-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

9 changes: 9 additions & 0 deletions Example/File.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// File.swift
// Example
//
// Created by Renzo Crisóstomo on 07/08/16.
// Copyright © 2016 Renzo Crisóstomo. All rights reserved.
//

import Foundation
6 changes: 6 additions & 0 deletions Example/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "ViewController.h"
#import <AFNetworking/AFNetworking.h>
@import ImagePicker;

@interface ViewController ()

Expand Down Expand Up @@ -37,4 +38,9 @@ - (void)doSomethingWithAFNetworking {
[dataTask resume];
}

- (IBAction)showImagePicker {
ImagePickerController *controller = [[ImagePickerController alloc] init];
[self presentViewController:controller animated:YES completion:nil];
}

@end
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/Ruenzuo/cocoapods-amimono.git
revision: 872c4fd337860a083e66676a60edca715a13be48
revision: 0984b40f156b966d939c9fae3ee567bf5864afab
specs:
cocoapods-amimono (0.0.1)

Expand Down
6 changes: 6 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ plugin 'cocoapods-amimono'
target 'Example' do
use_frameworks!
pod 'AFNetworking'
pod 'ImagePicker'

target 'ExampleTests' do
inherit! :search_paths
pod 'OCMock'
end
end

post_install do |installer|
require 'cocoapods-amimono/patcher'
Amimono::Patcher.patch_copy_resources_script(installer: installer)
end
5 changes: 4 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- ImagePicker (1.2)
- OCMock (3.3)

DEPENDENCIES:
- AFNetworking
- ImagePicker
- OCMock

SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
ImagePicker: 85f14ed6872f46c08d210077b5540a890a6cd151
OCMock: d68685bde31f69cb61d518dcb39269080c78b5ed

PODFILE CHECKSUM: 482fd5d92e4174446390346f15d7cb44b6739d09
PODFILE CHECKSUM: c0e9ae79f4ea814d8cd8052697a25303d69a4890

COCOAPODS: 1.0.1

0 comments on commit 3f01e50

Please sign in to comment.