Creating Uno with Swift











up vote
0
down vote

favorite












I've starting writing the card game Uno the past couple of days and was wondering if you can review my code please. The initialization is done I think, a couple of game functions already exist, please have look.



Please give me feedback concerning, structure, logic, data structures, naming conventions, anything you're noticing!



I want to make sure everything is set until I move on to the View and Controller.



Thanks in advance!



Marcel



import UIKit
import Foundation

// Represents all jokers of the game.
enum Joker: String, CaseIterable {
// Only four copies of each will be created
case joker, drawFour, swapCircle
func points() -> Int {
switch self {
case .joker, .drawFour, .swapCircle: return 50
} // returns points of each card
}
}

// Represents all "normal" cards.
enum Value: String, CaseIterable {
// A cartesian product with all colors will be built.
case one, two, three, four, five, six, seven, eight, nine, drawTwo, skip, turn
// returns points of each card
func points() -> Int {
switch self {
// THIS DOES NOT LOOK VERY NICE. IS THERE A SMOOTHER WAY?
case .one: return 1
case .two: return 2
case .three: return 3
case .four: return 4
case .five: return 5
case .six: return 6
case .seven: return 7
case .eight: return 8
case .nine: return 9
case .drawTwo, .skip, .turn: return 20
}
}
}

// Represents all colors.
enum Color: String, CaseIterable {
case red, blue, yellow, green
}

// Represents the structure of a card.
struct Card {
let value: Value? // is nil when card is a joker
let color: Color? // is nil when card is a joker
let joker: Joker? // is nil when card has a value and color
}

// Represents the two stacks of the game. Game stack as well as draw stack will be instances of stack, depending on which constructor is called the correct instance will be created.
class Stack {
public var stack: [Card]

// Creates the draw when the game is first initalized.
private static func createDrawStack(with amountOfCards: Int) -> [Card] {
var cards = [Card]()
// add 2 cards of each value
for color in Color.allCases {
for value in Value.allCases {
for _ in 0..<amountOfCards { // add two copies
cards += [Card(value: value, color: color, joker: nil)]
}
}
}
for _ in 0..<(amountOfCards * 2) {
// add 1 swap-circle
cards += [Card(value: nil, color: nil, joker: .swapCircle)]
// add 1 draw-four
cards += [Card(value: nil, color: nil, joker: .drawFour)]
// add 1 joker
cards += [Card(value: nil, color: nil, joker: .joker)]
}
return cards.shuffled() // TODO: In-place shuffling wouldn't work, maybe not shuffling in here is smoother
}

// Creates the game stack when the game is first initalized.
private static func createGameStack(with drawStack: Stack) -> [Card] {
return [drawStack.stack.popLast()!]
}

init(createDrawStackWith amount: Int) {
self.stack = Stack.createDrawStack(with: amount)
}
init(createGameStackWith drawStack: Stack) {
self.stack = Stack.createGameStack(with: drawStack)
}
}

// Represents a player and the actions a player can do.
class Player {
let id: Int
var hand = [Card?]()
var didDraw = false

// Receives index of button pressed and returns the card selected, so that cardsMatch() can check if it's a valid turn. If so, playCard() will be called.
public func wantsToPlayCard(at index: Int) -> Card {
return hand[index]!
}

// Moves card requested from user hand to playStack
public func playCard(at index: Int, onto playStack: Stack) {
if let card = self.hand.remove(at: index) {
playStack.stack.append(card)
}
}

// Moves a card from drawStack to user hand
public func drawCard(from deck: Stack) {
self.hand.append(deck.stack.popLast()!)
}

init(withID id: Int) {
self.id = id
}
}

// Represents the whole game. This is the core of the game.
class Uno {

public var drawStack: Stack // creates a stack to draw from with 2 copies of each color
public var playStack: Stack // creates a stack where the game will be played
public var players: [Player] // will be initialized dependent of amount

// Moves play stack back into draw stack.
public func resetDrawStack() {
let topCard = playStack.stack.popLast()! // save top card
drawStack.stack = playStack.stack // move rest of playStack back into drawStack
drawStack.stack.shuffle()
playStack.stack.removeAll()
playStack.stack += [topCard]
}

// Checks if a requested card can be played or not.
public func cardsMatch(compare topCard: Card, with handCard: Card) -> Bool {
// if colors match
if let colorTopCard = topCard.color, let colorHandCard = handCard.color {
if colorTopCard == colorHandCard {
return true
}
}
// if values match
if let valueTopCard = topCard.value, let valueHandCard = handCard.value {
if valueTopCard == valueHandCard {
return true
}
}
// if its a joker
if let _ = handCard.joker {
return true
}
// else
return false
}

// Deals cards to players at the start of round.
private func dealCards(with amountOfCards: Int) {
for id in players.indices {
for _ in 0..<amountOfCards {
players[id].drawCard(from: drawStack)
}
}
}

// Creates the players.
private static func createPlayers(with amountOfPlayers: Int) -> [Player] {
var players = [Player]()
for id in 0..<amountOfPlayers {
players += [Player(withID: id)]
}
return players
}

// Constructs game dependent on settings.
init(amountOfPlayers: Int, amountOfCopies: Int, amountOfCards: Int) {
self.drawStack = Stack(createDrawStackWith: amountOfCopies)
print(self.drawStack.stack)
self.playStack = Stack(createGameStackWith: self.drawStack)
self.players = Uno.createPlayers(with: amountOfPlayers) // creates 2 players
self.dealCards(with: amountOfCards)
}
}

var game = Uno(amountOfPlayers: 2, amountOfCopies: 2, amountOfCards: 7)









share|improve this question







New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • This isn’t as constructive as most other comments might be, but consider a pun in the title. Something like: Creating a Swift game of Uno or whatever you think is cool.
    – Grant Garrison
    1 hour ago















up vote
0
down vote

favorite












I've starting writing the card game Uno the past couple of days and was wondering if you can review my code please. The initialization is done I think, a couple of game functions already exist, please have look.



Please give me feedback concerning, structure, logic, data structures, naming conventions, anything you're noticing!



I want to make sure everything is set until I move on to the View and Controller.



Thanks in advance!



Marcel



import UIKit
import Foundation

// Represents all jokers of the game.
enum Joker: String, CaseIterable {
// Only four copies of each will be created
case joker, drawFour, swapCircle
func points() -> Int {
switch self {
case .joker, .drawFour, .swapCircle: return 50
} // returns points of each card
}
}

// Represents all "normal" cards.
enum Value: String, CaseIterable {
// A cartesian product with all colors will be built.
case one, two, three, four, five, six, seven, eight, nine, drawTwo, skip, turn
// returns points of each card
func points() -> Int {
switch self {
// THIS DOES NOT LOOK VERY NICE. IS THERE A SMOOTHER WAY?
case .one: return 1
case .two: return 2
case .three: return 3
case .four: return 4
case .five: return 5
case .six: return 6
case .seven: return 7
case .eight: return 8
case .nine: return 9
case .drawTwo, .skip, .turn: return 20
}
}
}

// Represents all colors.
enum Color: String, CaseIterable {
case red, blue, yellow, green
}

// Represents the structure of a card.
struct Card {
let value: Value? // is nil when card is a joker
let color: Color? // is nil when card is a joker
let joker: Joker? // is nil when card has a value and color
}

// Represents the two stacks of the game. Game stack as well as draw stack will be instances of stack, depending on which constructor is called the correct instance will be created.
class Stack {
public var stack: [Card]

// Creates the draw when the game is first initalized.
private static func createDrawStack(with amountOfCards: Int) -> [Card] {
var cards = [Card]()
// add 2 cards of each value
for color in Color.allCases {
for value in Value.allCases {
for _ in 0..<amountOfCards { // add two copies
cards += [Card(value: value, color: color, joker: nil)]
}
}
}
for _ in 0..<(amountOfCards * 2) {
// add 1 swap-circle
cards += [Card(value: nil, color: nil, joker: .swapCircle)]
// add 1 draw-four
cards += [Card(value: nil, color: nil, joker: .drawFour)]
// add 1 joker
cards += [Card(value: nil, color: nil, joker: .joker)]
}
return cards.shuffled() // TODO: In-place shuffling wouldn't work, maybe not shuffling in here is smoother
}

// Creates the game stack when the game is first initalized.
private static func createGameStack(with drawStack: Stack) -> [Card] {
return [drawStack.stack.popLast()!]
}

init(createDrawStackWith amount: Int) {
self.stack = Stack.createDrawStack(with: amount)
}
init(createGameStackWith drawStack: Stack) {
self.stack = Stack.createGameStack(with: drawStack)
}
}

// Represents a player and the actions a player can do.
class Player {
let id: Int
var hand = [Card?]()
var didDraw = false

// Receives index of button pressed and returns the card selected, so that cardsMatch() can check if it's a valid turn. If so, playCard() will be called.
public func wantsToPlayCard(at index: Int) -> Card {
return hand[index]!
}

// Moves card requested from user hand to playStack
public func playCard(at index: Int, onto playStack: Stack) {
if let card = self.hand.remove(at: index) {
playStack.stack.append(card)
}
}

// Moves a card from drawStack to user hand
public func drawCard(from deck: Stack) {
self.hand.append(deck.stack.popLast()!)
}

init(withID id: Int) {
self.id = id
}
}

// Represents the whole game. This is the core of the game.
class Uno {

public var drawStack: Stack // creates a stack to draw from with 2 copies of each color
public var playStack: Stack // creates a stack where the game will be played
public var players: [Player] // will be initialized dependent of amount

// Moves play stack back into draw stack.
public func resetDrawStack() {
let topCard = playStack.stack.popLast()! // save top card
drawStack.stack = playStack.stack // move rest of playStack back into drawStack
drawStack.stack.shuffle()
playStack.stack.removeAll()
playStack.stack += [topCard]
}

// Checks if a requested card can be played or not.
public func cardsMatch(compare topCard: Card, with handCard: Card) -> Bool {
// if colors match
if let colorTopCard = topCard.color, let colorHandCard = handCard.color {
if colorTopCard == colorHandCard {
return true
}
}
// if values match
if let valueTopCard = topCard.value, let valueHandCard = handCard.value {
if valueTopCard == valueHandCard {
return true
}
}
// if its a joker
if let _ = handCard.joker {
return true
}
// else
return false
}

// Deals cards to players at the start of round.
private func dealCards(with amountOfCards: Int) {
for id in players.indices {
for _ in 0..<amountOfCards {
players[id].drawCard(from: drawStack)
}
}
}

// Creates the players.
private static func createPlayers(with amountOfPlayers: Int) -> [Player] {
var players = [Player]()
for id in 0..<amountOfPlayers {
players += [Player(withID: id)]
}
return players
}

// Constructs game dependent on settings.
init(amountOfPlayers: Int, amountOfCopies: Int, amountOfCards: Int) {
self.drawStack = Stack(createDrawStackWith: amountOfCopies)
print(self.drawStack.stack)
self.playStack = Stack(createGameStackWith: self.drawStack)
self.players = Uno.createPlayers(with: amountOfPlayers) // creates 2 players
self.dealCards(with: amountOfCards)
}
}

var game = Uno(amountOfPlayers: 2, amountOfCopies: 2, amountOfCards: 7)









share|improve this question







New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • This isn’t as constructive as most other comments might be, but consider a pun in the title. Something like: Creating a Swift game of Uno or whatever you think is cool.
    – Grant Garrison
    1 hour ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've starting writing the card game Uno the past couple of days and was wondering if you can review my code please. The initialization is done I think, a couple of game functions already exist, please have look.



Please give me feedback concerning, structure, logic, data structures, naming conventions, anything you're noticing!



I want to make sure everything is set until I move on to the View and Controller.



Thanks in advance!



Marcel



import UIKit
import Foundation

// Represents all jokers of the game.
enum Joker: String, CaseIterable {
// Only four copies of each will be created
case joker, drawFour, swapCircle
func points() -> Int {
switch self {
case .joker, .drawFour, .swapCircle: return 50
} // returns points of each card
}
}

// Represents all "normal" cards.
enum Value: String, CaseIterable {
// A cartesian product with all colors will be built.
case one, two, three, four, five, six, seven, eight, nine, drawTwo, skip, turn
// returns points of each card
func points() -> Int {
switch self {
// THIS DOES NOT LOOK VERY NICE. IS THERE A SMOOTHER WAY?
case .one: return 1
case .two: return 2
case .three: return 3
case .four: return 4
case .five: return 5
case .six: return 6
case .seven: return 7
case .eight: return 8
case .nine: return 9
case .drawTwo, .skip, .turn: return 20
}
}
}

// Represents all colors.
enum Color: String, CaseIterable {
case red, blue, yellow, green
}

// Represents the structure of a card.
struct Card {
let value: Value? // is nil when card is a joker
let color: Color? // is nil when card is a joker
let joker: Joker? // is nil when card has a value and color
}

// Represents the two stacks of the game. Game stack as well as draw stack will be instances of stack, depending on which constructor is called the correct instance will be created.
class Stack {
public var stack: [Card]

// Creates the draw when the game is first initalized.
private static func createDrawStack(with amountOfCards: Int) -> [Card] {
var cards = [Card]()
// add 2 cards of each value
for color in Color.allCases {
for value in Value.allCases {
for _ in 0..<amountOfCards { // add two copies
cards += [Card(value: value, color: color, joker: nil)]
}
}
}
for _ in 0..<(amountOfCards * 2) {
// add 1 swap-circle
cards += [Card(value: nil, color: nil, joker: .swapCircle)]
// add 1 draw-four
cards += [Card(value: nil, color: nil, joker: .drawFour)]
// add 1 joker
cards += [Card(value: nil, color: nil, joker: .joker)]
}
return cards.shuffled() // TODO: In-place shuffling wouldn't work, maybe not shuffling in here is smoother
}

// Creates the game stack when the game is first initalized.
private static func createGameStack(with drawStack: Stack) -> [Card] {
return [drawStack.stack.popLast()!]
}

init(createDrawStackWith amount: Int) {
self.stack = Stack.createDrawStack(with: amount)
}
init(createGameStackWith drawStack: Stack) {
self.stack = Stack.createGameStack(with: drawStack)
}
}

// Represents a player and the actions a player can do.
class Player {
let id: Int
var hand = [Card?]()
var didDraw = false

// Receives index of button pressed and returns the card selected, so that cardsMatch() can check if it's a valid turn. If so, playCard() will be called.
public func wantsToPlayCard(at index: Int) -> Card {
return hand[index]!
}

// Moves card requested from user hand to playStack
public func playCard(at index: Int, onto playStack: Stack) {
if let card = self.hand.remove(at: index) {
playStack.stack.append(card)
}
}

// Moves a card from drawStack to user hand
public func drawCard(from deck: Stack) {
self.hand.append(deck.stack.popLast()!)
}

init(withID id: Int) {
self.id = id
}
}

