Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
39d0fd4a
Commit
39d0fd4a
authored
Feb 02, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Examples] Add an example that builds swift static libs & objc libs as modules!
parent
21a87d96
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
905 additions
and
0 deletions
+905
-0
CustomModuleMapPod.podspec
...les Example/CustomModuleMapPod/CustomModuleMapPod.podspec
+21
-0
CMM.h
examples/Modules Example/CustomModuleMapPod/src/CMM.h
+6
-0
CMM.m
examples/Modules Example/CustomModuleMapPod/src/CMM.m
+13
-0
CMMFunctions.h
...les/Modules Example/CustomModuleMapPod/src/CMMFunctions.h
+2
-0
CustomModuleMapPod.modulemap
...ample/CustomModuleMapPod/src/CustomModuleMapPod.modulemap
+10
-0
CMM+Private.h
...ules Example/CustomModuleMapPod/src/Private/CMM+Private.h
+5
-0
contents.xcworkspacedata
...les Example/Examples.xcworkspace/contents.xcworkspacedata
+13
-0
WorkspaceSettings.xcsettings
...les.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+5
-0
MixedPod.podspec
examples/Modules Example/MixedPod/MixedPod.podspec
+18
-0
bce.h
examples/Modules Example/MixedPod/src/bce.h
+5
-0
bce.m
examples/Modules Example/MixedPod/src/bce.m
+23
-0
foo.swift
examples/Modules Example/MixedPod/src/foo.swift
+21
-0
ObjCPod.podspec
examples/Modules Example/ObjCPod/ObjCPod.podspec
+19
-0
abc.h
examples/Modules Example/ObjCPod/src/abc.h
+4
-0
abc.m
examples/Modules Example/ObjCPod/src/abc.m
+7
-0
Podfile
examples/Modules Example/Podfile
+30
-0
AppDelegate.swift
examples/Modules Example/Static Swift/AppDelegate.swift
+20
-0
Contents.json
...ic Swift/Assets.xcassets/AppIcon.appiconset/Contents.json
+94
-0
LaunchScreen.storyboard
...s Example/Static Swift/Base.lproj/LaunchScreen.storyboard
+25
-0
Main.storyboard
...s/Modules Example/Static Swift/Base.lproj/Main.storyboard
+24
-0
Info.plist
examples/Modules Example/Static Swift/Info.plist
+45
-0
ModelThing.h
examples/Modules Example/Static Swift/ModelThing.h
+15
-0
ModelThing.m
examples/Modules Example/Static Swift/ModelThing.m
+28
-0
ViewController.swift
examples/Modules Example/Static Swift/ViewController.swift
+45
-0
SwiftPod.podspec
examples/Modules Example/SwiftPod/SwiftPod.podspec
+15
-0
xyz.swift
examples/Modules Example/SwiftPod/src/xyz.swift
+20
-0
project.pbxproj
...les/Modules Example/iOS Modules.xcodeproj/project.pbxproj
+0
-0
Dynamic iOS.xcscheme
...les.xcodeproj/xcshareddata/xcschemes/Dynamic iOS.xcscheme
+93
-0
Static iOS.xcscheme
...ules.xcodeproj/xcshareddata/xcschemes/Static iOS.xcscheme
+93
-0
project.pbxproj
...s/Modules Example/macOS Modules.xcodeproj/project.pbxproj
+0
-0
Dynamic macOS.xcscheme
...s.xcodeproj/xcshareddata/xcschemes/Dynamic macOS.xcscheme
+93
-0
Static macOS.xcscheme
...es.xcodeproj/xcshareddata/xcschemes/Static macOS.xcscheme
+93
-0
No files found.
examples/Modules Example/CustomModuleMapPod/CustomModuleMapPod.podspec
0 → 100644
View file @
39d0fd4a
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
"CustomModuleMapPod"
s
.
version
=
"0.0.1"
s
.
summary
=
"A long description of CustomModuleMapPod."
s
.
source
=
{
:git
=>
"http://foo/CustomModuleMapPod.git"
,
:tag
=>
"
#{
s
.
version
}
"
}
s
.
authors
=
[
'me'
]
s
.
homepage
=
'http://example.com'
s
.
license
=
'proprietary'
s
.
source_files
=
"src/**/*.{h,m,swift}"
s
.
private_header_files
=
"src/Private/*.h"
s
.
module_map
=
"src/CustomModuleMapPod.modulemap"
s
.
ios
.
deployment_target
=
'9.0'
s
.
macos
.
deployment_target
=
'10.10'
s
.
pod_target_xcconfig
=
{
'DEFINES_MODULE'
=>
'YES'
,
}
end
examples/Modules Example/CustomModuleMapPod/src/CMM.h
0 → 100644
View file @
39d0fd4a
#import <CustomModuleMapPod/CMMFunctions.h>
@import
Foundation
;
@interface
CMM
:
NSObject
+
(
void
)
log
;
@end
examples/Modules Example/CustomModuleMapPod/src/CMM.m
0 → 100644
View file @
39d0fd4a
#import <CustomModuleMapPod/CMM.h>
#import <CustomModuleMapPod/CMM+Private.h>
#import <CustomModuleMapPod/CMMFunctions.h>
#import <Foundation/Foundation.h>
@implementation
CMM
+
(
void
)
log
{
NSLog
(
@"module maps are the wurst"
);
}
@end
void
CMM_doThing
(
void
)
{
NSLog
(
@"CMM doing thing"
);
}
examples/Modules Example/CustomModuleMapPod/src/CMMFunctions.h
0 → 100644
View file @
39d0fd4a
extern
void
CMM_doThing
(
void
);
\ No newline at end of file
examples/Modules Example/CustomModuleMapPod/src/CustomModuleMapPod.modulemap
0 → 100644
View file @
39d0fd4a
framework module CustomModuleMapPod {
umbrella header "CMM.h"
explicit module Private {
header "CMM+Private.h"
}
export *
module * { export * }
}
examples/Modules Example/CustomModuleMapPod/src/Private/CMM+Private.h
0 → 100644
View file @
39d0fd4a
#import <CustomModuleMapPod/CMM.h>
@interface
CMM
(
PrivateExtension
)
@end
\ No newline at end of file
examples/Modules Example/Examples.xcworkspace/contents.xcworkspacedata
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version =
"1.0"
>
<FileRef
location =
"group:iOS Modules.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:macOS Modules.xcodeproj"
>
</FileRef>
<FileRef
location =
"group:Pods/Pods.xcodeproj"
>
</FileRef>
</Workspace>
examples/Modules Example/Examples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict/>
</plist>
examples/Modules Example/MixedPod/MixedPod.podspec
0 → 100644
View file @
39d0fd4a
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
"MixedPod"
s
.
version
=
"0.0.1"
s
.
summary
=
"A long description of objc."
s
.
source
=
{
:git
=>
"http://foo/objc.git"
,
:tag
=>
"
#{
s
.
version
}
"
}
s
.
authors
=
[
'me'
]
s
.
homepage
=
'http://example.com'
s
.
license
=
'proprietary'
s
.
source_files
=
"src/**/*.{h,m,swift}"
s
.
public_header_files
=
"src/**/*.h"
s
.
dependency
'ObjCPod'
s
.
dependency
'SwiftPod'
s
.
ios
.
deployment_target
=
'9.0'
s
.
macos
.
deployment_target
=
'10.10'
end
examples/Modules Example/MixedPod/src/bce.h
0 → 100644
View file @
39d0fd4a
@import
Foundation
;
@interface
BCE
:
NSObject
+
(
void
)
meow
;
@end
examples/Modules Example/MixedPod/src/bce.m
0 → 100644
View file @
39d0fd4a
#import <MixedPod/bce.h>
#if __has_include(<MixedPod/MixedPod-Swift.h>)
# import <MixedPod/MixedPod-Swift.h>
#else
// This really shouldn't be neccessary (ideally the first would just work)
// Additionally, it shouldn't show as "not found" in the navigator
# import "MixedPod-Swift.h"
#endif
@import
ObjCPod
;
@import
SwiftPod
;
#import <Foundation/Foundation.h>
@implementation
BCE
+
(
void
)
meow
{
id
a
=
[
ABC
new
];
// from ObjCPod
[[
XYZ
new
]
doThing
:
@"in bce.m"
];
// from SwiftPod
NSLog
(
@"meow meow"
);
(
void
)[[
Foo
alloc
]
initWithS
:
a
];
// from MixedPod
}
@end
examples/Modules Example/MixedPod/src/foo.swift
0 → 100644
View file @
39d0fd4a
import
SwiftPod
import
ObjCPod
func
testImportedThings
()
{
print
(
XYZStruct
(
name
:
"string"
))
print
(
ABC
())
}
public
func
superMeow
()
->
BCE
{
testImportedThings
()
BCE
.
meow
()
return
BCE
()
}
@objc
public
class
Foo
:
NSObject
{
@objc
public
init
(
s
:
AnyObject
)
{
print
(
"Initializing with
\(
s
)
"
)
}
}
examples/Modules Example/ObjCPod/ObjCPod.podspec
0 → 100644
View file @
39d0fd4a
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
"ObjCPod"
s
.
version
=
"0.0.1"
s
.
summary
=
"A long description of objc."
s
.
source
=
{
:git
=>
"http://foo/objc.git"
,
:tag
=>
"
#{
s
.
version
}
"
}
s
.
authors
=
[
'me'
]
s
.
homepage
=
'http://example.com'
s
.
license
=
'proprietary'
s
.
source_files
=
"src/**/*.{h,m,swift}"
s
.
public_header_files
=
"src/**/*.h"
s
.
ios
.
deployment_target
=
'9.0'
s
.
macos
.
deployment_target
=
'10.10'
s
.
pod_target_xcconfig
=
{
'DEFINES_MODULE'
=>
'YES'
,
}
end
examples/Modules Example/ObjCPod/src/abc.h
0 → 100644
View file @
39d0fd4a
@interface
ABC
:
NSObject
+
(
void
)
bark
;
@end
\ No newline at end of file
examples/Modules Example/ObjCPod/src/abc.m
0 → 100644
View file @
39d0fd4a
#import <ObjCPod/abc.h>
#import <Foundation/Foundation.h>
@implementation
ABC
+
(
void
)
bark
{
NSLog
(
@"woof woof"
);
}
@end
examples/Modules Example/Podfile
0 → 100644
View file @
39d0fd4a
workspace
'Examples.xcworkspace'
abstract_target
'Abstract Target'
do
pod
'ObjCPod'
,
path:
'ObjCPod'
pod
'SwiftPod'
,
path:
'SwiftPod'
pod
'MixedPod'
,
path:
'MixedPod'
pod
'CustomModuleMapPod'
,
path:
'CustomModuleMapPod'
pod
'Alamofire'
,
path:
'../Alamofire Example/Alamofire'
%w[iOS macOS]
.
each
do
|
platform
|
abstract_target
"
#{
platform
}
Pods"
do
project
"
#{
platform
}
Modules.xcodeproj"
case
platform
when
'iOS'
then
self
.
platform
:ios
,
'10.0'
when
'macOS'
then
self
.
platform
:macos
,
'10.10'
end
target
'Static'
do
use_frameworks!
(
false
)
end
target
'Dynamic'
do
use_frameworks!
(
true
)
end
end
end
end
ENV
[
'COCOAPODS_DISABLE_STATS'
]
=
'true'
examples/Modules Example/Static Swift/AppDelegate.swift
0 → 100644
View file @
39d0fd4a
#if os(iOS)
import
UIKit
@UIApplicationMain
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
{
var
window
:
UIWindow
?
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplicationLaunchOptionsKey
:
Any
]?)
->
Bool
{
// Override point for customization after application launch.
return
true
}
}
#elseif os(macOS)
import
Cocoa
@NSApplicationMain
class
AppDelegate
:
NSObject
,
NSApplicationDelegate
{
func
applicationDidFinishLaunching
(
_
aNotification
:
Notification
)
{
}
}
#endif
examples/Modules Example/Static Swift/Assets.xcassets/AppIcon.appiconset/Contents.json
0 → 100644
View file @
39d0fd4a
{
"images"
:
[
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"3x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"29x29"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"29x29"
,
"scale"
:
"3x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"40x40"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"40x40"
,
"scale"
:
"3x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"60x60"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"60x60"
,
"scale"
:
"3x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"20x20"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"29x29"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"29x29"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"40x40"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"40x40"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"76x76"
,
"scale"
:
"1x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"76x76"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ipad"
,
"size"
:
"83.5x83.5"
,
"scale"
:
"2x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
examples/Modules Example/Static Swift/Base.lproj/LaunchScreen.storyboard
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"13122.16"
systemVersion=
"17A277"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
launchScreen=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
initialViewController=
"01J-lp-oVM"
>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"13104.12"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<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"
>
<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"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"6Tk-OE-BBY"
/>
</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>
examples/Modules Example/Static Swift/Base.lproj/Main.storyboard
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"13122.16"
systemVersion=
"17A277"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
useSafeAreas=
"YES"
colorMatched=
"YES"
initialViewController=
"BYZ-38-t0r"
>
<dependencies>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"13104.12"
/>
<capability
name=
"Safe area layout guides"
minToolsVersion=
"9.0"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
<!--View Controller-->
<scene
sceneID=
"tne-QT-ifu"
>
<objects>
<viewController
id=
"BYZ-38-t0r"
customClass=
"ViewController"
customModuleProvider=
"target"
sceneMemberID=
"viewController"
>
<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"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"1"
blue=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"sRGB"
/>
<viewLayoutGuide
key=
"safeArea"
id=
"6Tk-OE-BBY"
/>
</view>
</viewController>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"dkx-z0-nzr"
sceneMemberID=
"firstResponder"
/>
</objects>
</scene>
</scenes>
</document>
examples/Modules Example/Static Swift/Info.plist
0 → 100644
View file @
39d0fd4a
<
?xml
v
e
rsion="
1
.
0
"
e
n
c
o
d
ing="UT
F
-
8
"?
>
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
$
(
DEVELOPMENT_LANGUAGE
)<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
<
string
>
$
(
PRODUCT_BUNDLE_IDENTIFIER
)<
/string
>
<
k
e
y
>
CFBundleInfoDictionaryVersion
<
/k
e
y
>
<
string
>
6.0
<
/string
>
<
k
e
y
>
CFBundleName
<
/k
e
y
>
<
string
>
$
(
PRODUCT_NAME
)<
/string
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.0
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1
<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
string
>
LaunchScreen
<
/string
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
<
string
>
Main
<
/string
>
<
k
e
y
>
UIRequiredDeviceCapabilities
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
armv7
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
k
e
y
>
UISupportedInterfaceOrientations
~
ipad
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
UIInterfaceOrientationPortrait
<
/string
>
<
string
>
UIInterfaceOrientationPortraitUpsideDown
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeLeft
<
/string
>
<
string
>
UIInterfaceOrientationLandscapeRight
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/plist
>
examples/Modules Example/Static Swift/ModelThing.h
0 → 100644
View file @
39d0fd4a
//
// ModelThing.h
// Static Swift
//
// Created by Samuel Giddins on 1/23/18.
// Copyright © 2018 Samuel Giddins. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface
ModelThing
:
NSObject
+
(
instancetype
)
copy
;
@end
examples/Modules Example/Static Swift/ModelThing.m
0 → 100644
View file @
39d0fd4a
//
// ModelThing.m
// Static Swift
//
// Created by Samuel Giddins on 1/23/18.
// Copyright © 2018 Samuel Giddins. All rights reserved.
//
#import "ModelThing.h"
@import
MixedPod
;
@import
SwiftPod
;
@import
ObjCPod
;
@import
CustomModuleMapPod
;
@import
CustomModuleMapPod
.
Private
;
@implementation
ModelThing
+
(
instancetype
)
copy
{
[
CMM
log
];
// CustomModuleMapPod
CMM_doThing
();
// CustomModuleMapPod.Private
[
BCE
meow
];
// MixedPod
[
ABC
bark
];
// ObjCPod
[
XYZ
.
new
doThing
:
@"objc thing?"
];
// from SwiftPod
return
[
self
.
class
new
];
}
@end
examples/Modules Example/Static Swift/ViewController.swift
0 → 100644
View file @
39d0fd4a
#if os(iOS)
import
UIKit
typealias
BaseViewController
=
UIViewController
#elseif os(macOS)
import
AppKit
typealias
BaseViewController
=
NSViewController
#endif
import
ObjCPod
import
SwiftPod
import
MixedPod
import
Alamofire
class
ViewController
:
BaseViewController
{
#if os(iOS)
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
doThings
()
}
#endif
func
doThings
()
{
ABC
.
bark
()
// ObjCPod
print
(
XYZStruct
(
name
:
""
))
// SwiftPod
XYZ
()
.
doThing
(
"thiiiing"
)
// SwiftPod
print
(
superMeow
())
// MixedPod
BCE
.
meow
()
// MixedPod
print
(
NSClassFromString
(
"ModelThing"
)?
.
copy
()
as
Any
)
// App, done this way to avoid using a bridging header
networkRequest
()
}
func
networkRequest
()
{
Alamofire
.
request
(
"https://httpbin.org/get"
)
.
responseJSON
{
response
in
print
(
"
\n\n
Alamofire:
\n
"
)
print
(
"Request:
\(
String
(
describing
:
response
.
request
)
)
"
)
// original url request
if
let
json
=
response
.
result
.
value
{
print
(
"JSON:
\(
json
)
"
)
// serialized json response
}
}
}
}
examples/Modules Example/SwiftPod/SwiftPod.podspec
0 → 100644
View file @
39d0fd4a
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
"SwiftPod"
s
.
version
=
"0.0.1"
s
.
summary
=
"A long description of objc."
s
.
source
=
{
:git
=>
"http://foo/objc.git"
,
:tag
=>
"
#{
s
.
version
}
"
}
s
.
authors
=
[
'me'
]
s
.
homepage
=
'http://example.com'
s
.
license
=
'proprietary'
s
.
source_files
=
"src/**/*.{h,m,swift}"
s
.
public_header_files
=
"src/**/*.h"
s
.
ios
.
deployment_target
=
'9.0'
s
.
macos
.
deployment_target
=
'10.10'
end
examples/Modules Example/SwiftPod/src/xyz.swift
0 → 100644
View file @
39d0fd4a
import
Foundation
private
func
doTheThing
()
{
print
(
"doing the thing!"
)
}
@objc
public
class
XYZ
:
NSObject
{
@objc
public
func
doThing
(
_
x
:
String
)
{
print
(
"do thing
\(
x
)
:"
)
doTheThing
()
}
}
public
struct
XYZStruct
{
public
let
name
:
String
public
init
(
name
:
String
)
{
self
.
name
=
name
}
}
examples/Modules Example/iOS Modules.xcodeproj/project.pbxproj
0 → 100644
View file @
39d0fd4a
This diff is collapsed.
Click to expand it.
examples/Modules Example/iOS Modules.xcodeproj/xcshareddata/xcschemes/Dynamic iOS.xcscheme
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"0920"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
examples/Modules Example/iOS Modules.xcodeproj/xcshareddata/xcschemes/Static iOS.xcscheme
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"0920"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:iOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
examples/Modules Example/macOS Modules.xcodeproj/project.pbxproj
0 → 100644
View file @
39d0fd4a
This diff is collapsed.
Click to expand it.
examples/Modules Example/macOS Modules.xcodeproj/xcshareddata/xcschemes/Dynamic macOS.xcscheme
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"0920"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248FA2016AE3A009EF3DE"
BuildableName =
"Dynamic.app"
BlueprintName =
"Dynamic"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
examples/Modules Example/macOS Modules.xcodeproj/xcshareddata/xcschemes/Static macOS.xcscheme
0 → 100644
View file @
39d0fd4a
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion =
"0920"
version =
"1.3"
>
<BuildAction
parallelizeBuildables =
"YES"
buildImplicitDependencies =
"YES"
>
<BuildActionEntries>
<BuildActionEntry
buildForTesting =
"YES"
buildForRunning =
"YES"
buildForProfiling =
"YES"
buildForArchiving =
"YES"
buildForAnalyzing =
"YES"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
debugDocumentVersioning =
"YES"
debugServiceExtension =
"internal"
allowLocationSimulation =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration =
"Release"
shouldUseLaunchSchemeArgsEnv =
"YES"
savedToolIdentifier =
""
useCustomWorkingDirectory =
"NO"
debugDocumentVersioning =
"YES"
>
<BuildableProductRunnable
runnableDebuggingMode =
"0"
>
<BuildableReference
BuildableIdentifier =
"primary"
BlueprintIdentifier =
"C06248E42016A708009EF3DE"
BuildableName =
"Static.app"
BlueprintName =
"Static"
ReferencedContainer =
"container:macOS Modules.xcodeproj"
>
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration =
"Debug"
>
</AnalyzeAction>
<ArchiveAction
buildConfiguration =
"Release"
revealArchiveInOrganizer =
"YES"
>
</ArchiveAction>
</Scheme>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment