Skip to content

Commit dee8600

Browse files
committed
● iPad Support
● New version
1 parent a27ca1e commit dee8600

File tree

21 files changed

+553
-408
lines changed

21 files changed

+553
-408
lines changed

Example/media/fullActionSheet.gif

-12.1 MB
Binary file not shown.

Example/xcode projects/MSActionSheet.xcodeproj/project.pbxproj

+23-23
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
E13C608E1E982AB600FE6DB9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E13C608D1E982AB600FE6DB9 /* AppDelegate.swift */; };
1111
E13C60901E982AB600FE6DB9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E13C608F1E982AB600FE6DB9 /* ViewController.swift */; };
1212
E13C60931E982AB600FE6DB9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E13C60911E982AB600FE6DB9 /* Main.storyboard */; };
13-
E13C60961E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = E13C60941E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld */; };
1413
E13C609B1E982AB600FE6DB9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E13C60991E982AB600FE6DB9 /* LaunchScreen.storyboard */; };
1514
E1CD4FFE1E98CDEA006FB0CE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E1CD4FFC1E98CDEA006FB0CE /* Assets.xcassets */; };
1615
E1CD4FFF1E98CDEA006FB0CE /* MSActionSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1CD4FFD1E98CDEA006FB0CE /* MSActionSheet.swift */; };
@@ -21,7 +20,6 @@
2120
E13C608D1E982AB600FE6DB9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2221
E13C608F1E982AB600FE6DB9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
2322
E13C60921E982AB600FE6DB9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
24-
E13C60951E982AB600FE6DB9 /* MSActionSheet.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MSActionSheet.xcdatamodel; sourceTree = "<group>"; };
2523
E13C609A1E982AB600FE6DB9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2624
E13C609C1E982AB600FE6DB9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2725
E1CD4FFC1E98CDEA006FB0CE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -65,7 +63,6 @@
6563
E13C60911E982AB600FE6DB9 /* Main.storyboard */,
6664
E13C60991E982AB600FE6DB9 /* LaunchScreen.storyboard */,
6765
E13C609C1E982AB600FE6DB9 /* Info.plist */,
68-
E13C60941E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld */,
6966
);
7067
path = MSActionSheet;
7168
sourceTree = "<group>";
@@ -97,12 +94,13 @@
9794
isa = PBXProject;
9895
attributes = {
9996
LastSwiftUpdateCheck = 0830;
100-
LastUpgradeCheck = 0830;
97+
LastUpgradeCheck = 0900;
10198
ORGANIZATIONNAME = "Maor Shams";
10299
TargetAttributes = {
103100
E13C60891E982AB600FE6DB9 = {
104101
CreatedOnToolsVersion = 8.3;
105-
DevelopmentTeam = LE75NS246X;
102+
DevelopmentTeam = FPKJ9P7BGC;
103+
LastSwiftMigration = 0900;
106104
ProvisioningStyle = Automatic;
107105
};
108106
};
@@ -146,7 +144,6 @@
146144
E13C60901E982AB600FE6DB9 /* ViewController.swift in Sources */,
147145
E1CD4FFF1E98CDEA006FB0CE /* MSActionSheet.swift in Sources */,
148146
E13C608E1E982AB600FE6DB9 /* AppDelegate.swift in Sources */,
149-
E13C60961E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld in Sources */,
150147
);
151148
runOnlyForDeploymentPostprocessing = 0;
152149
};
@@ -182,15 +179,21 @@
182179
CLANG_CXX_LIBRARY = "libc++";
183180
CLANG_ENABLE_MODULES = YES;
184181
CLANG_ENABLE_OBJC_ARC = YES;
182+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
185183
CLANG_WARN_BOOL_CONVERSION = YES;
184+
CLANG_WARN_COMMA = YES;
186185
CLANG_WARN_CONSTANT_CONVERSION = YES;
187186
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
188187
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
189188
CLANG_WARN_EMPTY_BODY = YES;
190189
CLANG_WARN_ENUM_CONVERSION = YES;
191190
CLANG_WARN_INFINITE_RECURSION = YES;
192191
CLANG_WARN_INT_CONVERSION = YES;
192+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
193+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
193194
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
195+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
196+
CLANG_WARN_STRICT_PROTOTYPES = YES;
194197
CLANG_WARN_SUSPICIOUS_MOVE = YES;
195198
CLANG_WARN_UNREACHABLE_CODE = YES;
196199
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -233,15 +236,21 @@
233236
CLANG_CXX_LIBRARY = "libc++";
234237
CLANG_ENABLE_MODULES = YES;
235238
CLANG_ENABLE_OBJC_ARC = YES;
239+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
236240
CLANG_WARN_BOOL_CONVERSION = YES;
241+
CLANG_WARN_COMMA = YES;
237242
CLANG_WARN_CONSTANT_CONVERSION = YES;
238243
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
239244
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
240245
CLANG_WARN_EMPTY_BODY = YES;
241246
CLANG_WARN_ENUM_CONVERSION = YES;
242247
CLANG_WARN_INFINITE_RECURSION = YES;
243248
CLANG_WARN_INT_CONVERSION = YES;
249+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
250+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
244251
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
252+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
253+
CLANG_WARN_STRICT_PROTOTYPES = YES;
245254
CLANG_WARN_SUSPICIOUS_MOVE = YES;
246255
CLANG_WARN_UNREACHABLE_CODE = YES;
247256
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -271,25 +280,29 @@
271280
isa = XCBuildConfiguration;
272281
buildSettings = {
273282
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
274-
DEVELOPMENT_TEAM = LE75NS246X;
283+
DEVELOPMENT_TEAM = FPKJ9P7BGC;
275284
INFOPLIST_FILE = MSActionSheet/Info.plist;
285+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
276286
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
277287
PRODUCT_BUNDLE_IDENTIFIER = maor.MSActionSheet;
278288
PRODUCT_NAME = "$(TARGET_NAME)";
279-
SWIFT_VERSION = 3.0;
289+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
290+
SWIFT_VERSION = 4.0;
280291
};
281292
name = Debug;
282293
};
283294
E13C60A11E982AB600FE6DB9 /* Release */ = {
284295
isa = XCBuildConfiguration;
285296
buildSettings = {
286297
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
287-
DEVELOPMENT_TEAM = LE75NS246X;
298+
DEVELOPMENT_TEAM = FPKJ9P7BGC;
288299
INFOPLIST_FILE = MSActionSheet/Info.plist;
300+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
289301
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
290302
PRODUCT_BUNDLE_IDENTIFIER = maor.MSActionSheet;
291303
PRODUCT_NAME = "$(TARGET_NAME)";
292-
SWIFT_VERSION = 3.0;
304+
SWIFT_SWIFT3_OBJC_INFERENCE = On;
305+
SWIFT_VERSION = 4.0;
293306
};
294307
name = Release;
295308
};
@@ -315,19 +328,6 @@
315328
defaultConfigurationName = Release;
316329
};
317330
/* End XCConfigurationList section */
318-
319-
/* Begin XCVersionGroup section */
320-
E13C60941E982AB600FE6DB9 /* MSActionSheet.xcdatamodeld */ = {
321-
isa = XCVersionGroup;
322-
children = (
323-
E13C60951E982AB600FE6DB9 /* MSActionSheet.xcdatamodel */,
324-
);
325-
currentVersion = E13C60951E982AB600FE6DB9 /* MSActionSheet.xcdatamodel */;
326-
path = MSActionSheet.xcdatamodeld;
327-
sourceTree = "<group>";
328-
versionGroupType = wrapper.xcdatamodel;
329-
};
330-
/* End XCVersionGroup section */
331331
};
332332
rootObject = E13C60821E982AB600FE6DB9 /* Project object */;
333333
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "2.0">
5+
<Breakpoints>
6+
<BreakpointProxy
7+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
8+
<BreakpointContent
9+
shouldBeEnabled = "Yes"
10+
ignoreCount = "0"
11+
continueAfterRunningActions = "No"
12+
filePath = "MSActionSheet/ViewController.swift"
13+
timestampString = "531165326.469337"
14+
startingColumnNumber = "9223372036854775807"
15+
endingColumnNumber = "9223372036854775807"
16+
startingLineNumber = "16"
17+
endingLineNumber = "16"
18+
landmarkName = "selectImageAction(_:)"
19+
landmarkType = "7">
20+
</BreakpointContent>
21+
</BreakpointProxy>
22+
</Breakpoints>
23+
</Bucket>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>MSActionSheet.xcscheme</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>

Example/xcode projects/MSActionSheet/AppDelegate.swift

+1-46
Original file line numberDiff line numberDiff line change
@@ -41,53 +41,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4141
func applicationWillTerminate(_ application: UIApplication) {
4242
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4343
// Saves changes in the application's managed object context before the application terminates.
44-
self.saveContext()
45-
}
46-
47-
// MARK: - Core Data stack
48-
49-
lazy var persistentContainer: NSPersistentContainer = {
50-
/*
51-
The persistent container for the application. This implementation
52-
creates and returns a container, having loaded the store for the
53-
application to it. This property is optional since there are legitimate
54-
error conditions that could cause the creation of the store to fail.
55-
*/
56-
let container = NSPersistentContainer(name: "MSActionSheet")
57-
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
58-
if let error = error as NSError? {
59-
// Replace this implementation with code to handle the error appropriately.
60-
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
61-
62-
/*
63-
Typical reasons for an error here include:
64-
* The parent directory does not exist, cannot be created, or disallows writing.
65-
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
66-
* The device is out of space.
67-
* The store could not be migrated to the current model version.
68-
Check the error message to determine what the actual problem was.
69-
*/
70-
fatalError("Unresolved error \(error), \(error.userInfo)")
71-
}
72-
})
73-
return container
74-
}()
75-
76-
// MARK: - Core Data Saving support
77-
78-
func saveContext () {
79-
let context = persistentContainer.viewContext
80-
if context.hasChanges {
81-
do {
82-
try context.save()
83-
} catch {
84-
// Replace this implementation with code to handle the error appropriately.
85-
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
86-
let nserror = error as NSError
87-
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
88-
}
89-
}
9044
}
9145