// Represents the whole game. This is the core of the game.
class Uno {

public var drawStack: Stack // creates a stack to draw from with 2 copies of each color
public var playStack: Stack // creates a stack where the game will be played
public var players: [Player] // will be initialized dependent of amount

// Moves play stack back into draw stack.
public func resetDrawStack() {
let topCard = playStack.stack.popLast()! // save top card
drawStack.stack = playStack.stack // move rest of playStack back into drawStack
drawStack.stack.shuffle()
playStack.stack.removeAll()
playStack.stack += [topCard]
}

// Checks if a requested card can be played or not.
public func cardsMatch(compare topCard: Card, with handCard: Card) -> Bool {
// if colors match
if let colorTopCard = topCard.color, let colorHandCard = handCard.color {
if colorTopCard == colorHandCard {
return true
}
}
// if values match
if let valueTopCard = topCard.value, let valueHandCard = handCard.value {
if valueTopCard == valueHandCard {
return true
}
}
// if its a joker
if let _ = handCard.joker {
return true
}
// else
return false
}

// Deals cards to players at the start of round.
private func dealCards(with amountOfCards: Int) {
for id in players.indices {
for _ in 0..<amountOfCards {
players[id].drawCard(from: drawStack)
}
}
}

// Creates the players.
private static func createPlayers(with amountOfPlayers: Int) -> [Player] {
var players = [Player]()
for id in 0..<amountOfPlayers {
players += [Player(withID: id)]
}
return players
}

// Constructs game dependent on settings.
init(amountOfPlayers: Int, amountOfCopies: Int, amountOfCards: Int) {
self.drawStack = Stack(createDrawStackWith: amountOfCopies)
print(self.drawStack.stack)
self.playStack = Stack(createGameStackWith: self.drawStack)
self.players = Uno.createPlayers(with: amountOfPlayers) // creates 2 players
self.dealCards(with: amountOfCards)
}
}

var game = Uno(amountOfPlayers: 2, amountOfCopies: 2, amountOfCards: 7)









share|improve this question







New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I've starting writing the card game Uno the past couple of days and was wondering if you can review my code please. The initialization is done I think, a couple of game functions already exist, please have look.



Please give me feedback concerning, structure, logic, data structures, naming conventions, anything you're noticing!



I want to make sure everything is set until I move on to the View and Controller.



Thanks in advance!



Marcel



import UIKit
import Foundation

// Represents all jokers of the game.
enum Joker: String, CaseIterable {
// Only four copies of each will be created
case joker, drawFour, swapCircle
func points() -> Int {
switch self {
case .joker, .drawFour, .swapCircle: return 50
} // returns points of each card
}
}

// Represents all "normal" cards.
enum Value: String, CaseIterable {
// A cartesian product with all colors will be built.
case one, two, three, four, five, six, seven, eight, nine, drawTwo, skip, turn
// returns points of each card
func points() -> Int {
switch self {
// THIS DOES NOT LOOK VERY NICE. IS THERE A SMOOTHER WAY?
case .one: return 1
case .two: return 2
case .three: return 3
case .four: return 4
case .five: return 5
case .six: return 6
case .seven: return 7
case .eight: return 8
case .nine: return 9
case .drawTwo, .skip, .turn: return 20
}
}
}

// Represents all colors.
enum Color: String, CaseIterable {
case red, blue, yellow, green
}

// Represents the structure of a card.
struct Card {
let value: Value? // is nil when card is a joker
let color: Color? // is nil when card is a joker
let joker: Joker? // is nil when card has a value and color
}

// Represents the two stacks of the game. Game stack as well as draw stack will be instances of stack, depending on which constructor is called the correct instance will be created.
class Stack {
public var stack: [Card]

// Creates the draw when the game is first initalized.
private static func createDrawStack(with amountOfCards: Int) -> [Card] {
var cards = [Card]()
// add 2 cards of each value
for color in Color.allCases {
for value in Value.allCases {
for _ in 0..<amountOfCards { // add two copies
cards += [Card(value: value, color: color, joker: nil)]
}
}
}
for _ in 0..<(amountOfCards * 2) {
// add 1 swap-circle
cards += [Card(value: nil, color: nil, joker: .swapCircle)]
// add 1 draw-four
cards += [Card(value: nil, color: nil, joker: .drawFour)]
// add 1 joker
cards += [Card(value: nil, color: nil, joker: .joker)]
}
return cards.shuffled() // TODO: In-place shuffling wouldn't work, maybe not shuffling in here is smoother
}

// Creates the game stack when the game is first initalized.
private static func createGameStack(with drawStack: Stack) -> [Card] {
return [drawStack.stack.popLast()!]
}

init(createDrawStackWith amount: Int) {
self.stack = Stack.createDrawStack(with: amount)
}
init(createGameStackWith drawStack: Stack) {
self.stack = Stack.createGameStack(with: drawStack)
}
}