46+
9247
}
9348

Example/xcode projects/MSActionSheet/Assets.xcassets/AppIcon.appiconset/Contents.json

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"idiom" : "iphone",
4040
"size" : "60x60",
4141
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ios-marketing",
45+
"size" : "1024x1024",
46+
"scale" : "1x"
4247
}
4348
],
4449
"info" : {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "Compact Camera_000000_32.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "Compact Camera_000000_50.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "Xlarge Icons_000000_32.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "Xlarge Icons_000000_50.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "Selfie_000000_32.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"filename" : "Selfie_000000_50.png",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "universal",
15+
"scale" : "3x"
16+
}
17+
],
18+
"info" : {
19+
"version" : 1,
20+
"author" : "xcode"
21+
}
22+
}

Example/xcode projects/MSActionSheet/Base.lproj/Main.storyboard

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16A313a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
9+
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
10+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
911
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1012
</dependencies>
1113
<scenes>
@@ -22,13 +24,13 @@
2224
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2325
<subviews>
2426
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Qta-wc-joH">
25-
<rect key="frame" x="12.5" y="158" width="350" height="350"/>
27+
<rect key="frame" x="57" y="202" width="262.5" height="262.5"/>
28+
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
2629
<constraints>
27-
<constraint firstAttribute="width" constant="350" id="L2u-CY-bMd"/>
28-
<constraint firstAttribute="height" constant="350" id="MDr-aV-bus"/>
30+
<constraint firstAttribute="width" secondItem="Qta-wc-joH" secondAttribute="height" multiplier="1:1" id="8jt-Kt-fYE"/>
2931
</constraints>
3032
<state key="normal" title="Select picture">
31-
<color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
33+
<color key="titleColor" red="0.0" green="0.58980089430000004" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3234
</state>
3335
<connections>
3436
<action selector="selectImageAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="vg6-yZ-1M4"/>
@@ -37,8 +39,9 @@
3739
</subviews>
3840
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3941
<constraints>
40-
<constraint firstItem="Qta-wc-joH" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="34h-1P-GkN"/>
41-
<constraint firstItem="Qta-wc-joH" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="5wB-8p-E2b"/>
42+
<constraint firstItem="Qta-wc-joH" firstAttribute="width" secondItem="8bC-Xf-vdC" secondAttribute="width" multiplier="0.7" id="Pt1-Dm-h7R"/>
43+
<constraint firstItem="Qta-wc-joH" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="UAQ-Qn-App"/>
44+
<constraint firstItem="Qta-wc-joH" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="uwg-BJ-VK5"/>
4245
</constraints>
4346
</view>
4447
</viewController>

0 commit comments

Comments
 (0)