// Represents a player and the actions a player can do.
class Player {
let id: Int
var hand = [Card?]()
var didDraw = false

// Receives index of button pressed and returns the card selected, so that cardsMatch() can check if it's a valid turn. If so, playCard() will be called.
public func wantsToPlayCard(at index: Int) -> Card {
return hand[index]!
}

// Moves card requested from user hand to playStack
public func playCard(at index: Int, onto playStack: Stack) {
if let card = self.hand.remove(at: index) {
playStack.stack.append(card)
}
}

// Moves a card from drawStack to user hand
public func drawCard(from deck: Stack) {
self.hand.append(deck.stack.popLast()!)
}

init(withID id: Int) {
self.id = id
}
}

// Represents the whole game. This is the core of the game.
class Uno {

public var drawStack: Stack // creates a stack to draw from with 2 copies of each color
public var playStack: Stack // creates a stack where the game will be played
public var players: [Player] // will be initialized dependent of amount

// Moves play stack back into draw stack.
public func resetDrawStack() {
let topCard = playStack.stack.popLast()! // save top card
drawStack.stack = playStack.stack // move rest of playStack back into drawStack
drawStack.stack.shuffle()
playStack.stack.removeAll()
playStack.stack += [topCard]
}

// Checks if a requested card can be played or not.
public func cardsMatch(compare topCard: Card, with handCard: Card) -> Bool {
// if colors match
if let colorTopCard = topCard.color, let colorHandCard = handCard.color {
if colorTopCard == colorHandCard {
return true
}
}
// if values match
if let valueTopCard = topCard.value, let valueHandCard = handCard.value {
if valueTopCard == valueHandCard {
return true
}
}
// if its a joker
if let _ = handCard.joker {
return true
}
// else
return false
}

// Deals cards to players at the start of round.
private func dealCards(with amountOfCards: Int) {
for id in players.indices {
for _ in 0..<amountOfCards {
players[id].drawCard(from: drawStack)
}
}
}

// Creates the players.
private static func createPlayers(with amountOfPlayers: Int) -> [Player] {
var players = [Player]()
for id in 0..<amountOfPlayers {
players += [Player(withID: id)]
}
return players
}

// Constructs game dependent on settings.
init(amountOfPlayers: Int, amountOfCopies: Int, amountOfCards: Int) {
self.drawStack = Stack(createDrawStackWith: amountOfCopies)
print(self.drawStack.stack)
self.playStack = Stack(createGameStackWith: self.drawStack)
self.players = Uno.createPlayers(with: amountOfPlayers) // creates 2 players
self.dealCards(with: amountOfCards)
}
}

var game = Uno(amountOfPlayers: 2, amountOfCopies: 2, amountOfCards: 7)






swift






share|improve this question







New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









Marcel B

1




1




New contributor




Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Marcel B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • This isn’t as constructive as most other comments might be, but consider a pun in the title. Something like: Creating a Swift game of Uno or whatever you think is cool.
    – Grant Garrison
    1 hour ago


















  • This isn’t as constructive as most other comments might be, but consider a pun in the title. Something like: Creating a Swift game of Uno or whatever you think is cool.
    – Grant Garrison
    1 hour ago
















This isn’t as constructive as most other comments might be, but consider a pun in the title. Something like: Creating a Swift game of Uno or whatever you think is cool.
– Grant Garrison
1 hour ago




This isn’t as constructive as most other comments might be, but consider a pun in the title. Something like: Creating a Swift game of Uno or whatever you think is cool.
– Grant Garrison
1 hour ago















active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");

StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "196"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Marcel B is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f209484%2fcreating-uno-with-swift%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








Marcel B is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Marcel B is a new contributor. Be nice, and check out our Code of Conduct.













Marcel B is a new contributor. Be nice, and check out our Code of Conduct.












Marcel B is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Code Review Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f209484%2fcreating-uno-with-swift%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Ottavio Pratesi

Tricia Helfer

15 giugno